Firmware Development/API

Proposal for LUA api on RuuviTracker device.

Event Handling
GSM driver registers two virtual interrupt numbers to eLua engine. INT_GSM_CALL and INT_GSM_SMS. These may be used to react for incoming messages or incoming calls.

CALL interrupt gives no parameter to handler function. You can use gsm.get_caller to check caller number. This interrupt keeps repeating until call is answered or ended.

SMS interrupt gives one parameter for receiving handler. This parameter is index to message received.

Example

HTTP
Example

I2C
Additions to eLua I2C api. These functions handles START and STOP conditions internally. Also direction is set up correctly. Functions assume 8bit register addresses.