How to change advertising data in empty template

7 posts / 0 new
Last post
DrNick1
Offline
Last seen:4 years 4 months ago
加入:2014-07-01 11:55
How to change advertising data in empty template

I'm experimenting with changing the data in the advertising message in the empty peripheral template.

I'm starting with the default configuration which seems to compile and work ok. So I've made no other changes to the program

I'm editing user_profiles_config.h

In line 107 I can change the USER_DEVICE_NAME to a different string and this works fine.

In line 103 I cannot change the USER_ADVERTISE_DATA from anything other than a null string. If I change this to any string, the program will recompile ok but there is no output.

I'm guessing the message is constructed in app.c but the required routines don't seem to be called so I'm wondering if I've got to do something else to enable this behaviour.

I hope someone can help. I'm finding this architecture very confusing!

Device:
MT_dialog
Offline
Last seen:5 days 14 hours ago
Staff
加入:2015-06-08 11:34
Hi DrNick1,

Hi DrNick1,

Check the user_config.h file the USER_ADVERTISE_DATA definition. In the file user_profiles_config.h changes only the information for the DISS profile.

Thanks MT_dialog

DrNick1
Offline
Last seen:4 years 4 months ago
加入:2014-07-01 11:55
Sorry, I meant to say I was

Sorry, I meant to say I was editing the USER_ADVERTISE_DATA definition in the user_config.h file. (Too many similar names for files!)
If I edit line 103 in the user_config.h file to anything other than "" the program compiles but sends no messages.
#定义USER_ADVERTISE_DATA”“这个作品
#define USER_ADVERTISE_DATA "ABCD" - this doesn't work. Program compiles ok and runs, but no messages are ever received on the packet sniffer

Hope that's clearer

MT_dialog
Offline
Last seen:5 days 14 hours ago
Staff
加入:2015-06-08 11:34
Hi DrNick1,

Hi DrNick1,

Try to change the USER_DEVICE_NAME, the definitions you are trying to change are the service flags for the profiles the BLE device has. You have to be carefull what kind of messages you are placing in those definitions otherwise the stack rejects them if the data are not compling to the specification. For example in the ble_app_barebone application the USER_ADVERTISE_DATA are:

x03 - the length of the following message

x03 - ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS - "\x03" /**< Complete list of 16-bit Service IDs */

\x0A\x18 - ADV_UUID_DEVICE_INFORMATION_SERVICE - "\x0A\x18" /**< Device Information Service */

Thanks MT_dialog

DrNick1
Offline
Last seen:4 years 4 months ago
加入:2014-07-01 11:55
ok, so if I want to change

ok, so if I want to change the bare bones project to be ADV_NONCONN_IND rather than the basic connectable system that it is by default, and I want to advertise manufacturer specific data, how would I go about doing this.
Where in the program do I define which advertising mode is used?

MT_dialog
Offline
Last seen:5 days 14 hours ago
Staff
加入:2015-06-08 11:34
Hi DrNick1,

Hi DrNick1,

Please check the app_easy_gap_non_connectable_advertise_start_create_msg() function and you can fill in the proper parameters from user_config.h file at the user_non_connectable_advertise_conf struct.

Thanks MT_dialog

DrNick1
Offline
Last seen:4 years 4 months ago
加入:2014-07-01 11:55
ok thanks

ok thanks

Topic locked