ALEOS AF API Reference Guide
- Apr 5, 2012
- Author: Sierra Wireless
This provides detailed API documentation of all the Lua modules in ALEOS AF.
Management of Short Message Service
Type
Type
Initialize the module.
No service provided by this module will work unless this initializer function has been called first.
Registers a callback on SMS reception.
New SMS will be notified if the sender of the SMS matches the given patterns.
Sends an SMS.
Multiple SMS sending is done automatically if the message cannot be held in one SMS.
Cancels a callback registration on SMS reception.
Type sms
| sms.init() | Initialize the module. |
| sms.register(callback, senderp, messagep) | Registers a callback on SMS reception. |
| sms.send(recipient, message, format) | Sends an SMS. |
| sms.unregister(userid) | Cancels a callback registration on SMS reception. |
Type sms
Field(s)
sms.init()
Initialize the module.
No service provided by this module will work unless this initializer function has been called first.
Return values
- a true value upon success
-
nilfollowed by an error message otherwise.
sms.register(callback, senderp, messagep)
Registers a callback on SMS reception.
New SMS will be notified if the sender of the SMS matches the given patterns.
Parameters
-
callback: function to be called on sms reception matching both patterns with recepient and message as parameters. Callback signature:callback(recipient_string, message_string). -
senderp: string lua pattern that matches the sender address;nilmeans "no filtering". -
messagep: string lua pattern that matches the message (sms content),nilmeans "no filtering".
Return values
- id (can be any Lua non-nil value) should to be used only to call #sms.unregister.
-
nilfollowed by an error message otherwise.
sms.send(recipient, message, format)
Sends an SMS.
Multiple SMS sending is done automatically if the message cannot be held in one SMS.
Parameters
-
recipient: string, number/name of the SMS recipient. -
message: string containing the message (binary). -
format: string defining the format to use to send the message. Accepted values are "7bits" or "8bits".
Return values
-
"ok"on success. -
nilfollowed by an error message otherwise.
sms.unregister(userid)
Cancels a callback registration on SMS reception.
Parameter
-
userid: id returned by previous #sms.register.
Return values
-
"ok"on success. -
nilfollowed by an error message otherwise.
Comment
Forum