This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi all,
i want to advertise in the periodic task of simplebleperipheral.c the battery value. I used the Batt_GetParameter function and i visualize the '64' value at every packet advertised, as if the battery does not discharge.
if ( events & SBP_PERIODIC_EVT ) { // Restart timer if ( SBP_PERIODIC_EVT_PERIOD ) { osal_start_timerEx( simpleBLEPeripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD ); } uint8 newBattLevel; Batt_GetParameter( BATT_PARAM_LEVEL, &newBattLevel ); advertData [5] = newBattLevel; GAPRole_SetParameter( GAPROLE_ADVERT_DATA, sizeof( advertData ), advertData ); // Perform periodic application task performPeriodicTask(); return (events ^ SBP_PERIODIC_EVT); }
Actually i'd like to visualize the adc value of the battery, to see the littles variation during the calculation, so i've replaced that Batt_GetParameter function with the static uint8 battMeasure( void ) function, but the compiler gives me the warning
Warning[Pe223]: function "battMeasure" declared implicitly C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\SimpleBLEPeripheral_1\Source\simpleBLEPeripheral.c 902
and when i try to build the project i have this error
Error[e46]: Undefined external "battMeasure::?relay" referred in simpleBLEPeripheral ( C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\SimpleBLEPeripheral_1\CC2541DB\CC2541DK-MINI Keyfob\Obj\simpleBLEPeripheral.r51 )
Any help?
Hi Yikai.
There's a screenshot of workspace and code. I added in battservice.h the declaration extern uint8 battMeasure( void ); the function is defined in battservice.c. Doing so the warning disappear, but the linking error remains.
Error[e27]: Entry "Batt_AddService::?relay" in module battservice ( E:\BLE-CC254x-1.4.2.2\Projects\ble\SimpleBLEPeripheral_1\CC2541DB\CC2541DK-MINI Keyfob\Obj\battservice.r51 ) redefined in module simpleBLEPeripheral ( E:\
BLE-CC254x-1.4.2.2\Projects\ble\SimpleBLEPeripheral_1\CC2541DB\CC2541DK-MINI Keyfob\Obj\simpleBLEPeripheral.r51 )
Error while running Linker