forked from espressif/esp-protocols
Merge pull request #28 from bitron/esp-modem_sim800_fix
esp_modem fix for SIM800 modem devices (IDFGH-7166)
This commit is contained in:
@@ -143,7 +143,21 @@ void app_main(void)
|
|||||||
// Init netif object
|
// Init netif object
|
||||||
esp_netif_t *esp_netif = esp_netif_new(&netif_ppp_config);
|
esp_netif_t *esp_netif = esp_netif_new(&netif_ppp_config);
|
||||||
assert(esp_netif);
|
assert(esp_netif);
|
||||||
|
|
||||||
|
#if CONFIG_EXAMPLE_MODEM_DEVICE_BG96 == 1
|
||||||
|
ESP_LOGI(TAG, "Initializing esp_modem for the BG96 module...");
|
||||||
|
esp_modem_dce_t *dce = esp_modem_new_dev(ESP_MODEM_DCE_BG96, &dte_config, &dce_config, esp_netif);
|
||||||
|
#elif CONFIG_EXAMPLE_MODEM_DEVICE_SIM800 == 1
|
||||||
|
ESP_LOGI(TAG, "Initializing esp_modem for the SIM800 module...");
|
||||||
|
esp_modem_dce_t *dce = esp_modem_new_dev(ESP_MODEM_DCE_SIM800, &dte_config, &dce_config, esp_netif);
|
||||||
|
#elif CONFIG_EXAMPLE_MODEM_DEVICE_SIM7600 == 1
|
||||||
|
ESP_LOGI(TAG, "Initializing esp_modem for the SIM7600 module...");
|
||||||
|
esp_modem_dce_t *dce = esp_modem_new_dev(ESP_MODEM_DCE_SIM7600, &dte_config, &dce_config, esp_netif);
|
||||||
|
#else
|
||||||
|
ESP_LOGI(TAG, "Initializing esp_modem for a generic module...");
|
||||||
esp_modem_dce_t *dce = esp_modem_new(&dte_config, &dce_config, esp_netif);
|
esp_modem_dce_t *dce = esp_modem_new(&dte_config, &dce_config, esp_netif);
|
||||||
|
#endif
|
||||||
|
assert(dce);
|
||||||
|
|
||||||
#if CONFIG_EXAMPLE_NEED_SIM_PIN == 1
|
#if CONFIG_EXAMPLE_NEED_SIM_PIN == 1
|
||||||
// check if PIN needed
|
// check if PIN needed
|
||||||
|
@@ -269,7 +269,7 @@ command_result set_data_mode(CommandableIf *t)
|
|||||||
command_result set_data_mode_sim8xx(CommandableIf *t)
|
command_result set_data_mode_sim8xx(CommandableIf *t)
|
||||||
{
|
{
|
||||||
ESP_LOGV(TAG, "%s", __func__ );
|
ESP_LOGV(TAG, "%s", __func__ );
|
||||||
return generic_command(t, "ATD*99##\r", "CONNECT", "ERROR", 5000);
|
return generic_command(t, "ATD*99#\r", "CONNECT", "ERROR", 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
command_result resume_data_mode(CommandableIf *t)
|
command_result resume_data_mode(CommandableIf *t)
|
||||||
|
Reference in New Issue
Block a user