[FL-1722] BLE custom serial service (#685)

* ble: remove heart rate profile
* ble-glue: delete dead code
* ble-glue: dis refactoring
* ble-glue: add battery service
* broken ble_common refactoring
* ble-glue: advertise 128 bit service uid
* ble-glue: remove dead code
* ble: advertise service 16 bit uid depending on flipper color
* ble-glue: remove debug
* ble: intriduce serial service
* ble: serial over ble
* bt: serial echo server
* bt: serial service process indicate acknowledge
* bt: serial service event handler update
* bt: refactore battery service
* bt: add battery level apdate API
* power: update battery level on change
* bt: refactore device information service

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich
2021-09-10 00:11:32 +03:00
committed by GitHub
parent 710f33981a
commit 9bce160ca6
23 changed files with 438 additions and 1121 deletions

View File

@@ -53,47 +53,12 @@
#define BLE_CFG_CLT_MAX_NBR_CB 0
/******************************************************************************
* Device Information Service (DIS)
******************************************************************************/
/**< Options: Supported(1) or Not Supported(0) */
#define BLE_CFG_DIS_MANUFACTURER_NAME_STRING 1
#define BLE_CFG_DIS_MODEL_NUMBER_STRING 1
#define BLE_CFG_DIS_SERIAL_NUMBER_STRING 0
#define BLE_CFG_DIS_HARDWARE_REVISION_STRING 0
#define BLE_CFG_DIS_FIRMWARE_REVISION_STRING 1
#define BLE_CFG_DIS_SOFTWARE_REVISION_STRING 1
#define BLE_CFG_DIS_SYSTEM_ID 0
#define BLE_CFG_DIS_IEEE_CERTIFICATION 0
#define BLE_CFG_DIS_PNP_ID 0
/**
* device information service characteristic lengths
*/
#define BLE_CFG_DIS_SYSTEM_ID_LEN_MAX (8)
#define BLE_CFG_DIS_MODEL_NUMBER_STRING_LEN_MAX (32)
#define BLE_CFG_DIS_SERIAL_NUMBER_STRING_LEN_MAX (32)
#define BLE_CFG_DIS_FIRMWARE_REVISION_STRING_LEN_MAX (32)
#define BLE_CFG_DIS_HARDWARE_REVISION_STRING_LEN_MAX (32)
#define BLE_CFG_DIS_SOFTWARE_REVISION_STRING_LEN_MAX (64)
#define BLE_CFG_DIS_MANUFACTURER_NAME_STRING_LEN_MAX (32)
#define BLE_CFG_DIS_IEEE_CERTIFICATION_LEN_MAX (32)
#define BLE_CFG_DIS_PNP_ID_LEN_MAX (7)
/******************************************************************************
* Heart Rate Service (HRS)
******************************************************************************/
#define BLE_CFG_HRS_BODY_SENSOR_LOCATION_CHAR 1/**< BODY SENSOR LOCATION CHARACTERISTIC */
#define BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG 1/**< ENERGY EXTENDED INFO FLAG */
#define BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG 1/**< Max number of RR interval values - Shall not be greater than 9 */
/******************************************************************************
* GAP Service - Apprearance
******************************************************************************/
#define BLE_CFG_UNKNOWN_APPEARANCE (0)
#define BLE_CFG_HR_SENSOR_APPEARANCE (832)
#define BLE_CFG_GAP_APPEARANCE (BLE_CFG_HR_SENSOR_APPEARANCE)
#define BLE_CFG_GAP_APPEARANCE (0x0086)
/******************************************************************************
* Over The Air Feature (OTA) - STM Proprietary