Skip to content
Snippets Groups Projects
Commit aa0849ae authored by schneider's avatar schneider
Browse files

change(ble): Remove unused battery service

It was never properly implemented and only leads to confusion.
parent ad28755b
No related branches found
No related tags found
1 merge request!437change(ble): Remove unused battery service
Pipeline #5048 passed
...@@ -60,19 +60,6 @@ static struct epic_scan_report scan_reports[SCAN_REPORTS_NUM]; ...@@ -60,19 +60,6 @@ static struct epic_scan_report scan_reports[SCAN_REPORTS_NUM];
static int scan_reports_head; static int scan_reports_head;
static int scan_reports_tail; static int scan_reports_tail;
/**************************************************************************************************
Macros
**************************************************************************************************/
/*! WSF message event starting value */
#define BLE_MSG_START 0xA0
/*! WSF message event enumeration */
enum
{
BLE_BATT_TIMER_IND = BLE_MSG_START, /*! Battery measurement timer expired */
};
/************************************************************************************************** /**************************************************************************************************
Data Types Data Types
**************************************************************************************************/ **************************************************************************************************/
...@@ -126,14 +113,6 @@ static const appUpdateCfg_t bleUpdateCfg = ...@@ -126,14 +113,6 @@ static const appUpdateCfg_t bleUpdateCfg =
5 /*! Number of update attempts before giving up */ 5 /*! Number of update attempts before giving up */
}; };
/*! battery measurement configuration */
static const basCfg_t bleBasCfg =
{
30, /*! Battery measurement timer expiration period in seconds */
1, /*! Perform battery measurement after this many timer periods */
100 /*! Send battery level notification to peer when below this level. */
};
/*! SMP security parameter configuration */ /*! SMP security parameter configuration */
static const smpCfg_t bleSmpCfg = static const smpCfg_t bleSmpCfg =
{ {
...@@ -473,16 +452,6 @@ static void bleProcCccState(bleMsg_t *pMsg) ...@@ -473,16 +452,6 @@ static void bleProcCccState(bleMsg_t *pMsg)
/* handle battery level CCC */ /* handle battery level CCC */
switch(pMsg->ccc.idx) { switch(pMsg->ccc.idx) {
case BLE_BATT_LVL_CCC_IDX:
if (pMsg->ccc.value == ATT_CLIENT_CFG_NOTIFY)
{
BasMeasBattStart((dmConnId_t) pMsg->ccc.hdr.param, BLE_BATT_TIMER_IND, BLE_BATT_LVL_CCC_IDX);
}
else
{
BasMeasBattStop((dmConnId_t) pMsg->ccc.hdr.param);
}
break;
case BLE_ESS_TEMP_CCC_IDX: case BLE_ESS_TEMP_CCC_IDX:
case BLE_ESS_HUMI_CCC_IDX: case BLE_ESS_HUMI_CCC_IDX:
case BLE_ESS_PRES_CCC_IDX: case BLE_ESS_PRES_CCC_IDX:
...@@ -504,7 +473,6 @@ static void bleProcCccState(bleMsg_t *pMsg) ...@@ -504,7 +473,6 @@ static void bleProcCccState(bleMsg_t *pMsg)
static void bleClose(bleMsg_t *pMsg) static void bleClose(bleMsg_t *pMsg)
{ {
/* stop battery measurement */ /* stop battery measurement */
BasMeasBattStop((dmConnId_t) pMsg->hdr.param);
bleESS_ccc_update(); bleESS_ccc_update();
GapClearDeviceName(); GapClearDeviceName();
} }
...@@ -764,17 +732,12 @@ static void bleProcMsg(bleMsg_t *pMsg) ...@@ -764,17 +732,12 @@ static void bleProcMsg(bleMsg_t *pMsg)
switch(pMsg->hdr.event) switch(pMsg->hdr.event)
{ {
case BLE_BATT_TIMER_IND:
BasProcMsg(&pMsg->hdr);
break;
case ATTC_READ_RSP: case ATTC_READ_RSP:
case ATTC_HANDLE_VALUE_IND: case ATTC_HANDLE_VALUE_IND:
bleValueUpdate((attEvt_t *) pMsg); bleValueUpdate((attEvt_t *) pMsg);
break; break;
case ATTS_HANDLE_VALUE_CNF: case ATTS_HANDLE_VALUE_CNF:
BasProcMsg(&pMsg->hdr);
HidProcMsg(&pMsg->hdr); HidProcMsg(&pMsg->hdr);
break; break;
...@@ -808,7 +771,6 @@ static void bleProcMsg(bleMsg_t *pMsg) ...@@ -808,7 +771,6 @@ static void bleProcMsg(bleMsg_t *pMsg)
connOpen->peerAddr[5], connOpen->peerAddr[4], connOpen->peerAddr[5], connOpen->peerAddr[4],
connOpen->peerAddr[3], connOpen->peerAddr[2], connOpen->peerAddr[3], connOpen->peerAddr[2],
connOpen->peerAddr[1], connOpen->peerAddr[0]); connOpen->peerAddr[1], connOpen->peerAddr[0]);
BasProcMsg(&pMsg->hdr);
bleESS_ccc_update(); bleESS_ccc_update();
HidProcMsg(&pMsg->hdr); HidProcMsg(&pMsg->hdr);
break; break;
...@@ -951,9 +913,6 @@ static void BleHandlerInit(void) ...@@ -951,9 +913,6 @@ static void BleHandlerInit(void)
/* Set stack configuration pointers */ /* Set stack configuration pointers */
pSmpCfg = (smpCfg_t *) &bleSmpCfg; pSmpCfg = (smpCfg_t *) &bleSmpCfg;
pAttCfg = (attCfg_t *) &bleAttCfg; pAttCfg = (attCfg_t *) &bleAttCfg;
/* initialize battery service server */
BasInit(bleHandlerId, (basCfg_t *) &bleBasCfg);
} }
/*************************************************************************************************/ /*************************************************************************************************/
...@@ -1029,8 +988,6 @@ void BleStart(void) ...@@ -1029,8 +988,6 @@ void BleStart(void)
/* Initialize attribute server database */ /* Initialize attribute server database */
SvcCoreAddGroup(); SvcCoreAddGroup();
SvcDisAddGroup(); // Device Information Service SvcDisAddGroup(); // Device Information Service
SvcBattCbackRegister(BasReadCback, NULL);
SvcBattAddGroup();
if(config_get_boolean_with_default("ble_hid_enable", false)) { if(config_get_boolean_with_default("ble_hid_enable", false)) {
hid_init(); hid_init();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment