Moving SMS response to a usable address

I am using a Sierra Wireless HL7800 modem with the nrF52840.  I have been able to receive SMS messages and see them come through the RTT log.  Setting to text mode and then listing all incoming messages, I see the below output in the log.

rtt:~$ [00:00:05.668,609] <dbg> modem_hl7800: send_at_cmd: OUT: [AT+CMGL="ALL"]
00> rtt:~$ [00:00:05.880,706] <dbg> modem_hl7800: hl7800_rx: UNHANDLED RX
00> 2b 43 4d 47 4c 3a 20 31 2c 22 52 45 43 20 52 45 |+CMGL: 1 ,"REC RE
00> 41 44 22 2c 22 35 32 37 37 22 2c 2c 22 32 34 2f |AD","527 7",,"24/
00> 31 32 2f 30 36 2c 31 36 3a 30 38 3a 31 38 2d 33 |12/06,16 :08:18-3
00> 32 22 |2"
00> rtt:~$ rtt:~$ [00:00:05.882,232] <dbg> modem_hl7800: hl7800_rx: UNHANDLED RX
00> 21 74 74 74 70 75 63 6c 6f 63 6b 3a 31 36 30 30 |!tttpucl ock:1600

I clearly see the intended text "!tttpuclock:1600" message, but I need to know where that sms is stored or move that message from the SIM to a usable register that I can use to print the actual text.

From the AT Interface, it looks as if these are stored in "mem1" or "mem3", but I'm unclear how to access those locations,

Thanks,

  • Thanks Dejan,  I will try to find that.  I did find a case on the forum Case ID: 246543 where someone is try to do something similar, just with a different AT+Command using a get_response() function.  I stands to reason that this has been done before.  If the nrf is processing the command to, and getting the response from the modem, the data is already there somewhere.

    Stephen

  • Hi Stephen,

    Please let me know if you have any further questions.

    Best regards,
    Dejan

  • I created a handler in the hl7800.c driver, but I need to parse the SMS.  Any tutorials or samples you know of how to to do that?

    static bool on_cmd_received_sms(struct net_buf **buf, uint16_t len)
    {
            size_t out_len;
            char value[MDM_MAX_RESP_SIZE];

            out_len = net_buf_linearize(value, sizeof(value), *buf, 0, len);
            value[out_len] = 0;

            if (strlen(value) < sizeof("#,###################")) {
                /* String size too short */
                return true;
            }

            memcpy(ictx.mdm_received_msg,
               &value[MDM_MESSAGE_INDEX_1], MDM_HL7800_SMS_MAX_STR_SIZE);
            event_handler(HL7800_EVENT_READ_MESSAGE, ictx.mdm_received_msg);

            LOG_INF("SMS: %s", ictx.mdm_received_msg);
            LOG_INF("SMS Value: %s", value);
            return true;
    }

    Once I parse that massage, where do I point to in my main.c to get it?  This zephyr is so convoluted.  

  • Hi,

    Although you do not use our modem, you might still want to look at our SMS library. Relevant parser files can be found on github in the SMS library. For tutorials and samples related to the use of your particular modem and specifics of the modem implementation, you could try to ask in the Sierra Wireless Forum.

    Best regards,
    Dejan

Related