File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -2173,6 +2173,10 @@ int bt_le_set_auto_conn(const bt_addr_le_t *addr,
21732173{
21742174 struct bt_conn * conn ;
21752175
2176+ if (!atomic_test_bit (bt_dev .flags , BT_DEV_READY )) {
2177+ return - EAGAIN ;
2178+ }
2179+
21762180 if (param && !bt_le_conn_params_valid (param )) {
21772181 return - EINVAL ;
21782182 }
Original file line number Diff line number Diff line change @@ -1767,6 +1767,10 @@ int bt_gatt_notify_cb(struct bt_conn *conn,
17671767 __ASSERT (params , "invalid parameters\n" );
17681768 __ASSERT (params -> attr , "invalid parameters\n" );
17691769
1770+ if (!atomic_test_bit (bt_dev .flags , BT_DEV_READY )) {
1771+ return - EAGAIN ;
1772+ }
1773+
17701774 attr = params -> attr ;
17711775
17721776 if (conn && conn -> state != BT_CONN_CONNECTED ) {
@@ -1829,6 +1833,10 @@ int bt_gatt_indicate(struct bt_conn *conn,
18291833 __ASSERT (params , "invalid parameters\n" );
18301834 __ASSERT (params -> attr , "invalid parameters\n" );
18311835
1836+ if (!atomic_test_bit (bt_dev .flags , BT_DEV_READY )) {
1837+ return - EAGAIN ;
1838+ }
1839+
18321840 attr = params -> attr ;
18331841
18341842 if (conn && conn -> state != BT_CONN_CONNECTED ) {
Original file line number Diff line number Diff line change @@ -6425,6 +6425,10 @@ int bt_le_oob_get_local(u8_t id, struct bt_le_oob *oob)
64256425{
64266426 int err ;
64276427
6428+ if (!atomic_test_bit (bt_dev .flags , BT_DEV_READY )) {
6429+ return - EAGAIN ;
6430+ }
6431+
64286432 if (id >= CONFIG_BT_ID_MAX ) {
64296433 return - EINVAL ;
64306434 }
@@ -6459,13 +6463,21 @@ int bt_le_oob_set_sc_data(struct bt_conn *conn,
64596463 const struct bt_le_oob_sc_data * oobd_local ,
64606464 const struct bt_le_oob_sc_data * oobd_remote )
64616465{
6466+ if (!atomic_test_bit (bt_dev .flags , BT_DEV_READY )) {
6467+ return - EAGAIN ;
6468+ }
6469+
64626470 return bt_smp_le_oob_set_sc_data (conn , oobd_local , oobd_remote );
64636471}
64646472
64656473int bt_le_oob_get_sc_data (struct bt_conn * conn ,
64666474 const struct bt_le_oob_sc_data * * oobd_local ,
64676475 const struct bt_le_oob_sc_data * * oobd_remote )
64686476{
6477+ if (!atomic_test_bit (bt_dev .flags , BT_DEV_READY )) {
6478+ return - EAGAIN ;
6479+ }
6480+
64696481 return bt_smp_le_oob_get_sc_data (conn , oobd_local , oobd_remote );
64706482}
64716483#endif
You can’t perform that action at this time.
0 commit comments