Reply
Highlighted
Posts: 41
Registered: ‎04-22-2016
Accepted Solution

BGM121 NCP mode set advertisement data

Hi there!

 

I'm using the BGM121 in NCP mode (flashed with the ncp-empty-target example firmware).

 

From the host MCU, using BGLIB, I'm able to Start and Stop advertising, set-up advertisement parameters, etc., but I can't configure the Advertisment and Scan Response packets data.

 

Follows the commands I'm using:

 

case gecko_evt_system_boot_id:
{
    printf("System booted. Starting advertising. \n");

    uint8_t const adv_data[] = {0x02, 0x01, 0x06, 0x07, 0x09, 'H', 'E', 'L', 'L', 'O', '!'};
    gecko_cmd_le_gap_set_mode(le_gap_non_discoverable, le_gap_non_connectable);
    gecko_cmd_le_gap_set_adv_data(0, sizeof(adv_data), adv_data);

    gecko_cmd_le_gap_set_adv_parameters(160, 160, 7);

    gecko_cmd_le_gap_set_mode(le_gap_general_discoverable, le_gap_undirected_connectable);

...

 

The BGM121 replies with Success to all the messages, but the advertisement data is never updated.

 

Appreciate any support with this issue.

 

cheers,
nelson

Posts: 2,670
Registered: ‎09-01-2015

Re: BGM121 NCP mode set advertisement data

If you want to use custom data then the first parameter passed to gap_set_mode needs to be set to:

4 = le_gap_user_data

 

See BGAPI ref.manual, 2.8.3.4 enum_le_gap_discoverable_mode

 

Posts: 41
Registered: ‎04-22-2016

Re: BGM121 NCP mode set advertisement data

dammit copy past! Didn't notice that I was using the wrong type there.

 

regarding the following line from BGAPI, 2.8.1.4:
If advertisement mode is currently active, then new advertisement data will be used immediately.

 

This doesn't seem to be correct, I need to disable advertisement prior to set a new advertisement packet, correct?

 

thanks,
nelson