SMS notification

Hello,

While using the at_client sample, when the SMS is received, the following notification is seen

How can I have the access to these notification in other application?

For example I tried the below code to receive the new message ack:

void sms_receive()
{
        lte_lc_init();
        if (at_cmd_write("AT+CFUN=1", NULL, 0, NULL) != 0) {
        printk("Error cfun");
        return;
        }
        k_sleep(1000);
        if (at_cmd_write("AT+CNMI=3,2,0,1", NULL, 0, NULL) != 0) {
        printk("Error cnmi");
        return;
        }
        if (at_cmd_write("AT+CNMA", cnma_read, sizeof(cnma_read), NULL) != 0) {
        printk("Error cnma");
        return;
        }
        if((cnma_read[0] == 'O')){
              gpio_pin_write(gpio_dev, 16, 1);
              printk("SMS received\n");
        }
        else{
              gpio_pin_write(gpio_dev, 16, 0);
              printk("SMS not received\n");
        }
}

Even if the message is received, with the above code, the logic does not change.

So how can I have access to the notifications?

Related