This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

at_cmd_set_notification_handler handler not called

HI,

I have nRF9160 modem DK. I am working a project based on http sample.

The LTE is initialized through the call:

w_lte_lc_init_and_connect();

But after ( in the function : w_lte_lc_init_and_connect(); )

    k_sem_take(&link, K_FOREVER);

    // IF I send a command here: the at_handler() is not called: at_cmd_write("AT+CMD=?", NULL, 0, NULL);

    at_cmd_set_notification_handler(NULL);

After the initialization, in the main.c, if I add:

    at_cmd_set_notification_handler(MyModemAtHandler);

And if I send modem command:

    at_cmd_write("AT+CMD=?", NULL, 0, NULL);

static void MyModemAtHandler (char* msg) {  // THIS IS NEVER CALLED

}

What did I miss?

Thank you,

David

Related