Hi Folks,
Here is a first crack at a GSM Library. Thought I had better get some feedback before I complete it just in case as I am an eLua/Lua noob!
Example usage:
require 'gsm'
gsm.init{ id = 3}
if gsm.gsm() then
gsm.sendSMS('022XXXXXX','wassup')
end
---------
GPRS features (eg tcp/ip operations such as HTTP GET) etc are not implemented yet, nor are phonebook, sms features (except sending SMS).
It is reasonably robust in getting an GSM connection, anything more robust is up to the you to implement as additional application logic.
I have only tested this with one GSM Device (sim300) but it should (in theory) work on any GSM07.07 device :)
There is a test() function you can run that will dump out AT Command support which will assist in this area. Eg
if gsm.at() then
gsm.test()
end
manufacturer:SIMCOM_Ltd
model:SIMCOM_SIM300S
revision:Revision:1604B06SIM300S32_SST34HF3284_MMS
CCLK
+CPBS: ("MC","RC","DC","LD","LA","ME","SM","FD","ON","BN","SD","VM")
+CREG: (0-2)
+CFUN: (0,1,4),(0-1)
+CGATT: (0-1)
+CGDCONT: (1-10),"IP",,,(0,1),(0,1)
+CMEE: (0-2)
+COPS: (2,"VODAFONE","voda NZ","53001"),(3,"24","24","53024"),,(0-4),(0-2)
--------------
Cheers,
PS Any tips to improve performance would be great, I am a web developer so this is the first time I have had to think about memory usage etc and I have used quite a bit of string concat, table, regex features to ensure the code is reasonably high level, hhehe
Ok, beer o'clock time :)
TiM
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev