mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-29 10:17:30 +02:00
feat(esp_modem): Add optional ACT to operator-name
Closes https://github.com/espressif/esp-protocols/issues/80
This commit is contained in:
@ -34,6 +34,8 @@ int LoopbackTerm::write(uint8_t *data, size_t len)
|
||||
response = "+CSQ: 123,456\n\r\nOK\r\n";
|
||||
} else if (command.find("AT+CGMM\r") != std::string::npos) {
|
||||
response = "0G Dummy Model\n\r\nOK\r\n";
|
||||
} else if (command.find("AT+COPS?\r") != std::string::npos) {
|
||||
response = "+COPS: 0,0,\"OperatorName\",5\n\r\nOK\r\n";
|
||||
} else if (command.find("AT+CBC\r") != std::string::npos) {
|
||||
response = is_bg96 ? "+CBC: 1,20,123456\r\r\n\r\nOK\r\n\n\r\n" :
|
||||
"+CBC: 123.456V\r\r\n\r\nOK\r\n\n\r\n";
|
||||
|
@ -56,6 +56,14 @@ TEST_CASE("DCE AT parser", "[esp_modem]")
|
||||
std::string model;
|
||||
CHECK(dce->get_module_name(model) == command_result::OK);
|
||||
CHECK(model == "0G Dummy Model");
|
||||
|
||||
std::string operator_name;
|
||||
int act = 99;
|
||||
CHECK(dce->get_operator_name(operator_name) == command_result::OK);
|
||||
CHECK(operator_name == "OperatorName");
|
||||
CHECK(dce->get_operator_name(operator_name, act) == command_result::OK);
|
||||
CHECK(operator_name == "OperatorName");
|
||||
CHECK(act == 5);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user