# Base xAAL Services A set of simple nodes providing base services on an xAAL bus Conforms to xAAL specification v0.7 ## Devices Following applications are proposed as proof of concept: - cache: A simple cache service. Dependencies: libsqlite3-dev - automalua: Automata with Lua scripts. This simple automata engine is transparent and does not expose itself as an xAAL device. This is the responsability of lua scripts to implement an xAAL schema (scenario.basic is a good candidate). A short introduction of the API: .Variables provided to Lua scripts (readed from config file): xAAL_Lua_baseaddr: An uuid, possibly of the first declared device. xAAL_Lua_group_id: UUID of the group to which belong the automaton xAAL_Lua_parameter: A string readed from the config file. .Functions provided to Lua scripts: xAAL_Lua_declare_device(): The Lua script must declare each device. The expected parameter is a table with following keys: addr(string) dev_type(string) vendor_id(string) product_id(string) version(string) url(string) info(string) unsupported_attributes(table of string) unsupported_methods(table of string) unsupported_notifications(table of string) Note: If there is no addr, the baseaddr is used for the first registred device, and baseaddr++ for the following ones. It retruns the address of the declared device. xAAL_Lua_filter_broadcast_by_source(): First parameter is the address of the device that wants a filter. Second parameter is a table of source addresses. xAAL_Lua_filter_broadcast_by_dev_type(): First parameter is the address of the device that wants a filter. Second parameter is a table of dev_type. xAAL_Lua_set_alarm(): First parameter is the delay in seconds. Second parameter is the address of the device that wants an alarm. Third parameter is a string, a parameter bassed back at trigger .Function that must be declared in the Lua script, called by the middleware: xAAL_Lua_receive_callback(): First parameter is the address of the device that receives the message. Next parameters (strings) are the source, dev_type, msg_type and action of the message Last parameter is a table representing the body of the message. xAAL_Lua_alarm_callback(): First parameter is the address of the device that set the alarm. Second parameter is the string provided while setting the alarm. TODO: use threads, use a restricted sandbox for lua scripts... Dependencies: liblua5.2-dev - metadatadb: A simple metadata database to store and retreive users tags about devices of its home-automation facility. ## Copyright - Christophe Lohr - IMT Atlantique - 2019 - The demo applications are provided according to the terms of the GNU General Public License v3.0 and following - Dual-licenses are accepted, contact us.