Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(BLE): Backwards compatibility for HCI Vendor-Specific opcodes #1198

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,33 +233,6 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf)
evtParamLen += sizeof(BbBlePduFiltStats_t);
break;

case LHCI_OPCODE_VS_REG_WRITE: {
uint8_t len;
uint32_t addr;
uint32_t *addrP;

BSTREAM_TO_UINT8(len, pBuf);
BSTREAM_TO_UINT32(addr, pBuf);
addrP = (uint32_t *)addr;

LL_TRACE_INFO2("### LlVsRegWrite ### 0x%08X %d bytes", addr, len);

memcpy(addrP, pBuf, len);
break;
}

case LHCI_OPCODE_VS_REG_READ: {
uint8_t len;

BSTREAM_TO_UINT8(len, pBuf);
BSTREAM_TO_UINT32(regReadAddr, pBuf);

LL_TRACE_INFO2("### LlVsRegRead ### 0x%08X %d bytes", regReadAddr, len);

evtParamLen += len;
break;
}

case LHCI_OPCODE_VS_TX_TEST: {
uint16_t numPackets = pBuf[4] | (pBuf[5] << 8);

Expand Down Expand Up @@ -374,7 +347,6 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf)
case LHCI_OPCODE_VS_GET_RAND_ADDR:
case LHCI_OPCODE_VS_SET_TX_TEST_ERR_PATT:
case LHCI_OPCODE_VS_SET_SNIFFER_ENABLE:
case LHCI_OPCODE_VS_REG_WRITE:
case LHCI_OPCODE_VS_RX_TEST:
case LHCI_OPCODE_VS_TX_TEST:
case LHCI_OPCODE_VS_RESET_ADV_STATS:
Expand Down Expand Up @@ -514,14 +486,6 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf)
break;
}

case LHCI_OPCODE_VS_REG_READ: {
if (regReadAddr != 0) {
uint32_t *regReadP = (uint32_t *)regReadAddr;
memcpy(pBuf, regReadP, (evtParamLen - 1));
}
break;
}

/* --- default --- */

default:
Expand Down
20 changes: 9 additions & 11 deletions Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,31 +360,29 @@ extern "C" {
#define LHCI_OPCODE_VS_SET_CONN_PHY_TX_PWR \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DD) /*!< Set Connection Phy Tx Power opcode. */

#define LHCI_OPCODE_VS_REG_WRITE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x300) /*!< Write data to MCU register or memory space. */
#define LHCI_OPCODE_VS_REG_READ HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x301) /*!< Read data from MCU register or memory space. */
#define LHCI_OPCODE_VS_RESET_CONN_STATS \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x302) /*!< Reset connection stats. */
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x300) /*!< Reset connection stats. */
kevin-gillespie marked this conversation as resolved.
Show resolved Hide resolved
#define LHCI_OPCODE_VS_TX_TEST \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x303) /*!< Vendor specific TX test that takes numPkt param. */
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x301) /*!< Vendor specific TX test that takes numPkt param. */
#define LHCI_OPCODE_VS_RESET_TEST_STATS \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, \
0x304) /*!<Vendor specific End Test Returning More than RX Packets*/
0x302) /*!<Vendor specific End Test Returning More than RX Packets*/
#define LHCI_OPCODE_VS_RX_TEST \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, \
0x305) /*!<Vendor specific RX Test*/
0x303) /*!<Vendor specific RX Test*/
#define LHCI_OPCODE_VS_GET_RSSI \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, \
0x306) /*!<Vendor specific Get RSSI*/
0x304) /*!<Vendor specific Get RSSI*/
#define LHCI_OPCODE_VS_RESET_ADV_STATS \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, \
0x307) /*!<Vendor specific reset adv stats*/
0x305) /*!<Vendor specific Reset Advertising Stats */
#define LHCI_OPCODE_VS_RESET_SCAN_STATS \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, \
0x308) /*!<Vendor specific reset scan stats*/
0x306) /*!<Vendor specific Reset Scan Stats */
#define LHCI_OPCODE_VS_FGEN \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, \
0x309) /*!<Vendor specific frequency generator*/
0x307) /*!<Vendor specific Function Generation */

/* Vendor specific event masks. */
#define LHCI_VS_EVT_MASK_SCAN_REPORT_EVT 0x01 /*!< (Byte 0) VS event bit, scan report. */
#define LHCI_VS_EVT_MASK_DIAG_TRACE_EVT 0x02 /*!< (Byte 0) VS event bit, diagnostic tracing. */
Expand Down
Loading