You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi Jake,

    Yes, you're right there. When you do at.cmd, it'll call the function once, and if that function returns a function then it'll call that for the next line. Finally if it was still waiting for info and it hits the timeout, it'll call the function with undefined.

    Only thing I'd say in your example is while it works you probably don't want to do if (!d) return callback("Error in SOMECOMMAND"); - just call the callback and don't return anything.

    The reason for that one is later you might do if (d!="what_i_want") return callback("Error in SOMECOMMAND");, but then callback could return something and the AT module might still end up waiting for a response - it just could be a source of bugs.

    I'd be interested to know what you have to change for SIM800 - I'd hope that we could maybe make the same module handle both devices, as I'm pretty sure people have had SIM800 working.

About

Avatar for Gordon @Gordon started