X-Git-Url: https://git.karo-electronics.de/?p=oswald.git;a=blobdiff_plain;f=metawatch%2Fbt_hci.c;fp=metawatch%2Fbt_hci.c;h=56e490ece0b20bfdb3c75ef1eaccbde00ca7f9b5;hp=7bf74449eb8f9d8fe1f85d846241abf2f9e71ac1;hb=f9c26e3f61a2d9bc1070cef0f6f08bd6f6240849;hpb=c41999e66b909587442a23288cc974931f29fe26 diff --git a/metawatch/bt_hci.c b/metawatch/bt_hci.c index 7bf7444..56e490e 100644 --- a/metawatch/bt_hci.c +++ b/metawatch/bt_hci.c @@ -422,6 +422,10 @@ void bt_hci_cmd(const uint8_t OGF, const uint8_t OCF, const uint8_t data_len, co { bt_hci_cmd_t packet; + // refuse any HCI if interface is not enabled + if (mw_bt_is_enabled() == 0) + return; + if (state == EHCILL_SLEEPING) { uint8_t ehcill_p = EHCILL_WAKE_UP_IND; @@ -472,6 +476,10 @@ void bt_acl_send(const uint16_t handle, const uint8_t PB, const uint8_t BC, cons { bt_hci_acl_t packet; + // refuse any HCI if interface is not enabled + if (mw_bt_is_enabled() == 0) + return; + packet.type = HCI_ACL_DATA_PACKET; packet.handle = handle | ((PB & 0x03) << 12) | ((BC & 0x03) << 14); packet.total_length = dlen + 4;