Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • card10/firmware
  • annejan/firmware
  • astro/firmware
  • fpletz/firmware
  • gerd/firmware
  • fleur/firmware
  • swym/firmware
  • l/firmware
  • uberardy/firmware
  • wink/firmware
  • madonius/firmware
  • mot/firmware
  • filid/firmware
  • q3k/firmware
  • hauke/firmware
  • Woazboat/firmware
  • pink/firmware
  • mossmann/firmware
  • omniskop/firmware
  • zenox/firmware
  • trilader/firmware
  • Danukeru/firmware
  • shoragan/firmware
  • zlatko/firmware
  • sistason/firmware
  • datenwolf/firmware
  • bene/firmware
  • amedee/firmware
  • martinling/firmware
  • griffon/firmware
  • chris007/firmware
  • adisbladis/firmware
  • dbrgn/firmware
  • jelly/firmware
  • rnestler/firmware
  • mh/firmware
  • ln/firmware
  • penguineer/firmware
  • monkeydom/firmware
  • jens/firmware
  • jnaulty/firmware
  • jeffmakes/firmware
  • marekventur/firmware
  • pete/firmware
  • h2obrain/firmware
  • DooMMasteR/firmware
  • jackie/firmware
  • prof_r/firmware
  • Draradech/firmware
  • Kartoffel/firmware
  • hinerk/firmware
  • abbradar/firmware
  • JustTB/firmware
  • LuKaRo/firmware
  • iggy/firmware
  • ente/firmware
  • flgr/firmware
  • Lorphos/firmware
  • matejo/firmware
  • ceddral7/firmware
  • danb/firmware
  • joshi/firmware
  • melle/firmware
  • fitch/firmware
  • deurknop/firmware
  • sargon/firmware
  • markus/firmware
  • kloenk/firmware
  • lucaswerkmeister/firmware
  • derf/firmware
  • meh/firmware
  • dx/card10-firmware
  • torben/firmware
  • yuvadm/firmware
  • AndyBS/firmware
  • klausdieter1/firmware
  • katzenparadoxon/firmware
  • xiretza/firmware
  • ole/firmware
  • techy/firmware
  • thor77/firmware
  • TilCreator/firmware
  • fuchsi/firmware
  • dos/firmware
  • yrlf/firmware
  • PetePriority/firmware
  • SuperVirus/firmware
  • sur5r/firmware
  • tazz/firmware
  • Alienmaster/firmware
  • flo_h/firmware
  • baldo/firmware
  • mmu_man/firmware
  • Foaly/firmware
  • sodoku/firmware
  • Guinness/firmware
  • ssp/firmware
  • led02/firmware
  • Stormwind/firmware
  • arist/firmware
  • coon/firmware
  • mdik/firmware
  • pippin/firmware
  • royrobotiks/firmware
  • zigot83/firmware
  • mo_k/firmware
