Skip to content

Commit

Permalink
Merge branch 'feat/support_legacy_cmd' into 'master'
Browse files Browse the repository at this point in the history
example: support legacy PHY command in cert_test

Closes WIFI-5798

See merge request espressif/esp-idf!23412
  • Loading branch information
MaxwellAlan committed May 25, 2023
2 parents a4bb596 + 2d072ab commit 7121ec0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitlab/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
/examples/openthread/ @esp-idf-codeowners/ieee802154
/examples/peripherals/ @esp-idf-codeowners/peripherals
/examples/peripherals/usb/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
/examples/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
/examples/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/examples/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
/examples/security/ @esp-idf-codeowners/security
Expand Down
7 changes: 5 additions & 2 deletions examples/phy/cert_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ I (191970) phy: BT TX TONE STOP!
phy>
```

## Troubleshooting
## PHY Commands Format

For BLE test, if you want to use `fcc_le_tx` and `rw_le_rx_per` legacy commands for tx/rx test, you need to enable `ESP_PHY_LEGACY_COMMANDS` in menuconfig, otherwise, the new format commands `esp_ble_tx` and `esp_ble_rx` are supported.

For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
## Troubleshooting

For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
14 changes: 14 additions & 0 deletions examples/phy/cert_test/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
menu "Example Configuration"

choice COMMANDS_FORMAT
prompt "PHY Commands Format"
default ESP_PHY_NEW_COMMANDS
config ESP_PHY_LEGACY_COMMANDS
bool "Legacy Commands Format"

config ESP_PHY_NEW_COMMANDS
bool "New Commands Format"

endchoice

endmenu
13 changes: 13 additions & 0 deletions examples/phy/cert_test/main/cmd_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ static phy_ble_rx_t phy_ble_rx_args;
static phy_bt_tx_tone_t phy_bt_tx_tone_args;
#endif

#if CONFIG_ESP_PHY_LEGACY_COMMANDS
#define arg_int0(_a, _b, _c, _d) arg_int0(NULL, NULL, _c, _d)
#define arg_int1(_a, _b, _c, _d) arg_int1(NULL, NULL, _c, _d)
#endif

static int esp_phy_tx_contin_en_func(int argc, char **argv)
{
int nerrors = arg_parse(argc, argv, (void **) &phy_args);
Expand Down Expand Up @@ -487,7 +492,11 @@ void register_phy_cmd(void)
phy_ble_tx_args.end = arg_end(1);

const esp_console_cmd_t esp_ble_tx_cmd = {
#if CONFIG_ESP_PHY_NEW_COMMANDS
.command = "esp_ble_tx",
#elif CONFIG_ESP_PHY_LEGACY_COMMANDS
.command = "fcc_le_tx",
#endif
.help = "BLE TX command",
.hint = NULL,
.func = &esp_phy_ble_tx_func,
Expand All @@ -501,7 +510,11 @@ void register_phy_cmd(void)
phy_ble_rx_args.end = arg_end(1);

const esp_console_cmd_t esp_ble_rx_cmd = {
#if CONFIG_ESP_PHY_NEW_COMMANDS
.command = "esp_ble_rx",
#elif CONFIG_ESP_PHY_LEGACY_COMMANDS
.command = "rw_le_rx_per",
#endif
.help = "BLE RX command",
.hint = NULL,
.func = &esp_phy_ble_rx_func,
Expand Down

0 comments on commit 7121ec0

Please sign in to comment.