Hello,
so i"m trying since a week with my device "usb gsm" on AMS to send and receive sms
really i find it very hard, i finally could get some result this day,
so im using this code to conect,send command and recieve an answer
when i send this simple command "AT" , my device always answer with an "OK" of 3 bytes,
even an other command , the last line should be an "OK".
but if i try to send an other commande (exmple :AT+COPS? ) , i really don't know how larg is it my bytes, and here is my big probleme
if someone could help how to find the size of device's answer of some other methode
i try to read it byt by byte untile i get an OK, it got an crash becose it doesn't support a multipe read.
i try to read the whole file with serial:read("*all") or serial:read("a") it got an infinty loop
then how can i listen to my new sms.
thank you and sorry for my bad english
so i"m trying since a week with my device "usb gsm" on AMS to send and receive sms
really i find it very hard, i finally could get some result this day,
so im using this code to conect,send command and recieve an answer
Code:
port = "com4"; baud = 9600 serial = io.open(port,"w+") serial:write("AT") serial:write("\n") serial:flush() n = serial:read(3); serial:close() Input.SetText("Input1", n)
even an other command , the last line should be an "OK".
but if i try to send an other commande (exmple :AT+COPS? ) , i really don't know how larg is it my bytes, and here is my big probleme
if someone could help how to find the size of device's answer of some other methode
i try to read it byt by byte untile i get an OK, it got an crash becose it doesn't support a multipe read.
i try to read the whole file with serial:read("*all") or serial:read("a") it got an infinty loop
then how can i listen to my new sms.
thank you and sorry for my bad english
Comment