cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG advertise while having a connection

allard
Senior

I'm trying to create a peripheral device that allows one Bluetooth central to connect to it, this part is working. Now I want the device to re-start advertisements when a central has made a connection. The advertisements should be non-connectable one's in this case, so I'm not trying to create a device that allows multiple concurrent connections.

I was assuming this would be as simple as just restarting the advertisements with:

  ret = aci_gap_set_discoverable(ADV_NONCONN_IND, 160, 160, PUBLIC_ADDR,NO_WHITE_LIST_USE,  0, NULL, 0, NULL, 0, 0); 

after the connection has been made, so after a call to hci_le_connection_complete_event, but the function returns 0x0C -> BLE_ERROR_COMMAND_DISALLOWED. What am I doing wrong? Why is the command not allowed?

2 REPLIES 2
allard
Senior

Anyone here?

AndyR1
Senior

Hello,

I don't know if it's possible, but if yes look for aci_gap_init(), with the gap roles

/**
 * @anchor gap_roles
 * @name GAP Roles
 * @{
*/
#define GAP_PERIPHERAL_ROLE                     (0x01)
#define GAP_BROADCASTER_ROLE                    (0x02)
#define GAP_CENTRAL_ROLE                        (0x04)
#define GAP_OBSERVER_ROLE                       (0x08)