Hi,
I try to add bass service to the ble_app_ota, proceed as follows.
- DA14580
- SDK Version:5.0.4
- Based on the demo project: ble_app_ota
- Add BASS service:
- Add the bass.c and bass_task.c files in sdk_profiles folder
- Add the “#include "bass.h" s in the user_profiles_config.h
- #define EXCLUDE_DLG_BASS (0) in user_modules_config.h
- Add the definition of APP_BASS_POLL_INTERVAL / USE_BAT_LEVEL_ALERT / GPIO_BAT_LED_PORT /GPIO_BAT_LED_PIN
- Add ADV_UUID_BATTERY_SERVICE to the USER_ADVERTISE_DATA , as below
There is something wrong when runtime, you can get the detail from the attachement.
Best Regards,
Fei
Device:


Hi feitian0409,
You are following the correct steps in order to add the Battery service in your application. I have read the attached pdf and I found an issue in the advertising data definition. The USER_ADVERTISE_DATA should be like follow. Just change the 0x05 to 0x07. The advertising data should have a specific format.
0x07 indicates the length and means 5bytes length in the adv data:
ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS : x03 (1byte)
ADV_UUID_BATTERY_SERVICE : x0F x18 (2bytes)
ADV_UUID_DEVICE_INFORMATION_SERVICE : x0A x18 (2bytes)
ADV_UUID_SPOTAR_SERVICE: xF5 xFE (2bytes)
(1+2+2+2)bytes = 0x07 bytes
The same is for the ADV_TYPE_COMPLETE_LIST_128BIT_SERVICE_IDS.
Thanks, PM_Dialog
Hi,PM_Dialog
It works well now, Thanks for your suggestions.
Best Regards,
Fei