defs/si_sha/instbrg.h File Reference

Low-level Insteon bridge driver. More...

#include <si_sys/serial.h>
#include <si_sha/autobrg.h>
#include <si_sha/insteon.h>

Go to the source code of this file.

Classes

struct  sc_insteonBridge
 Insteon Bridge driver. More...

Functions

sc_status sc_insteonBridge_construct (sc_insteonBridge *pb, const TCHAR *name, const TCHAR *devName, const TCHAR *basePath)
sc_status sc_insteonBridge_destruct (sc_insteonBridge *pb)
sc_status sc_insteonBridge_getVersion (sc_insteonBridge *pb, sc_insteonBridgeVersion *pv)
sc_status sc_insteonBridge_resetLinks (sc_insteonBridge *pb)
sc_status sc_insteonBridge_getFirstLinkEntry (sc_insteonBridge *pb, sc_insteonLinkEntry *ple)
sc_status sc_insteonBridge_getNextLink (sc_insteonBridge *pb, sc_insteonLinkEntry *ple)
sc_status sc_insteonBridge_getConfiguration (sc_insteonBridge *pb, s_uint8 *pcfg)
sc_status sc_insteonBridge_setConfiguration (sc_insteonBridge *pb, s_uint8 cfg)
sc_status sc_insteonBridge_sendGroupMessage (sc_insteonBridge *pb, s_uint8 groupId, s_uint8 cmd1, s_uint8 cmd2)
sc_status sc_insteonBridge_sendStdMessage (sc_insteonBridge *pb, s_uint32 toAddress, s_uint8 cmd1, s_uint8 cmd2)
sc_status sc_insteonBridge_sendExtMessage (sc_insteonBridge *pb, s_uint32 toAddress, s_uint8 cmd1, s_uint8 cmd2, s_uint8 *data, s_int32 len)


Detailed Description

Low-level Insteon bridge driver.


Function Documentation

sc_status sc_insteonBridge_construct ( sc_insteonBridge pb,
const TCHAR *  name,
const TCHAR *  devName,
const TCHAR *  basePath 
)

Constructs an insteon bridge controller on the serial port with the special filename devName.

Parameters:
[in,out] pb The bridge object to construct.
[in] name The name of the bridge. Used to name the Unix socket its interface is provided on.
[in] devName The name of the 'special' file for the serial port the bridge is attached to.
[in] basePath The base path for the application.

sc_status sc_insteonBridge_destruct ( sc_insteonBridge pb  ) 

Destructs the given insteon bridge.

sc_status sc_insteonBridge_getConfiguration ( sc_insteonBridge pb,
s_uint8 *  pcfg 
)

Gets the PLM bridge configuration byte.

Parameters:
[in,out] pb The bridge to query.
[out] pcfg The configuration byte.
See also:
se_insteonConfigurationFlags for a description of the meanings of the different bits in the configuration byte.

sc_status sc_insteonBridge_getFirstLinkEntry ( sc_insteonBridge pb,
sc_insteonLinkEntry ple 
)

Gets the first entry in the PLM link database.

Parameters:
[in,out] pb The bridge to query.
[out] ple The link entry struct to fill in.
Note:
If the returned link entry has isEOL set to true, then the record should be treated as an end-of-list marker, and the record data should be ignored.

sc_status sc_insteonBridge_getNextLink ( sc_insteonBridge pb,
sc_insteonLinkEntry ple 
)

Gets the next entry in the PLM link database.

Parameters:
[in,out] pb The bridge to query.
[out] ple The link entry struct to fill in.
Note:
If the returned link entry has isEOL set to true, then the record should be treated as an end-of-list marker, and the record data should be ignored.

sc_status sc_insteonBridge_getVersion ( sc_insteonBridge pb,
sc_insteonBridgeVersion pv 
)

Gets the version of the PLM bridge.

Parameters:
[in,out] pb The bridge to query.
[out] pv The version struct to fill in.

sc_status sc_insteonBridge_resetLinks ( sc_insteonBridge pb  ) 

Resets (clears) the link database of the bridge.

This erases all linked devices from the bridge EERAM. After this call, the Insteon network must be rebuilt by manually re-linking devices to the bridge.

Parameters:
[in,out] pb The bridge to reset.

sc_status sc_insteonBridge_sendExtMessage ( sc_insteonBridge pb,
s_uint32  toAddress,
s_uint8  cmd1,
s_uint8  cmd2,
s_uint8 *  data,
s_int32  len 
)

Sends an 'extended' Insteon message to toAddress on the network.

All standard and extended commands are documented by Insteon in the document 'Insteon Command Tables'.

Parameters:
[in,out] pb The bridge to send the message through.
[in] toAddress The address of the device to send the message to.
[in] cmd1 The first command byte of the message.
[in] cmd2 The second command byte of the message.
[in] data The 14 bytes of extended payload data.
[in] len The length of the given data. The remaining bytes will be zero padded.
See also:
http://www.insteon.net/pdf/INSTEON_Command_Tables_20070925a.pdf for details about possible values of cmd1 and cmd2 and their semantics.

sc_status sc_insteonBridge_sendGroupMessage ( sc_insteonBridge pb,
s_uint8  groupId,
s_uint8  cmd1,
s_uint8  cmd2 
)

Send a message to the group identified by groupId.

A group-cast message with the given cmd1 and cmd2 bytes is sent out.

Parameters:
[in,out] pb The bridge to send the message through.
[in] groupId The group to send the message to.
[in] cmd1 The first command byte of the message.
[in] cmd2 The second command byte of the message.
See also:
http://www.insteon.net/pdf/INSTEON_Command_Tables_20070925a.pdf for details about possible values of cmd1 and cmd2 and their semantics.

sc_status sc_insteonBridge_sendStdMessage ( sc_insteonBridge pb,
s_uint32  toAddress,
s_uint8  cmd1,
s_uint8  cmd2 
)

Sends a 'standard' Insteon message to toAddress on the network.

Nearly all the most common messages on the Insteon network are standard messages. For example, an 'On' message is typically cmd1=0x11 and cmd2=0-0xff (on-level). 'Off' is typically cmd1=0x13 and cmd2=0x01. All standard and extended commands are documented by Insteon in the document 'Insteon Command Tables'.

Parameters:
[in,out] pb The bridge to send the message through.
[in] toAddress The address of the device to send the message to.
[in] cmd1 The first command byte of the message.
[in] cmd2 The second command byte of the message.
See also:
http://www.insteon.net/pdf/INSTEON_Command_Tables_20070925a.pdf for details about possible values of cmd1 and cmd2 and their semantics.

sc_status sc_insteonBridge_setConfiguration ( sc_insteonBridge pb,
s_uint8  cfg 
)

Sets the bridge configuration byte.

Parameters:
[in,out] pb The bridge to query.
[in] cfg The configuration byte.
See also:
se_insteonConfigurationFlags for a description of the meanings of the different bits in the configuration byte.


doxygen