If you are asking a question, please follow this template:
- My goal is: Getting to run the AT command to get its corresponding payload
- My actions are:
#include "mgos.h"
#include "mgos_pppos.h"
static bool ATGPS_cb(void *cb_arg, bool ok, struct mg_str data)
{
if (!ok) {
return false;
}
LOG(LL_INFO, ("ATGPS_cb data length: %d", data.len));
return true;
}
struct mgos_pppos_cmd ATCmd[] = {
{.cmd = "AT$GPSACP", .cb = ATGPS_cb},
// {.cmd = "AT$GPSACP"},
{.cmd = NULL}
};
static void timer_cb(void *arg)
{
if (!mgos_pppos_run_cmds(0, ATCmd))
{
LOG(LL_INFO, ("mgos_pppos_run_cmds FAILED"));
}
else
{
LOG(LL_INFO, ("mgos_pppos_run_cmds SUCCESS"));
}
}
enum mgos_app_init_result mgos_app_init(void)
{
mgos_set_timer(2000 /* ms */, MGOS_TIMER_REPEAT, timer_cb, NULL);
return MGOS_APP_INIT_SUCCESS;
}
- The result I see is:
This problem happens rather frequently after a certain amount of time.
- My expectation & question is: How to run AT command without this problem? Is there another mechanism to extract the AT payload?