106 results
Show changes
Commits on Source (131)
Showing
with 638 additions and 248 deletions
......@@ -6,3 +6,4 @@ __pycache__/
*~
compile_commands.json
/tags
/release-*/
......@@ -4,17 +4,95 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- `ls_cmsis_dap`: A tool to enumerate CMSIS-DAP debuggers
### Changed
- `main.py` was moved into an app to allow easier reconfiguration of the
default app. The new `main.py` points to the "old" one so behavior is not
changed.
## [v1.8] - 2019-08-27 11:38 - [HabaneroChilli]
[HabaneroChilli]: https://card10.badge.events.ccc.de/release/card10-v1.8-HabaneroChilli.zip
### Added
- API-call for direct light-sensor readout: `epic_light_sensor_read`.
- Pause mode in ECG-App.
- `bin` field in metatdata for an alternate entrypoint.
- `shell.nix`: Nix-Shell which installs patched OpenOCD and dependencies.
- Cool LED animation in default ECG app.
### Changed
- No longer require locking the display for setting the backlight.
## [v1.7] - 2019-08-24 21:48 - [Garlic]
[Garlic]: https://card10.badge.events.ccc.de/release/card10-v1.7-Garlic.zip
### Added
- **ESB**: Epic Serial Bus (Better than USB!), stability improvements of the
USB module. Preparation for mass-storage access in the Firmware.
- Enabled the Hardware Watchdog; Card10 will reset itself if the firmware crashes
- Log messages when BLE is pairing / connected.
- The name of the offending app is printed to the serial console, if an app
crashes the metatdata parser.
### Changed
- Improved log messages in cases of lock-contention.
- Menu will show an error message if a crash occurs.
### Fixed
- Fixed race-conditions in serial writes by using a queue.
- "Card10 Nickname" crashing if only `nickname.txt` exists.
- Lockup when debug prints are enabled.
- Delayed BHI160 startup a bit so the PMIC task can check the battery first.
- Relaxed the PMIC lock-timeouts so other task can take a little more time.
- Fixed off-by-one error in `gfx_line()`.
- Fixed the API interrupts sometimes getting stuck.
- Fixed binary building on MacOS.
- Fixed race-conditions in serial console prints by introducing a queue.
- Fixed API & MAX30001 mutexes being initialized late sometimes.
- Fixed wrong stripe width in bi flag.
## [v1.6] - 2019-08-23 20:30 - [Fennel]
[Fennel]: https://card10.badge.events.ccc.de/release/card10-v1.6-Fennel.zip
- Maxim BLE SDK update
### Added
- **BLE**: Added personal state API to card10 SVC.
- **ECG**: Support for ECG + Python app
- **BLE**: Characteristic to read the time
### Changed
- Improved performance of circle-drawing algorithm.
### Fixed
- Removed a debug print in the `bhi160` module.
## [v1.5] - 2019-08-23 00:18 - [Eggppppplant]
[Eggppppplant]: https://card10.badge.events.ccc.de/release/card10-v1.5-Eggppppplant.zip
### Added
- **bootloader**: Add an error message when flashing fails.
- **display**: Option to set backlight from Python
- **utime**: Function to read time in ms from Python
### Changed
- **gpio**: Rename constants for consistency.
- **ble**: Storing pairings outside BLE stack context
- **security**: Disable ELFs by default, prevent access to some more files
### Fixed
- **gpio**: Fix field-setting in `gpio_cfg_t`.
## [v1.4] - 2019-08-22 19:43
## [v1.4] - 2019-08-22 19:43 - [DaikonRadish]
[DaikonRadish]: https://card10.badge.events.ccc.de/release/card10-v1.4-DaikonRadish.zip
### Added
- Support for the `bme680` environmental sensor.
- Support for the `bhi160` sensor fusion.
......@@ -35,7 +113,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fixed the PMIC driver not releasing some locks properly.
## [v1.3] - 2019-08-22 00:12
## [v1.3] - 2019-08-22 00:12 - [CCCauliflower]
[CCCauliflower]: https://card10.badge.events.ccc.de/release/card10-v1.3-cccauliflower.zip
### Added
- A splashscreen in Epicardium showing the version number.
- `os.urandom()` function.
......@@ -50,7 +130,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Removed confusing MAXUSB messages.
## [v1.2] - 2019-08-21 18:18
## [v1.2] - 2019-08-21 18:18 - [Broccoli]
[Broccoli]: https://card10.badge.events.ccc.de/release/card10-v1.2-broccoli.zip
```text
8e8d8614 feat(apps): Add scope to preload
......@@ -80,7 +161,7 @@ fbf7c8c0 fix(menu.py) Refactored menu.py based on !138
5e5c7a4f fix(menu.py): Fix color-mismatch of selector background
```
## [v1.1] - 2019-08-21 03:14
## [v1.1] - 2019-08-21 03:14 - Asparagus
### Added
- Seed ``urandom`` PRNG with ``TRNG`` peripheral.
- Show linenumbers in MicroPython tracebacks.
......@@ -93,7 +174,11 @@ fbf7c8c0 fix(menu.py) Refactored menu.py based on !138
## [v1.0] - 2019-08-21 00:50
Initial release.
[Unreleased]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.4...master
[Unreleased]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.8...master
[v1.8]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.7...v1.8
[v1.7]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.6...v1.7
[v1.6]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.5...v1.6
[v1.5]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.4...v1.5
[v1.4]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.3...v1.4
[v1.3]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.2...v1.3
[v1.2]: https://git.card10.badge.events.ccc.de/card10/firmware/compare/v1.1...v1.2
......
......@@ -18,7 +18,7 @@ The current draft uses following service specification:
- Time update characteristic:
UUID: ``42230201-2342-2342-2342-234223422342``
write no response
read and write no response
- Vibra characteristic:
......@@ -70,6 +70,11 @@ The current draft uses following service specification:
UUID: ``42230218-2342-2342-2342-234223422342``
write no response
- Personal State characteristic:
UUID: ``42230219-2342-2342-2342-234223422342``
read and write with response
- LEDs above characteristic:
UUID: ``42230220-2342-2342-2342-234223422342``
......@@ -83,7 +88,7 @@ The current draft uses following service specification:
Time update characteristic
---------------------------------
The time update characteristic makes it possible to set the current time given in milliseconds after 1.1.1970 in the UTC timezone. The value is represented as a big endian ``uint64``
The time update characteristic makes it possible to set and get the current time given in milliseconds after 1.1.1970 in the UTC timezone. The value is represented as a big endian ``uint64``
- Thu Aug 15 19:40:45 UTC 2019 : ``0x0 0x0 0x1 0x6c 0x96 0xcb 0xf8 0xcc``
......@@ -153,6 +158,16 @@ This characteristic makes it possible to activate the flashlight.
- enabled: ``0x01``
- disabled: ``0x00``
Personal state characteristic
---------------------------------
This characteristic makes it possible to read and write the personal state.
It writes always as persistant and it gives feedback if the value is in range and your firmware support it.
- No State ``0x0000``
- No Contact ``0x0100``
- Chaos ``0x0200``
- ...
LEDs above characteristic
---------------------------------
This characteristic set every 11 leds on the top module at once.
......
......@@ -77,9 +77,11 @@ CHUNK_ACK:
===== ===
0 1-4
----- ---
C CRC
C CRC(*)
===== ===
CRC32 of the whole CHUNK packet including first byte, offset and payload.
FINISH:
=== ===
......
......@@ -88,9 +88,11 @@ html_context = {
# -- Options for Auto-Doc ---------------------------------------------------- {{{
autodoc_mock_imports = [
"buttons",
"interrupt",
"sys_display",
"sys_leds",
"buttons",
"sys_max30001",
"ucollections",
"urandom",
"utime",
......
......@@ -28,20 +28,23 @@ Dependencies
.. code-block:: shell-session
dnf install arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib
- macOS (Note: The card10 firmware team used Linux so far. macOS recommendations here are experimental.)
You can use `Homebrew`_ to install the required tools.
The version of the Arm crosscompiler tool chain is quite important; with the wrong version, e.g. strip and/or ld might throw strange errors.
You can use `Homebrew`_ to install the required tools. The version of the
ARM crosscompiler tool chain is quite important; with the wrong version,
e.g. strip and/or ld might throw strange errors.
.. code-block:: shell-session
brew tap px4/px4
brew install px4/px4/gcc-arm-none-eabi-63
brew install coreutils
.. _Homebrew: https://brew.sh/
- Alternative: Download `ARM's GNU toolchain`_. **TODO**
.. _Homebrew: https://brew.sh/
* **python3**: For meson and various scripts needed for building.
* **meson** (>0.43.0) & **ninja**: Unfortunately most distros only have very old versions
......@@ -140,3 +143,13 @@ In order to do a rebuild you can issue a clean command to ninja via
$ ninja -C build/ -t clean
Otherwise, rerunning ``./bootstrap.sh`` will also clean the build-directory.
.. note::
If you try to flash pycardium_epicardium.bin (renamed to card10.bin)
and the bootloader does not finish updating, the file might be too large.
~700kB is the normal size, but problems were reported where the file size
was >1MB. This was caused by the ``tr`` tool in the build process
(it's supposed to create a large file with 0xff in it) - this requires the
LC_ALL environment variable to be not set, or set to "C"
(but not UTF8 or similar).
\ No newline at end of file
......@@ -22,7 +22,9 @@ Last but not least, if you want to start hacking the lower-level firmware, the
pycardium/overview
pycardium/stdlib
pycardium/bhi160
pycardium/bme680
pycardium/max30001
pycardium/buttons
pycardium/color
pycardium/display
......@@ -32,10 +34,10 @@ Last but not least, if you want to start hacking the lower-level firmware, the
pycardium/os
pycardium/personal_state
pycardium/power
pycardium/pride
pycardium/simple_menu
pycardium/utime
pycardium/vibra
pycardium/pride
.. toctree::
:maxdepth: 1
......
.. py:module:: bhi160
``bhi160`` - Sensor Fusion
==========================
.. versionadded:: 1.4
Supports the BHI160 sensor on the card10 for accelerometer, gyroscope...
**Example**:
.. code-block:: python
import bhi160
import utime
bhi = bhi160.BHI160Orientation()
while True:
samples = bhi.read()
print(samples)
utime.sleep(0.5)
.. class:: bhi160.BHI160Orientation(sample_rate,dynamic_range,callback,sample_buffer_len)
Orientation of the BHI160
Parameters:
sample_rate: int, optional
Sample rate (default is 4)
dynamic_range: int, optional
Dynamic range (default is 2)
callback: callable, optional
Call this callback when enough data is collected (default is None)
.. todo:: The callback functionality is untested, so do not be confused if it does not work.
sample_buffer_len: int, optional
Length of sample buffer (default is 200)
.. py:method:: read():
Read sensor values
:returns: Collected sensor values as list
.. py:method:: close():
Close the connection to the sensor
.. class:: bhi160.BHI160Accelerometer
Accelerometer of the BHI160
Parameters:
sample_rate: int, optional
Sample rate (default is 4)
dynamic_range: int, optional
Dynamic range (default is 2)
callback: callable, optional
Call this callback when enough data is collected (default is None)
.. todo:: The callback functionality is untested, so do not be confused if it does not work.
sample_buffer_len: int, optional
Length of sample buffer (default is 200)
.. py:method:: read():
Read sensor values
:returns: Collected sensor values as list
.. py:method:: close():
Close the connection to the sensor
.. class:: bhi160.BHI160Gyroscope
Gyroscope of the BHI160
Parameters:
sample_rate: int, optional
Sample rate (default is 4)
dynamic_range: int, optional
Dynamic range (default is 2)
callback: callable, optional
Call this callback when enough data is collected (default is None)
.. todo:: The callback functionality is untested, so do not be confused if it does not work.
sample_buffer_len: int, optional
Length of sample buffer (default is 200)
.. py:method:: read():
Read sensor values
:returns: Collected sensor values as list
.. py:method:: close():
Close the connection to the sensor
......@@ -25,3 +25,13 @@ be fairly stable.
.. py:function:: stop()
Stop the ADC.
.. py:function:: read()
Direct readout of the light-sensor.
Use this function for low latency readout. The time between polls can have
an effect on the values measures. If you do not need low latency, prefer
:py:func:`light_sensor.get_reading`.
.. versionadded:: 1.8
``max30001`` - MAX30001
=======================
.. automodule:: max30001
:members:
......@@ -36,8 +36,46 @@ Baud-rate is 115200. Some options are:
* **screen**: ``sudo screen /dev/ttyACM0 115200``
* **picocom**: ``sudo picocom -b 115200 /dev/ttyACM0``
After connecting, reboot card10 and you should see the MicroPython REPL pop up.
After connecting, reboot reset the card10 via the power button (left upper
corner) and you should see the output of **menu.py** script (it's located in
*preload/menu.py*). You can press CTRL-C to interrupt the script and jump into
the MicroPython prompt.
To switch on the blue fairy dust you must import the led python module::
import leds
and power it on::
leds.set_rocket(0, 31)
REPL modes
^^^^^^^^^^
MicroPython supports a different REPL modes over the serial console. The modes
can be changed on every new line.
Normal mode
"""""""""""
This is the mode you will first see. You can switch to it by pressing CTRL-B.
If you are in a other mode you can return to this mode by pressing CTRL-B too.
Paste mode
""""""""""
You can enter the paste mode by pressing CTRL-E and you can simple copy 'n'
paste your source code into the console and it will be interpreted and executed
line by line. Every new line will be reply by the prompt with **===**.
RAW mode
""""""""
The RAW mode to be intendend for the usage with tools. By pressing CTRL-A you
will enter the RAW REPL mode. The type in code will not printed. By pressing
CTRL-D the whole entered code will be evaluated and executed. The board will
reply with **OK** and print after that the output (print commands) of the code
or give you tracebacks if an error occured.
You can use **pycard10** (tools/pycard10.py) to execute python files from your
PC directly on the card10.
.. todo::
Getting Started Guide for people interested in writing Python code.
......@@ -28,6 +28,11 @@ alarm.
Return the current timestamp in seconds since 2000-01-01 00:00 in
the local timezone.
.. py:function:: time_ms()
Return the current timestamp in milliseconds since 2000-01-01 00:00 in
the local timezone.
.. py:function:: set_time(secs)
Sets the time to ``secs`` seconds since 2000-01-01 00:00 in the local
......
......@@ -6,7 +6,7 @@ BIN1="$2"
BIN2="$3"
BINOUT="$4"
dd if=/dev/zero ibs=1k count=448 2>/dev/null | LANG=C LC_CTYPE=C tr "\000" "\377" > "$BINOUT"
dd if=/dev/zero ibs=1k count=448 2>/dev/null | LANG=C LC_CTYPE=C LC_ALL=C LC_COLLATE=C tr "\000" "\377" > "$BINOUT"
dd if="$BIN1" of="$BINOUT" conv=notrunc 2>/dev/null
dd if="$BIN2" >> "$BINOUT" 2>/dev/null
......
......@@ -52,7 +52,7 @@
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTimerPendFunctionCall 1
/* Allow static allocation of data structures */
#define configSUPPORT_STATIC_ALLOCATION 1
......
......@@ -38,7 +38,7 @@ struct api_call_mem {
api_id_t id;
/* ID of the current interrupt */
api_int_id_t int_id;
volatile api_int_id_t int_id;
/*
* Buffer for arguments/return value. This buffer will be
......
......@@ -37,6 +37,8 @@
#include "app_main.h"
#include "app_ui.h"
#include "modules/log.h"
/**************************************************************************************************
Global Variables
**************************************************************************************************/
......@@ -283,6 +285,8 @@ void AppHandleNumericComparison(dmSecCnfIndEvt_t *pCnfInd)
{
uint32_t confirm = DmSecGetCompareValue(pCnfInd->confirm);
LOG_INFO("ble", "Confirm Value: %ld", confirm);
/* display confirmation value */
AppUiDisplayConfirmValue(confirm);
......
......@@ -16,8 +16,9 @@
#include <string.h>
#include <stdbool.h>
#define FACTOR 2
#define WSF_BUF_POOLS 6
#define WSF_BUF_SIZE 0x1048
#define WSF_BUF_SIZE (0x1048 * FACTOR)
uint32_t SystemHeapSize = WSF_BUF_SIZE;
uint32_t SystemHeap[WSF_BUF_SIZE / 4];
......@@ -30,12 +31,12 @@ static TaskHandle_t ble_task_id = NULL;
/* clang-format off */
static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] =
{
{ 16, 8 },
{ 32, 4 },
{ 64, 4 },
{ 128, 4 },
{ 256, 4 },
{ 512, 4 }
{ 16, 8*FACTOR },
{ 32, 4*FACTOR },
{ 64, 4*FACTOR },
{ 128, 4*FACTOR },
{ 256, 4*FACTOR },
{ 512, 4*FACTOR }
};
/* clang-format on */
......
......@@ -38,6 +38,8 @@
#include "hrps/hrps_api.h"
#include "rscp/rscp_api.h"
#include "modules/log.h"
/**************************************************************************************************
Macros
**************************************************************************************************/
......@@ -373,6 +375,7 @@ static void bleSetup(bleMsg_t *pMsg)
static void bleProcMsg(bleMsg_t *pMsg)
{
uint8_t uiEvent = APP_UI_NONE;
hciLeConnCmplEvt_t *connOpen;
switch(pMsg->hdr.event)
{
......@@ -395,36 +398,88 @@ static void bleProcMsg(bleMsg_t *pMsg)
break;
case DM_ADV_START_IND:
LOG_INFO("ble", "Advertisement started");
uiEvent = APP_UI_ADV_START;
break;
case DM_ADV_STOP_IND:
LOG_INFO("ble", "Advertisement stopped");
uiEvent = APP_UI_ADV_STOP;
break;
case DM_CONN_OPEN_IND:
connOpen = &pMsg->dm.connOpen;
LOG_INFO("ble", "connection from %02X:%02X:%02X:%02X:%02X:%02X opened",
connOpen->peerAddr[0], connOpen->peerAddr[1],
connOpen->peerAddr[2], connOpen->peerAddr[3],
connOpen->peerAddr[4], connOpen->peerAddr[5]);
BasProcMsg(&pMsg->hdr);
uiEvent = APP_UI_CONN_OPEN;
break;
case DM_CONN_CLOSE_IND:
switch (pMsg->dm.connClose.reason)
{
case HCI_ERR_CONN_TIMEOUT:
LOG_INFO("ble", "Connection closed (0x%02X), Connection timeout",
pMsg->dm.connClose.reason);
break;
case HCI_ERR_LOCAL_TERMINATED:
LOG_INFO("ble", "Connection closed (0x%02X), Connection terminated by local host",
pMsg->dm.connClose.reason);
break;
case HCI_ERR_REMOTE_TERMINATED:
LOG_INFO("ble", "Connection closed (0x%02X), Remote user terminated connection",
pMsg->dm.connClose.reason);
break;
case HCI_ERR_CONN_FAIL:
LOG_INFO("ble", "Connection closed (0x%02X), Connection failed to be established",
pMsg->dm.connClose.reason);
break;
case HCI_ERR_MIC_FAILURE:
LOG_INFO("ble", "Connection closed (0x%02X), Connection terminated due to MIC failure",
pMsg->dm.connClose.reason);
break;
default:
LOG_INFO("ble", "Connection closed (0x%02X)",
pMsg->dm.connClose.reason);
break;
}
bleClose(pMsg);
uiEvent = APP_UI_CONN_CLOSE;
break;
case DM_SEC_PAIR_CMPL_IND:
LOG_INFO("ble", "Secure pairing successful, auth: 0x%02X",
pMsg->dm.pairCmpl.auth);
uiEvent = APP_UI_SEC_PAIR_CMPL;
break;
case DM_SEC_PAIR_FAIL_IND:
switch (pMsg->hdr.status) {
case SMP_ERR_TIMEOUT:
LOG_INFO("ble", "Secure pairing failed (0x%02X), Transaction timeout",
pMsg->hdr.status);
break;
case SMP_ERR_ATTEMPTS:
LOG_INFO("ble", "Secure pairing failed (0x%02X), Repeated attempts",
pMsg->hdr.status);
break;
default:
LOG_INFO("ble", "Secure pairing failed (0x%02X)",
pMsg->hdr.status);
break;
}
uiEvent = APP_UI_SEC_PAIR_FAIL;
break;
case DM_SEC_ENCRYPT_IND:
LOG_INFO("ble", "Encrypted handshake successful");
uiEvent = APP_UI_SEC_ENCRYPT;
break;
case DM_SEC_ENCRYPT_FAIL_IND:
LOG_INFO("ble", "Encrypted handshake failed");
uiEvent = APP_UI_SEC_ENCRYPT_FAIL;
break;
......@@ -441,6 +496,7 @@ static void bleProcMsg(bleMsg_t *pMsg)
break;
case DM_HW_ERROR_IND:
LOG_ERR("ble", "HW Error");
uiEvent = APP_UI_HW_ERROR;
break;
......
......@@ -27,8 +27,8 @@ enum {
/*!< \brief card10 service declaration */
CARD10_SVC_HDL = CARD10_START_HDL,
/*!< \brief time update characteristic */
CARD10_TIME_UPDATE_CH_HDL,
CARD10_TIME_UPDATE_VAL_HDL,
CARD10_TIME_CH_HDL,
CARD10_TIME_VAL_HDL,
/*!< \brief vibra characteristic */
CARD10_VIRBA_CH_HDL,
CARD10_VIBRA_VAL_HDL,
......@@ -59,6 +59,9 @@ enum {
/*!< \brief flashlight characteristic */
CARD10_FLASHLIGHT_CH_HDL,
CARD10_FLASHLIGHT_VAL_HDL,
/*!< \brief flashlight characteristic */
CARD10_PERSONAL_STATE_CH_HDL,
CARD10_PERSONAL_STATE_VAL_HDL,
/*!< \brief leds above characteristic */
CARD10_LEDS_ABOVE_CH_HDL,
CARD10_LEDS_ABOVE_VAL_HDL,
......@@ -78,12 +81,16 @@ static const uint16_t UUID_len = sizeof(UUID_svc);
// starting at 0x01 with write (non visual) charateristics
/* BLE UUID for card10 time update */
/* BLE UUID for card10 time */
static const uint8_t UUID_char_time[] = {
ATT_PROP_WRITE_NO_RSP,
UINT16_TO_BYTES(CARD10_TIME_UPDATE_VAL_HDL),
(ATT_PROP_READ | ATT_PROP_WRITE_NO_RSP),
UINT16_TO_BYTES(CARD10_TIME_VAL_HDL),
CARD10_UUID_SUFFIX, 0x01, CARD10_UUID_PREFIX
};
static uint8_t timeValue[] = { UINT32_TO_BYTES(0), UINT32_TO_BYTES(0) };
static uint16_t timeLen = sizeof(timeValue);
// works vor everyone?
static const uint16_t UUID_char_len = sizeof(UUID_char_time);
......@@ -204,6 +211,20 @@ static const uint8_t UUID_attChar_flashlight[] = {
CARD10_UUID_SUFFIX, 0x18, CARD10_UUID_PREFIX
};
/* BLE UUID for card10 personal state */
static const uint8_t UUID_char_personal_state[] = {
ATT_PROP_READ | ATT_PROP_WRITE,
UINT16_TO_BYTES(CARD10_PERSONAL_STATE_VAL_HDL),
CARD10_UUID_SUFFIX, 0x19, CARD10_UUID_PREFIX
};
static const uint8_t UUID_attChar_personal_state[] = {
CARD10_UUID_SUFFIX, 0x19, CARD10_UUID_PREFIX
};
static uint8_t personalStateValue = 0;
static uint16_t personalStateLen = sizeof(personalStateValue);
/* BLE UUID for card10 above leds */
static const uint8_t UUID_char_leds_above[] = {
ATT_PROP_WRITE_NO_RSP,
......@@ -228,259 +249,236 @@ static const uint8_t UUID_attChar_light_sensor[] = {
static uint8_t initLightSensorValue[] = { UINT16_TO_BYTES(0) };
static uint16_t initLightSensorLen = sizeof(initLightSensorValue);
/* clang-format on */
/*
* Create the BLE service description.
*/
static const attsAttr_t card10SvcAttrList[] =
{
{
.pUuid = attPrimSvcUuid,
.pValue = (uint8_t *) UUID_svc,
.pLen = (uint16_t *) &UUID_len,
.maxLen = sizeof(UUID_svc),
.permissions = ATTS_PERMIT_READ
},
static const attsAttr_t card10SvcAttrList[] = {
{ .pUuid = attPrimSvcUuid,
.pValue = (uint8_t *)UUID_svc,
.pLen = (uint16_t *)&UUID_len,
.maxLen = sizeof(UUID_svc),
.permissions = ATTS_PERMIT_READ },
// TIME
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_time,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_time),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_time,
.pValue = NULL,
.maxLen = sizeof(uint64_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_time,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_time),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_time,
.pValue = timeValue,
.pLen = &timeLen,
.maxLen = sizeof(uint64_t),
.settings = (ATTS_SET_WRITE_CBACK | ATTS_SET_READ_CBACK),
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH | ATTS_PERMIT_READ |
ATTS_PERMIT_READ_ENC | ATTS_PERMIT_READ_AUTH) },
// VIBRA
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_vibra,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_vibra),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_vibra,
.pValue = NULL,
.maxLen = sizeof(uint16_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_vibra,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_vibra),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_vibra,
.pValue = NULL,
.maxLen = sizeof(uint16_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// ROCKETS
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_rockets,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_rockets),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_rockets,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_rockets,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_rockets),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_rockets,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// BG LED Bottom left
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_led_bg_bottom_left,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_led_bg_bottom_left),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_led_bg_bottom_left,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_led_bg_bottom_left,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_led_bg_bottom_left),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_led_bg_bottom_left,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// BG LED Bottom right
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_led_bg_bottom_right,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_led_bg_bottom_right),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_led_bg_bottom_right,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_led_bg_bottom_right,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_led_bg_bottom_right),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_led_bg_bottom_right,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// BG LED top right
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_led_bg_top_right,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_led_bg_top_right),
.settings = 0,
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_led_bg_top_right,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_led_bg_top_right,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_led_bg_top_right),
.settings = 0,
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_led_bg_top_right,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// BG LED top left
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_led_bg_top_left,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_led_bg_top_left),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_led_bg_top_left,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_led_bg_top_left,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_led_bg_top_left),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_led_bg_top_left,
.pValue = NULL,
.maxLen = 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// Dim bottom module
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_leds_bottom_dim,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_leds_bottom_dim),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_leds_bottom_dim,
.pValue = NULL,
.pLen = 0,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_leds_bottom_dim,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_leds_bottom_dim),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_leds_bottom_dim,
.pValue = NULL,
.pLen = 0,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// Dim top module
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_leds_top_dim,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_leds_top_dim),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_leds_top_dim,
.pValue = NULL,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_leds_top_dim,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_leds_top_dim),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_leds_top_dim,
.pValue = NULL,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// led powersafe
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_led_powersafe,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_led_powersafe),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_led_powersafe,
.pValue = NULL,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_led_powersafe,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_led_powersafe),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_led_powersafe,
.pValue = NULL,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// flashlight
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_flashlight,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_flashlight),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_flashlight,
.pValue = NULL,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_flashlight,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_flashlight),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_flashlight,
.pValue = NULL,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// personal state
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_personal_state,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_personal_state),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_personal_state,
.pValue = &personalStateValue,
.pLen = &personalStateLen,
.maxLen = sizeof(uint16_t),
.settings = (ATTS_SET_WRITE_CBACK | ATTS_SET_READ_CBACK),
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH | ATTS_PERMIT_READ |
ATTS_PERMIT_READ_ENC | ATTS_PERMIT_READ_AUTH) },
// ABOVE LEDS
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_leds_above,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_leds_above),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_leds_above,
.pValue = NULL,
.maxLen = 11 * 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions = (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH)
},
// ABOVE LEDS
{
.pUuid = attChUuid,
.pValue = (uint8_t *) UUID_char_light_sensor,
.pLen = (uint16_t *) &UUID_char_len,
.maxLen = sizeof(UUID_char_light_sensor),
.permissions = ATTS_PERMIT_READ
},
{
.pUuid = UUID_attChar_light_sensor,
.pValue = initLightSensorValue,
.pLen = &initLightSensorLen,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_READ_CBACK,
.permissions = (ATTS_PERMIT_READ | ATTS_PERMIT_READ_ENC |
ATTS_PERMIT_READ_AUTH)
},
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_leds_above,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_leds_above),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_leds_above,
.pValue = NULL,
.maxLen = 11 * 3 * sizeof(uint8_t),
.settings = ATTS_SET_WRITE_CBACK,
.permissions =
(ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC |
ATTS_PERMIT_WRITE_AUTH) },
// Light sensor
{ .pUuid = attChUuid,
.pValue = (uint8_t *)UUID_char_light_sensor,
.pLen = (uint16_t *)&UUID_char_len,
.maxLen = sizeof(UUID_char_light_sensor),
.permissions = ATTS_PERMIT_READ },
{ .pUuid = UUID_attChar_light_sensor,
.pValue = initLightSensorValue,
.pLen = &initLightSensorLen,
.maxLen = sizeof(uint8_t),
.settings = ATTS_SET_READ_CBACK,
.permissions =
(ATTS_PERMIT_READ | ATTS_PERMIT_READ_ENC |
ATTS_PERMIT_READ_AUTH) },
};
/* clang-format on */
// validating, that the service really get all charateristics
WSF_CT_ASSERT(
......@@ -498,7 +496,7 @@ static uint8_t setTime(uint8_t *pValue)
time = __bswap64(timeNet);
epic_rtc_set_milliseconds(time);
APP_TRACE_INFO1("ble-card10: set time to: %d\n", time);
APP_TRACE_INFO0("ble-card10: set time");
return ATT_SUCCESS;
}
......@@ -520,7 +518,7 @@ static uint8_t writeCard10CB(
switch (handle) {
// time
case CARD10_TIME_UPDATE_VAL_HDL:
case CARD10_TIME_VAL_HDL:
return setTime(pValue);
// vibra
case CARD10_VIBRA_VAL_HDL:
......@@ -654,6 +652,41 @@ static uint8_t writeCard10CB(
epic_set_flashlight(pValue[0]);
APP_TRACE_INFO1("set flashlight to: %d\n", pValue[0]);
return ATT_SUCCESS;
// personal state
case CARD10_PERSONAL_STATE_VAL_HDL:
BYTES_TO_UINT16(ui16, pValue);
if (ui16 <= STATE_MAX) {
if (operation == ATT_PDU_WRITE_CMD ||
operation == ATT_PDU_SIGNED_WRITE_CMD ||
operation == ATT_PDU_WRITE_REQ ||
operation == ATT_PDU_EXEC_WRITE_REQ) {
epic_personal_state_set(ui16, true);
APP_TRACE_INFO1(
"ble-card10: set personal state to: %d\n",
ui16
);
return ATT_SUCCESS;
} else if (operation == ATT_PDU_PREP_WRITE_REQ) {
APP_TRACE_INFO1(
"ble_card10: personal state would be okay: %d\n",
ui16
);
return ATT_SUCCESS;
} else {
APP_TRACE_INFO1(
"ble-card10: personal state with unknown operation: %d\n",
operation
);
return ATT_ERR_INVALID_PDU;
}
} else {
APP_TRACE_INFO2(
"ble-card: personal state invalid value (0-%d): %d\n",
STATE_MAX - 1,
ui16
);
return ATT_ERR_RANGE;
}
// leds above
case CARD10_LEDS_ABOVE_VAL_HDL:
for (ui16 = 0; ui16 < 11; ui16++) {
......@@ -691,8 +724,23 @@ static uint8_t readCard10CB(
attsAttr_t *pAttr
) {
uint16_t ui16 = 0;
uint64_t ui64 = 0;
switch (handle) {
case CARD10_TIME_VAL_HDL:
ui64 = epic_rtc_get_milliseconds();
uint64_t time;
time = __bswap64(ui64);
memcpy(pAttr->pValue, &time, sizeof(time));
APP_TRACE_INFO0("ble-card10: read time\n");
return ATT_SUCCESS;
case CARD10_PERSONAL_STATE_VAL_HDL:
ui16 = epic_personal_state_get();
*pAttr->pValue = ui16;
APP_TRACE_INFO1("ble-card10: read personal state: %d\n", ui16);
return ATT_SUCCESS;
case CARD10_LIGHT_SENSOR_VAL_HDL:
epic_light_sensor_get(&ui16);
*pAttr->pValue = ui16;
......
......@@ -98,6 +98,7 @@ const LlRtCfg_t _ll_cfg = {
const BbRtCfg_t _bb_cfg = {
/*clkPpm*/ 20,
/*rfSetupDelayUsec*/ BB_RF_SETUP_DELAY_US,
/*defaultTxPower*/ -10,
/*maxScanPeriodMsec*/ BB_MAX_SCAN_PERIOD_MS,
/*schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US
};
......