I loaded the CE215122_BLE_HID_Mouse code example for the PSOC 63 device family. I changed the Device to CYBLE-416045-02 (to match CY8CPROTO-063) and mapped the green (advertising) and red (disconnect) LED's according to the board (7.1 and 6.3). See attached project archive for reference.
All is working fine and using TeraTerm for debugging the example is working just fine, except the device keeps advertising after connection. Below image shows debugging and the ADVERTISEMENT_START_STOP event firing with ADV_INITIATED (1) and ADVERTISING (2) states, even after pairing and HID device fully operational.
Also, the green LED keeps blinking no matter what since Cy_BLE_GetAdvertisementState() returns ADVERTISING state and the LED toggling is executed.
if(Cy_BLE_GetAdvertisementState() == CY_BLE_ADV_STATE_ADVERTISING)
/* Blink advertising indication LED. */
Can anyone advise on why this is happening and why advertising doesn't stop after the connection is established?
For those who are having the same behavior, it is because the maximum number of BLE connections is more than 1 in the BLE configuration.
After the peripheral connects to the first host, it keeps advertising for 2-4-etc maximum connections.