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
Branches
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];
static int scan_reports_head;
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
**************************************************************************************************/
......@@ -126,14 +113,6 @@ static const appUpdateCfg_t bleUpdateCfg =
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 */
static const smpCfg_t bleSmpCfg =
{
......@@ -473,16 +452,6 @@ static void bleProcCccState(bleMsg_t *pMsg)
/* handle battery level CCC */
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_HUMI_CCC_IDX:
case BLE_ESS_PRES_CCC_IDX:
......@@ -504,7 +473,6 @@ static void bleProcCccState(bleMsg_t *pMsg)
static void bleClose(bleMsg_t *pMsg)
{
/* stop battery measurement */
BasMeasBattStop((dmConnId_t) pMsg->hdr.param);
bleESS_ccc_update();
GapClearDeviceName();
}
......@@ -764,17 +732,12 @@ static void bleProcMsg(bleMsg_t *pMsg)
switch(pMsg->hdr.event)
{
case BLE_BATT_TIMER_IND:
BasProcMsg(&pMsg->hdr);
break;
case ATTC_READ_RSP:
case ATTC_HANDLE_VALUE_IND:
bleValueUpdate((attEvt_t *) pMsg);
break;
case ATTS_HANDLE_VALUE_CNF:
BasProcMsg(&pMsg->hdr);
HidProcMsg(&pMsg->hdr);
break;
......@@ -808,7 +771,6 @@ static void bleProcMsg(bleMsg_t *pMsg)
connOpen->peerAddr[5], connOpen->peerAddr[4],
connOpen->peerAddr[3], connOpen->peerAddr[2],
connOpen->peerAddr[1], connOpen->peerAddr[0]);
BasProcMsg(&pMsg->hdr);
bleESS_ccc_update();
HidProcMsg(&pMsg->hdr);
break;
......@@ -951,9 +913,6 @@ static void BleHandlerInit(void)
/* Set stack configuration pointers */
pSmpCfg = (smpCfg_t *) &bleSmpCfg;
pAttCfg = (attCfg_t *) &bleAttCfg;
/* initialize battery service server */
BasInit(bleHandlerId, (basCfg_t *) &bleBasCfg);
}
/*************************************************************************************************/
......@@ -1029,8 +988,6 @@ void BleStart(void)
/* Initialize attribute server database */
SvcCoreAddGroup();
SvcDisAddGroup(); // Device Information Service
SvcBattCbackRegister(BasReadCback, NULL);
SvcBattAddGroup();
if(config_get_boolean_with_default("ble_hid_enable", false)) {
hid_init();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment