modem AT commands tested
This commit is contained in:
parent
da7e90bc82
commit
351876cbb6
|
|
@ -42,7 +42,7 @@ static bool isPPPinitializing = false;
|
|||
#endif
|
||||
|
||||
static bool isPPPConn = false;
|
||||
static int attimeout = 300;
|
||||
static int attimeout = 1000;
|
||||
TaskHandle_t initTaskhandle;
|
||||
|
||||
#define PPP_MODEM_TIMEOUT 40
|
||||
|
|
@ -78,7 +78,7 @@ static void on_ppp_changed(void *arg, esp_event_base_t event_base,
|
|||
int32_t event_id,
|
||||
void *event_data)
|
||||
{
|
||||
ESP_LOGI(TAG, "PPP state changed event %u", (unsigned int)event_id);
|
||||
ESP_LOGI(TAG, "PPP state changed event %u", (unsigned int )event_id);
|
||||
if (event_id == NETIF_PPP_ERRORUSER)
|
||||
{
|
||||
/* User interrupted event from esp-netif */
|
||||
|
|
@ -91,7 +91,7 @@ static void on_ip_event(void *arg, esp_event_base_t event_base,
|
|||
int32_t event_id,
|
||||
void *event_data)
|
||||
{
|
||||
ESP_LOGD(TAG, "IP event! %u", (unsigned int)event_id);
|
||||
ESP_LOGD(TAG, "IP event! %u", (unsigned int )event_id);
|
||||
if (event_id == IP_EVENT_PPP_GOT_IP)
|
||||
{
|
||||
esp_netif_dns_info_t dns_info;
|
||||
|
|
@ -313,9 +313,22 @@ void ModemSetATTimeout(int timeout)
|
|||
|
||||
void ModemSendAT(char *cmd, char *resp, int timeout)
|
||||
{
|
||||
esp_modem_at(dce, cmd, resp, attimeout);
|
||||
ESP_LOGI(TAG, "Command:%s", cmd);
|
||||
ESP_LOGW(TAG, "%s", resp);
|
||||
int res = esp_modem_at(dce, cmd, resp, attimeout);
|
||||
switch(res)
|
||||
{
|
||||
case 0:
|
||||
ESP_LOGI(TAG, "OK");
|
||||
break;
|
||||
case 1:
|
||||
ESP_LOGE(TAG, "FAIL");
|
||||
break;
|
||||
case 2:
|
||||
ESP_LOGE(TAG, "TIMEOUT");
|
||||
break;
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "Response:%s", resp);
|
||||
}
|
||||
|
||||
void ModemSendSMS(void)
|
||||
|
|
|
|||
|
|
@ -235,7 +235,11 @@ void funct_gsm_imsi(char *argres, int rw)
|
|||
#ifdef CONFIG_WEBGUIAPP_MODEM_AT_ACCESS
|
||||
void funct_gsm_at(char *argres, int rw)
|
||||
{
|
||||
ModemSendAT(argres, argres, 0);
|
||||
char resp[1024];
|
||||
resp[0] = 0x00;
|
||||
ModemSendAT(argres, resp, 1000);
|
||||
snprintf(argres, VAR_MAX_VALUE_LENGTH, "%s", resp);
|
||||
|
||||
}
|
||||
void funct_gsm_at_timeout(char *argres, int rw)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user