From 2847447c26e4d77bdf26732ad81a0a6ada5866f3 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:04:29 -0600 Subject: [PATCH] fix(Examples): Updated Wording in FCC Examples (#832) --- Examples/MAX32655/Bluetooth/BLE_fcc/main.c | 20 +++++++++--------- Examples/MAX32665/Bluetooth/BLE_fcc/main.c | 21 ++++++++++--------- Examples/MAX32690/Bluetooth/BLE_fcc/main.c | 14 ++++++------- .../controller/include/ble/bb_ble_api.h | 9 +++++++- .../controller/sources/ble/bb/bb_ble_dtm.c | 9 ++++++++ .../controller/sources/ble/lhci/lhci_cmd.c | 6 ++++++ .../controller/sources/ble/lhci/lhci_cmd_vs.c | 21 ++++++++++++------- .../controller/sources/ble/lhci/lhci_int.h | 6 ++++-- 8 files changed, 69 insertions(+), 37 deletions(-) diff --git a/Examples/MAX32655/Bluetooth/BLE_fcc/main.c b/Examples/MAX32655/Bluetooth/BLE_fcc/main.c index 6149e1fdc4a..fb7e80e9635 100644 --- a/Examples/MAX32655/Bluetooth/BLE_fcc/main.c +++ b/Examples/MAX32655/Bluetooth/BLE_fcc/main.c @@ -151,12 +151,12 @@ void TMR2_IRQHandler(void) void printUsage(void) { APP_TRACE_INFO0("Usage: "); - APP_TRACE_INFO0(" (0) Transmit on RF channel 0 (2402 MHz)"); - APP_TRACE_INFO0(" (1) Transmit on RF channel 19 (2440 MHz)"); - APP_TRACE_INFO0(" (2) Transmit on RF channel 39 (2480 MHz)"); + APP_TRACE_INFO0(" (0) Transmit Continuous Modulated on RF channel 0 (2402 MHz)"); + APP_TRACE_INFO0(" (1) Transmit Continuous Modulated on RF channel 19 (2440 MHz)"); + APP_TRACE_INFO0(" (2) Transmit Continuous Modulated RF channel 39 (2480 MHz)"); APP_TRACE_INFO0(" (3) Receive on RF channel 39 (2480 MHz)"); APP_TRACE_INFO0(" (4) Set Transmit power"); - APP_TRACE_INFO0(" (5) Enable constant TX"); + APP_TRACE_INFO0(" (5) Enable Constant Unmodulated TX"); APP_TRACE_INFO0(" (6) Disable constant TX -- MUST be called after (5)"); /* APP_TRACE_INFO0(" (7) Set PA value"); */ APP_TRACE_INFO0(" (8) Set PHY"); @@ -193,27 +193,27 @@ static void processConsoleRX(uint8_t rxByte) switch (cmd) { case '0': - APP_TRACE_INFO1("Transmit RF channel 0, 255 bytes/pkt, 0xAA, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 0, 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr(phy)); - res = LlEnhancedTxTest(0, 255, LL_TEST_PKT_TYPE_AA, phy, 0); + res = LlEnhancedTxTest(0, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); cmd = 0; break; case '1': - APP_TRACE_INFO1("Transmit RF channel 19, 255 bytes/pkt, 0xAA, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 19, 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr(phy)); - res = LlEnhancedTxTest(19, 255, LL_TEST_PKT_TYPE_AA, phy, 0); + res = LlEnhancedTxTest(19, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); cmd = 0; break; case '2': - APP_TRACE_INFO1("Transmit RF channel 39, 255 bytes/pkt, 0xAA, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 39, 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr(phy)); - res = LlEnhancedTxTest(39, 255, LL_TEST_PKT_TYPE_AA, phy, 0); + res = LlEnhancedTxTest(39, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); cmd = 0; break; diff --git a/Examples/MAX32665/Bluetooth/BLE_fcc/main.c b/Examples/MAX32665/Bluetooth/BLE_fcc/main.c index 1ccc33ea20c..afe83939b72 100644 --- a/Examples/MAX32665/Bluetooth/BLE_fcc/main.c +++ b/Examples/MAX32665/Bluetooth/BLE_fcc/main.c @@ -158,13 +158,14 @@ void TMR2_IRQHandler(void) void printUsage(void) { APP_TRACE_INFO0("Usage: "); - APP_TRACE_INFO0(" (0) Transmit on RF channel 0 (2402 MHz)"); - APP_TRACE_INFO0(" (1) Transmit on RF channel 19 (2440 MHz)"); - APP_TRACE_INFO0(" (2) Transmit on RF channel 39 (2480 MHz)"); + APP_TRACE_INFO0(" (0) Transmit Continuous Modulated on RF channel 0 (2402 MHz)"); + APP_TRACE_INFO0(" (1) Transmit Continuous Modulated on RF channel 19 (2440 MHz)"); + APP_TRACE_INFO0(" (2) Transmit Continuous Modulated RF channel 39 (2480 MHz)"); APP_TRACE_INFO0(" (3) Receive on RF channel 39 (2480 MHz)"); APP_TRACE_INFO0(" (4) Set Transmit power"); - APP_TRACE_INFO0(" (5) Enable constant PRBS9 TX"); + APP_TRACE_INFO0(" (5) Enable Constant Unmodulated TX"); APP_TRACE_INFO0(" (6) Disable constant TX -- MUST be called after (5)"); + /* APP_TRACE_INFO0(" (7) Set PA value"); */ APP_TRACE_INFO0(" (8) Set PHY"); APP_TRACE_INFO0(" (9) TX Frequency Hop"); APP_TRACE_INFO0(" (e) End transmission -- MUST be used after each (0-3, 9)"); @@ -199,27 +200,27 @@ static void processConsoleRX(uint8_t rxByte) switch (cmd) { case '0': - APP_TRACE_INFO1("Transmit RF channel 0 (2402M), 255 bytes/pkt, 0xPRBS9, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 0 (2402M), 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr()); - res = LlEnhancedTxTest(0, 255, LL_TEST_PKT_TYPE_PRBS9, phy, 0); + res = LlEnhancedTxTest(0, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); cmd = 0; break; case '1': - APP_TRACE_INFO1("Transmit RF channel 19 (2440M), 255 bytes/pkt, 0xPRBS9, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 19 (2440M), 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr()); - res = LlEnhancedTxTest(19, 255, LL_TEST_PKT_TYPE_PRBS9, phy, 0); + res = LlEnhancedTxTest(19, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); cmd = 0; break; case '2': - APP_TRACE_INFO1("Transmit RF channel 39 (2480M), 255 bytes/pkt, 0xPRBS9, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 39 (2480M), 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr()); - res = LlEnhancedTxTest(39, 255, LL_TEST_PKT_TYPE_PRBS9, phy, 0); + res = LlEnhancedTxTest(39, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); cmd = 0; break; diff --git a/Examples/MAX32690/Bluetooth/BLE_fcc/main.c b/Examples/MAX32690/Bluetooth/BLE_fcc/main.c index fc0da669963..3efb2f9dd56 100644 --- a/Examples/MAX32690/Bluetooth/BLE_fcc/main.c +++ b/Examples/MAX32690/Bluetooth/BLE_fcc/main.c @@ -151,12 +151,12 @@ void TMR2_IRQHandler(void) void printUsage(void) { APP_TRACE_INFO0("Usage: "); - APP_TRACE_INFO0(" (0) Transmit on RF channel 0 (2402 MHz)"); - APP_TRACE_INFO0(" (1) Transmit on RF channel 19 (2440 MHz)"); - APP_TRACE_INFO0(" (2) Transmit on RF channel 39 (2480 MHz)"); + APP_TRACE_INFO0(" (0) Transmit Continuous Modulated on RF channel 0 (2402 MHz)"); + APP_TRACE_INFO0(" (1) Transmit Continuous Modulated on RF channel 19 (2440 MHz)"); + APP_TRACE_INFO0(" (2) Transmit Continuous Modulated RF channel 39 (2480 MHz)"); APP_TRACE_INFO0(" (3) Receive on RF channel 39 (2480 MHz)"); APP_TRACE_INFO0(" (4) Set Transmit power"); - APP_TRACE_INFO0(" (5) Enable constant TX"); + APP_TRACE_INFO0(" (5) Enable Constant Unmodulated TX"); APP_TRACE_INFO0(" (6) Disable constant TX -- MUST be called after (5)"); /* APP_TRACE_INFO0(" (7) Set PA value"); */ APP_TRACE_INFO0(" (8) Set PHY"); @@ -193,7 +193,7 @@ static void processConsoleRX(uint8_t rxByte) switch (cmd) { case '0': - APP_TRACE_INFO1("Transmit RF channel 0, 255 bytes/pkt, 0xAA, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 0, 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr(phy)); res = LlEnhancedTxTest(0, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); @@ -202,7 +202,7 @@ static void processConsoleRX(uint8_t rxByte) case '1': - APP_TRACE_INFO1("Transmit RF channel 19, 255 bytes/pkt, 0xAA, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 19, 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr(phy)); res = LlEnhancedTxTest(19, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); @@ -211,7 +211,7 @@ static void processConsoleRX(uint8_t rxByte) case '2': - APP_TRACE_INFO1("Transmit RF channel 39, 255 bytes/pkt, 0xAA, %s, forever ..", + APP_TRACE_INFO1("Transmit RF channel 39, 255 bytes/pkt, PRBS15, %s, forever ..", getPhyStr(phy)); res = LlEnhancedTxTest(39, 255, LL_TEST_PKT_TYPE_PRBS15, phy, 0); APP_TRACE_INFO2("res = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)"); diff --git a/Libraries/Cordio/controller/include/ble/bb_ble_api.h b/Libraries/Cordio/controller/include/ble/bb_ble_api.h index 1d726d94445..d7f330dd60a 100644 --- a/Libraries/Cordio/controller/include/ble/bb_ble_api.h +++ b/Libraries/Cordio/controller/include/ble/bb_ble_api.h @@ -365,7 +365,14 @@ void BbBleResetConnStats(void); */ /*************************************************************************************************/ void BbBleGetTestStats(BbBleDataPktStats_t *pStats); - +/*************************************************************************************************/ +/*! + * \brief Reset test mode packet statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleResetTestStats(void); /*************************************************************************************************/ /*! * \brief Get PDU filter statistics. diff --git a/Libraries/Cordio/controller/sources/ble/bb/bb_ble_dtm.c b/Libraries/Cordio/controller/sources/ble/bb/bb_ble_dtm.c index 43445a6b283..62fad71307c 100644 --- a/Libraries/Cordio/controller/sources/ble/bb/bb_ble_dtm.c +++ b/Libraries/Cordio/controller/sources/ble/bb/bb_ble_dtm.c @@ -290,3 +290,12 @@ void BbBleGetTestStats(BbBleDataPktStats_t *pStats) { *pStats = bbTestStats; } +/*************************************************************************************************/ +/*! + * \brief Reset test mode packet statistics. + */ +/*************************************************************************************************/ +void BbBleResetTestStats(void) +{ + memset(&bbTestStats, 0, sizeof(bbTestStats)); +} diff --git a/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd.c b/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd.c index ad30c23f7de..39515eda372 100644 --- a/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd.c +++ b/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd.c @@ -33,6 +33,7 @@ #include "util/bstream.h" #include "lmgr_api.h" #include +#include "bb_ble_api.h" /*************************************************************************************************/ /*! @@ -266,9 +267,11 @@ static void lhciCommonSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t /* --- test --- */ case HCI_OPCODE_LE_RECEIVER_TEST: + lhciPackCmdCompleteEvtStatus(pBuf, status); break; case HCI_OPCODE_LE_TRANSMITTER_TEST: + lhciPackCmdCompleteEvtStatus(pBuf, status); break; case HCI_OPCODE_LE_TEST_END: @@ -420,10 +423,13 @@ bool_t lhciCommonDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) /* --- test --- */ case HCI_OPCODE_LE_RECEIVER_TEST: + status = LlRxTest(pBuf[0], 0); paramLen = LHCI_LEN_LE_RECEIVER_TEST_EVT; break; case HCI_OPCODE_LE_TRANSMITTER_TEST: + + status = LlTxTest(pBuf[0], pBuf[1], pBuf[2], 0); paramLen = LHCI_LEN_LE_TRANSMITTER_TEST_EVT; break; diff --git a/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c b/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c index 1845c40fd89..840c17a1f46 100644 --- a/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c +++ b/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c @@ -37,6 +37,7 @@ #include "wsf_msg.h" #include "wsf_trace.h" #include "util/bstream.h" +#include "bb_ble_api.h" #include /************************************************************************************************** @@ -81,7 +82,7 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) uint8_t status = HCI_SUCCESS; uint8_t evtParamLen = 1; /* default is status field only */ uint32_t regReadAddr = 0; - LlTestReport_t rpt = { 0 }; + /* Decode and consume command packet. */ @@ -199,9 +200,15 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) status = LlEnhancedTxTest(pBuf[0], pBuf[1], pBuf[2], pBuf[3], numPackets); break; } - case LHCI_OPCODE_VS_END_TEST: { - status = LlEndTest(&rpt); - evtParamLen += sizeof(LlTestReport_t); + case LHCI_OPCODE_VS_RESET_TEST_STATS: { + status = LL_SUCCESS; + + break; + } + case LHCI_OPCODE_VS_RX_TEST: + { + uint16_t numPackets = (pBuf[4] << 8) | pBuf[3]; + status = LlEnhancedRxTest(pBuf[0], pBuf[1], pBuf[2], numPackets); break; } @@ -227,14 +234,14 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) 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: /* no action */ break; - case LHCI_OPCODE_VS_END_TEST: { - memcpy(pBuf, (uint8_t *)&rpt, sizeof(LlTestReport_t)); + case LHCI_OPCODE_VS_RESET_TEST_STATS: { + BbBleResetTestStats(); break; } diff --git a/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h b/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h index ce140b42e2f..f7e080631c8 100644 --- a/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h +++ b/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h @@ -360,10 +360,12 @@ extern "C" { HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x302) /*!< Reset connection stats. */ #define LHCI_OPCODE_VS_TX_TEST \ HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x303) /*!< Vendor specific TX test that takes numPkt param. */ - -#define LHCI_OPCODE_VS_END_TEST \ +#define LHCI_OPCODE_VS_RESET_TEST_STATS \ HCI_OPCODE(HCI_OGF_VENDOR_SPEC, \ 0x304) /*!