AnsweredAssumed Answered

BlueNRG-MS v7.2c Mode3or4: scanning while connected as a master or slave?

Question asked by Scott Lohr on Jul 14, 2018
Latest reply on Jul 16, 2018 by Scott Lohr

Why when running BlueNRG-MS v7.2c Mode4, while connected as a BLE slave or a master of some other slave, attempt to scan fails with error code 0x0C:

#define ERR_COMMAND_DISALLOWED                        (0x0C)

Note that before the connection as a slave, BlueNRG-MS can advertise and/or scan (either one or both simultaneously) on and off, but during and after, it can only advertise on and off.

Parameters being used are theses:

aci_gap_set_discoverable(ADV_IND, 1208, 1208, PUBLIC_ADDR, NO_WHITE_LIST_USE, 0, NULL, 0, NULL, 0, 0)))

aci_gap_start_general_discovery_proc(304, 19, PUBLIC_ADDR, true)))

After connecting as a slave to LightBlue, request and get parameter update:

aci_l2cap_connection_parameter_update_request(bleConnHdl, 72, 84, 4, 210)
(Note that above step can be left out and result is the same)


While connected as a slave (with no connections as a master) and above parameters, calling

aci_hal_get_anchor_period(uint32_t *anchor_period, uint32_t *max_free_slot) shows anchor=304, free=254


So requesting to scan for 304 should be a perfect anchor period and accepted, but just to try, aci_gap_start_general_discovery_proc() is invoked with every value between 1..304, and all return 0x0C, even after the connection as a slave is ended.


What can be done to fix this short of invoking BlueNRG_RST() and having to re-initialize everything?


Note that when connected as a master, connection interval is 190-msec, and aci_hal_get_anchor_period(uint32_t *anchor_period, uint32_t *max_free_slot) again shows anchor=304, so again, should be a perfect multiple of one (1).

Connection is made with these parameters:

aci_gap_create_connection(304, 38, ps->bdaddr_type, (void *)ps->bdaddr, PUBLIC_ADDR, 152, 152, 0, 76, 38, 38);