ALEOS AF API Reference Guide

  • Apr 5, 2012
  • Author: Sierra Wireless

This provides detailed API documentation of all the Lua modules in ALEOS AF.

← Back

Management of Short Message Service

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

  1. a true value upon success
  2. nil followed 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; nil means "no filtering".
  • messagep : string lua pattern that matches the message (sms content), nil means "no filtering".

Return values

  1. id (can be any Lua non-nil value) should to be used only to call #sms.unregister.
  2. nil followed 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

  1. "ok" on success.
  2. nil followed by an error message otherwise.

sms.unregister(userid)

Cancels a callback registration on SMS reception.

Parameter

Return values

  1. "ok" on success.
  2. nil followed by an error message otherwise.

Comment

Forum

Tags

Related items

  • ALEOS Application Framework