Skip to content

Commit 2232fd0

Browse files
paul-szczepanek-arm0xc0170
authored andcommitted
handle all types
1 parent d1593fe commit 2232fd0

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,26 @@ extern "C" void chciDrvInit(void)
5757
// Callback from Cordio stack
5858
extern "C" uint16_t FakeChciTrWrite(uint8_t prot, uint8_t type, uint16_t len, uint8_t *pData)
5959
{
60-
uint8_t ctype = (type == CHCI_TR_TYPE_EVT) ? HCI_EVT_TYPE : HCI_ACL_TYPE;
60+
uint8_t ctype;
61+
switch (type) {
62+
case CHCI_TR_TYPE_EVT:
63+
ctype = HCI_EVT_TYPE;
64+
break;
65+
case CHCI_TR_TYPE_DATA:
66+
ctype = HCI_ACL_TYPE;
67+
break;
68+
case CHCI_TR_TYPE_ISO:
69+
ctype = HCI_ISO_TYPE;
70+
break;
71+
default:
72+
/* should never happen */
73+
WSF_ASSERT(false);
74+
return 0;
75+
break;
76+
}
77+
6178
CordioHCITransportDriver::on_data_received(&ctype, 1);
6279
CordioHCITransportDriver::on_data_received(pData, len);
80+
6381
return len;
6482
}

0 commit comments

Comments
 (0)