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

feat(cdc_acm): Add SimCom A7672 modem to descriptor tests #77

Merged
merged 1 commit into from
Oct 9, 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
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);
}
}
}
}
Loading