增加低音ble_app_ota服务

Learn MoreFAQsTutorials

3 posts / 0 new
Last post
feitian0409
Offline
Last seen:3 months 3 weeks ago
加入:2019-08-26 15:18
增加低音ble_app_ota服务

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:
  1. Add the bass.c and bass_task.c files in sdk_profiles folder
  2. Add the “#include "bass.h" s in the user_profiles_config.h
  3. #define EXCLUDE_DLG_BASS (0) in user_modules_config.h
  4. Add the definition of APP_BASS_POLL_INTERVAL / USE_BAT_LEVEL_ALERT / GPIO_BAT_LED_PORT /GPIO_BAT_LED_PIN
  5. 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

Attachment:
Device:
PM_Dialog
Offline
Last seen:1 hour 3 min ago
Staff
加入:2018-02-08 11:03
Hi feitian0409,

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.

#define USER_ADVERTISE_DATA "\x07"\ ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS\ ADV_UUID_BATTERY_SERVICE\ ADV_UUID_DEVICE_INFORMATION_SERVICE\ ADV_UUID_SPOTAR_SERVICE\ "\x11"\ ADV_TYPE_COMPLETE_LIST_128BIT_SERVICE_IDS\ "\x2F\x2A\x93\xA6\xBD\xD8\x41\x52\xAC\x0B\x10\x99\x2E\xC6\xFE\xED"

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

feitian0409
Offline
Last seen:3 months 3 weeks ago
加入:2019-08-26 15:18
Hi,PM_Dialog

Hi,PM_Dialog

It works well now, Thanks for your suggestions.

Best Regards,

Fei