diff --git a/epicardium/ble/ble_main.c b/epicardium/ble/ble_main.c index 6e7e11227106deae08879e72a897537d50ce1487..05e1da53cbef9cd782f6821eab686b429ab418df 100644 --- a/epicardium/ble/ble_main.c +++ b/epicardium/ble/ble_main.c @@ -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();