mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-17 12:32:14 +02:00
feat(esp_modem): Add CMUX mode to C-API
Closes https://github.com/espressif/esp-protocols/issues/41
This commit is contained in:
@ -125,6 +125,13 @@ extern "C" esp_err_t esp_modem_set_mode(esp_modem_dce_t *dce_wrap, esp_modem_dce
|
||||
dce_wrap->dce->set_data();
|
||||
} else if (mode == ESP_MODEM_MODE_COMMAND) {
|
||||
dce_wrap->dce->exit_data();
|
||||
} else if (mode == ESP_MODEM_MODE_CMUX) {
|
||||
if (dce_wrap->dce->set_mode(modem_mode::CMUX_MODE) &&
|
||||
// automatically switch to data mode for the primary terminal
|
||||
dce_wrap->dce->set_mode(modem_mode::DATA_MODE)) {
|
||||
return ESP_OK;
|
||||
}
|
||||
return ESP_FAIL;
|
||||
} else {
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user