Hello,
I have a problem with getting the chip to send advertisements as I need them.
What I need to do is adding two incomplete list of service IDs into a single advertisement, as my customer demands it.
#define USER_ADVERTISE_DATA "\x03"\
ADV_TYPE_INCOMPLETE_LIST_16BIT_SERVICE_IDS\
"\x70\x31" \
"\x03"\
ADV_TYPE_INCOMPLETE_LIST_16BIT_SERVICE_IDS\
"\x70\x30"
Setting this leads to the debugger stopping directly without any advertisement sent, it ends in nmi_handler.c. If I remove one of the incomplete lists, the advertisements are sent.
Works:
#define USER_ADVERTISE_DATA "\x03"\
ADV_TYPE_INCOMPLETE_LIST_16BIT_SERVICE_IDS\
"\x70\x31"
Works also:
#define USER_ADVERTISE_DATA "\x03"\
ADV_TYPE_INCOMPLETE_LIST_16BIT_SERVICE_IDS\
"\x70\x30"
Works also:
#define USER_ADVERTISE_DATA "\x03"\
ADV_TYPE_INCOMPLETE_LIST_16BIT_SERVICE_IDS\
"\x70\x31" \
"\x03"\
ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS\
"\x70\x30"
I also tried this with DA14585 on SDK 6.0.10.511... has the same result.
I hope someone can give me a hint, why the chip refuses to send the advertisement with both incomplete IDs. This can be replicated by using the barebone example of the sdk and setting this as the advertisement data in user_config.h.
Best regards,
Tim
Hi TiKoEsope,
You are not allowed to have twice the same tag, in your case the ADV_TYPE_INCOMPLETE_LIST_16BIT_SERVICE_IDS, in the user advertising data. The stack will return you an error and you will get an NMI. If you would like to have two different incomplete service, you should define the ser advertising data as following:
#定义USER_ADVERTISE_DATA \ ADV_TY“\ x05”PE_INCOMPLETE_LIST_16BIT_SERVICE_IDS\
"\x70\x31\x70\x30"
Length: 0x05 (5 bytes in the adv data: 0x02 0x70 0x31 0x70 0x30)
Tag: ADV_TYPE_INCOMPLETE_LIST_16BIT_SERVICE_IDS (= 0x02)
1st incomplete service: 0x70 0x31
2st incomplete service: 0x70 0x30
Thanks, PM_Dialog