I'm adding the central multilink feature to my actual project. The central device is a custom dongle (nRF52840) that should connect to many peripheral devices (nRF52840). To implement the multilink I followed the example. Now I'm wondering if the central device, after estabilished all the connections with the peripherals, can send broadcast messages only in specific moments. For example to send a message I use the following function (I got inspiration from NUS uart client)
system_error_t Gravity_Client_Send_Data( sensor_client_t *client, const uint8_t *data, uint16_t len ) { if ( !client->conn ) { return SYSTEM_ERROR; } if ( atomic_test_and_set_bit( &client->state, GRAVITY_CLIENT_TX_DATA_PENDING ) ) { return SYSTEM_ERROR; } if ( bt_gatt_write_without_response_cb( client->conn, client->handles.messageTx, data, len, false, Message_Tx_On_Sent, ( void * )( client ) ) != 0 ) { atomic_clear_bit( &client->state, GRAVITY_CLIENT_TX_DATA_PENDING ); return SYSTEM_ERROR; } return SYSTEM_NO_ERROR; }
The bt_gatt_write_without_response_cb() is called to send the message but I need to specify the connection that is related to only one peripheral (am I right?). Sometimes I need to send a message to all the perpheral devices in the same time but I didn't found a broadcast function. Is there a solution?