1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

AT commands: how to detect unsolicited result codes

Discussion in 'Embedded' started by pozzugno, May 8, 2014.

  1. pozzugno

    pozzugno Guest

    ha scritto:
    I implemented the mechanism you suggested: mark the end of a message
    after a small timeout (4-5 characters frame length) without receiving
    any character.
    In this way, I will have a buffer with the complete message from the modem,
    answer from a previous command or unsolicited code... most of the time.

    During developing I noticed the following. When an incoming SMS arrives,
    the modem sends an unsolicited message +CNMI to inform about the event.
    This message could appear concatenated to an answer to a previous AT
    command. In other words, the modem doesn't insert a pause, even small,
    between the answer to a previous AT command and the +CNMI unsolicited
    Detecting the start and stop of a message just using the timeout between
    receiving characters is a broken approach: I could have a concatenated
    message (answer plus unsolicited).

    I know the application layer can break this concatenated message
    depending on the content and expected answer, knowing the previous AT
    command send, but this approach will complicate the problem.
    I hoped the modem gave the opportunity to the host microcontroller to
    separate the messages at a low-level, without parsing the content, breaking
    the stream of incoming characters in messages separated at the presence
    of a long pause between characters. Unfortunately this approach doesn't
    work, at least with my modem (SIM900 of SimCom).

    IMHO, if the application layer should be the only responsible to separate
    the stream of incoming characters in messages, parsing the content, the
    low-level timeout mechanism isn't needed at all.
    It's sufficient to have a FIFO buffer where the incoming characters
    will be pushed in ISR and popped in the application code.
    pozzugno, May 20, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.