Skip to content

Commit

Permalink
feat(cdc_acm): Add SimCom A7672 modem to descriptor tests
Browse files Browse the repository at this point in the history
Relates to #76
  • Loading branch information
tore-espressif committed Oct 9, 2024
1 parent 9be78b9 commit c2abed1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- Qualcomm / Option SimTech, Incorporated (SIM7600E)
- Qualcomm / Option SimTech SIM7000 (SIM7000E)
- NOT TESTED: Qualcomm / Option SimTech SIM7080 (SIM7080G)
- NOT TESTED: Qualcomm / Option A76XX Series LTE Module (SIMA7672E)
- Qualcomm / Option A76XX Series LTE Module (SIMA7672E)
- USB dongle:
- NOT TESTED: Shenzhen Rapoo Technology Co., Ltd. Rapoo 2.4G Wireless Device
- NOT TESTED: Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,62 @@ SCENARIO("Modems descriptor parsing: 7000E", "[modem][7000E]")
}
}
}

SCENARIO("Modems descriptor parsing: A7672E", "[modem][A7672E]")
{
GIVEN("SimCom A7672E FS") {
const usb_device_desc_t *dev_desc = (const usb_device_desc_t *)sima7672e_device_desc_fs_hs;
const usb_config_desc_t *cfg_desc = (const usb_config_desc_t *)sima7672e_config_desc_fs;

// Interface 0-1 belongs USB_CLASS_WIRELESS_CONTROLLER class, expect no CDC interface
SECTION("Interface 0") {
cdc_parsed_info_t parsed_result = {};
esp_err_t ret = cdc_parse_interface_descriptor(dev_desc, cfg_desc, 0, &parsed_result);
REQUIRE(ret == ESP_ERR_NOT_FOUND);
}

// Diagnostic interface
SECTION("Interface 2") {
cdc_parsed_info_t parsed_result = {};
esp_err_t ret = cdc_parse_interface_descriptor(dev_desc, cfg_desc, 2, &parsed_result);
REQUIRE_CDC_NONCOMPLIANT(ret, parsed_result);
}

// Interface 3: NMEA, Interface 4-5: AT
for (int interface = 3; interface <= 5; ++interface) {
SECTION("Interface " + std::to_string(interface)) {
cdc_parsed_info_t parsed_result = {};
esp_err_t ret = cdc_parse_interface_descriptor(dev_desc, cfg_desc, interface, &parsed_result);
REQUIRE_CDC_NONCOMPLIANT_WITH_NOTIFICATION(ret, parsed_result);
}
}
}

GIVEN("SimCom A7672E HS") {
const usb_device_desc_t *dev_desc = (const usb_device_desc_t *)sima7672e_device_desc_fs_hs;
const usb_config_desc_t *cfg_desc = (const usb_config_desc_t *)sima7672e_config_desc_hs;

// Interface 0-1 belongs USB_CLASS_WIRELESS_CONTROLLER class, expect no CDC interface
SECTION("Interface 0") {
cdc_parsed_info_t parsed_result = {};
esp_err_t ret = cdc_parse_interface_descriptor(dev_desc, cfg_desc, 0, &parsed_result);
REQUIRE(ret == ESP_ERR_NOT_FOUND);
}

// Diagnostic interface
SECTION("Interface 2") {
cdc_parsed_info_t parsed_result = {};
esp_err_t ret = cdc_parse_interface_descriptor(dev_desc, cfg_desc, 2, &parsed_result);
REQUIRE_CDC_NONCOMPLIANT(ret, parsed_result);
}

// Interface 3: NMEA, Interface 4-5: AT
for (int interface = 3; interface <= 5; ++interface) {
SECTION("Interface " + std::to_string(interface)) {
cdc_parsed_info_t parsed_result = {};
esp_err_t ret = cdc_parse_interface_descriptor(dev_desc, cfg_desc, interface, &parsed_result);
REQUIRE_CDC_NONCOMPLIANT_WITH_NOTIFICATION(ret, parsed_result);
}
}
}
}

0 comments on commit c2abed1

Please sign in to comment.