The service number displayed on Lightblue(one cellphone app)

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
feitian0409
Offline
Last seen:4 months 3 weeks ago
Joined:2019-08-26 15:18
The service number displayed on Lightblue(one cellphone app)

Hi,

I'm learning the ble example, named ble_app_peripheral. When running the hex image, from the cellphone app, such as Lightblue, it displays there are 2 services. When i enable bass service, still showing 2 services ,but actually there are 3 services.

How to correct it?

Best regards

Fei

Device:
PM_Dialog
Offline
Last seen:8 hours 6 sec ago
Staff
Joined:2018-02-08 11:03
Hi feitian0409,

Hi feitian0409,

If I am not mistaken, you are trying to include the BASS profile in the ble_app_peripheral SDK5.0.4 example, aren’t you? The prox_reporter example of the SDK includes the Battery Service. Please check this example

  1. Add the bass.c and bass_task.h files in sdk_profiles folder. Both of them are located under sdk\ble_stack\profiles\bas\bass\src SDK folder path
  2. Add the appropriate header files which are under sdk\ble_stack\profiles\bas\bass path.
  3. #define EXCLUDE_DLG_BASS (0) in user_modules_config.h
  4. Add in user_callback_config.h the user_app_bass_cb as is in prox_reporter project.

Thanks, PM_Dialog

feitian0409
Offline
Last seen:4 months 3 weeks ago
Joined:2019-08-26 15:18
Hi,

Hi,

有一个错误,也许我don't express clearly.

I have enable the BASS profile successfully, and i can use the cellphone app "LightBlue" to see some informations.

But before and after that, the cellphone app still show two services, although there are actually three.

Please browse the attachment .

Best Regards,

Fei

Attachment:
PM_Dialog
Offline
Last seen:8 hours 6 sec ago
Staff
Joined:2018-02-08 11:03
Hi feitian0409,

Hi feitian0409,

My apologies but now I understood which your issue is. Alright, you should include the BASS into the advertising data. The default advertising data in the ble_app_peripherals example are the following:

#define USER_ADVERTISE_DATA ("\x03"\ ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS\ ADV_UUID_DEVICE_INFORMATION_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")

You should add the Battery service and modify them as follow:

#define USER_ADVERTISE_DATA ("\x05"\ ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS\ ADV_UUID_DEVICE_INFORMATION_SERVICE\ ADV_UUID_BATTERY_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")

Please let me know if this is working fine.

Thanks, PM_Dialog

feitian0409
Offline
Last seen:4 months 3 weeks ago
Joined:2019-08-26 15:18
Hi,

Hi,

Now it is working fine. Thanks a lot.

Best Regards,

Fei

PM_Dialog
Offline
Last seen:8 hours 6 sec ago
Staff
Joined:2018-02-08 11:03
Hi feitian0409,

Hi feitian0409,

Glad that is working and thanks for accepting my answer. If you have any other follow up question, please feel free to create a new forum thread.

Thanks, PM_Dialog