defs/si_sha/instbdev.h File Reference

Insteon Bridge device. More...

#include <si_sha/abrgdev.h>

Go to the source code of this file.

Classes

struct  sc_insteonBridgeDevice
 The Insteon bridge device class. More...

Functions

sc_status sc_insteonBridgeDevice_construct (sc_insteonBridgeDevice *brg, sc_automationDeviceMgr *pdm, const TCHAR *name, const TCHAR *basePath)
sc_status sc_insteonBridgeDevice_destruct (sc_insteonBridgeDevice *brg)
sc_status sc_insteonBridgeDevice_newPacket (sc_insteonBridgeDevice *pb, sc_automationPacketPtrh *pptrh)
sc_status sc_insteonBridgeDevice_sendStdMessage (sc_insteonBridgeDevice *pb, const TCHAR *address, s_uint8 cmd1, s_uint8 cmd2)
sc_status sc_insteonBridgeDevice_sendStdWaitAck (sc_insteonBridgeDevice *pb, const TCHAR *address, s_uint8 cmd1, s_uint8 cmd2, sc_automationPacketPtrh *rptrh)
sc_status sc_insteonBridgeDevice_processEvent (sc_insteonBridgeDevice *brg, sc_automationPacket *pkt)
sc_status sc_insteonBridgeDevice_processRequest (sc_insteonBridgeDevice *brg, sc_automationRequest *req, sc_automationResponse *res)
sc_status sc_insteonBridgeDevice_resetDeviceDB (sc_insteonBridgeDevice *pb)


Detailed Description

Insteon Bridge device.

The Insteon bridge device derives from the base automation device, and implements a number of Insteon specific functions for use by the JavaScript device.


Function Documentation

sc_status sc_insteonBridgeDevice_construct ( sc_insteonBridgeDevice brg,
sc_automationDeviceMgr pdm,
const TCHAR *  name,
const TCHAR *  basePath 
)

Constructs the Insteon bridge device brg with the given name.

Parameters:
[in,out] brg The insteon bridge device to construct.
[in] pdm The device manager for name resolution.
[in] name The name of the insteon bridge.
[in] basePath The basePath of the system.

sc_status sc_insteonBridgeDevice_destruct ( sc_insteonBridgeDevice brg  ) 

Destructs the Insteon bridge brg.

sc_status sc_insteonBridgeDevice_newPacket ( sc_insteonBridgeDevice pb,
sc_automationPacketPtrh *  pptrh 
)

Returns a new packet object from the Insteon device pool.

Parameters:
[in,out] brg The bridge device to use.
[out] pptrh The pointer-handle where the newly allolcated packet will be assigned.
Note:
The packet will be automatically returned to this pool when all references to it are released.

sc_status sc_insteonBridgeDevice_processEvent ( sc_insteonBridgeDevice brg,
sc_automationPacket pkt 
)

Processes the network event in pkt, relaying it to the appropriate JavaScript object via the device manager.

Parameters:
[in,out] brg The bridge device to use.
[in] pkt The event packet to relay.
Note:
Derived class override.

sc_status sc_insteonBridgeDevice_processRequest ( sc_insteonBridgeDevice brg,
sc_automationRequest req,
sc_automationResponse res 
)

Processes the given request req and returns a response in res.

Processes the request by serializing it to the insteon bridge controller/driver.

Parameters:
[in,out] brg The bridge device to use.
[in] req The request to send.
[out] res The response to the request.
Note:
Derived class override.

sc_status sc_insteonBridgeDevice_resetDeviceDB ( sc_insteonBridgeDevice pb  ) 

Resets (clears) the internal device database of the Insteon bridge via its controller.

Note:
After calling this, the Insteon network will have to be manually re-linked.

sc_status sc_insteonBridgeDevice_sendStdMessage ( sc_insteonBridgeDevice pb,
const TCHAR *  address,
s_uint8  cmd1,
s_uint8  cmd2 
)

Sends an Insteon standard message to the bridge controller.

Parameters:
[in,out] brg The bridge device to use.
[in] address The address of the device to send the message to.
[in] cmd1 The first byte of the standard message.
[in] cmd2 The second byte of the standard message.
Note:
The cmd1 and cmd2 arguments for standard messages are defined by Insteon in the document 'Insteon Command Tables'.
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_insteonBridgeDevice_sendStdWaitAck ( sc_insteonBridgeDevice pb,
const TCHAR *  address,
s_uint8  cmd1,
s_uint8  cmd2,
sc_automationPacketPtrh *  rptrh 
)

Sends a standard message for which a data response message is expected.

Some messages are a query for data. The response comes back as a full message.

Parameters:
[in,out] brg The bridge device to use.
[in] address The address of the device to send the message to.
[in] cmd1 The first byte of the standard message.
[in] cmd2 The second byte of the standard message.
[out] rptrh The response message.
See also:
sc_insteonBridgeDevice_sendStdMessage.


doxygen