What is the best design for polling a modem for incoming data?

后端 未结 2 913
终归单人心
终归单人心 2021-02-09 03:44

I have a GSM modem connected to my computer, i want to receive text messages sent to it using a python program i have written, am just wondering what is the best technique to po

2条回答
  •  礼貌的吻别
    2021-02-09 04:30

    I find I can't remember much of the AT command set related to SMS. Andre Miller's answer seems to ring a few bells. Anyway you should read the documentation very carefully, I'm sure there were a few gotchas.

    My recommentation for polling is at least every 5 seconds - this is just for robustness and responsiveness in the face of disconnection.

    I used a state machine to navigate between initialisation, reading and deleting messages.

提交回复
热议问题