defs/si_sha/zigbdev.h File Reference

ZigBee Bridge device. More...

#include <si_sha/abrgdev.h>

Go to the source code of this file.

Classes

struct  sc_zigbeeBridgeDevice
 The ZigBee bridge device class. More...

Functions

sc_status sc_zigbeeBridgeDevice_construct (sc_zigbeeBridgeDevice *brg, sc_automationDeviceMgr *pdm, const TCHAR *name, const TCHAR *basePath, s_uint8 channel, s_uint16 panId)
sc_status sc_zigbeeBridgeDevice_destruct (sc_zigbeeBridgeDevice *brg)
sc_status sc_zigbeeBridgeDevice_newPacket (sc_zigbeeBridgeDevice *brg, sc_automationPacketPtrh *pptrh)
sc_status sc_zigbeeBridgeDevice_processEvent (sc_zigbeeBridgeDevice *brg, sc_automationPacket *pkt)
sc_status sc_zigbeeBridgeDevice_processRequest (sc_zigbeeBridgeDevice *brg, sc_automationRequest *req, sc_automationResponse *res)
sc_status sc_zigbeeBridgeDevice_discover (sc_zigbeeBridgeDevice *brg)


Detailed Description

ZigBee Bridge device.

The ZigBee bridge device derives from the base automation device, and relays messages between the JavaScript and the low-level ZigBee bridge controller.


Function Documentation

sc_status sc_zigbeeBridgeDevice_construct ( sc_zigbeeBridgeDevice brg,
sc_automationDeviceMgr pdm,
const TCHAR *  name,
const TCHAR *  basePath,
s_uint8  channel,
s_uint16  panId 
)

Constructs the ZigBee bridge device brg with the given name.

Upon construction, the bridge should create a network on channel, with panId, if such a network doesn't already exist.

The frequency channel can be one of the 16 channels 11-26 inclusive. The panId can be any 16 bit value and is user assigned. It only serves to distinguish networks if there happen to be multiple overlapping networks in a local area.

Parameters:
[in,out] brg The zigbee bridge device to construct.
[in] pdm The device manager for name resolution.
[in] name The name of the zigbee bridge.
[in] basePath The basePath of the system.
[in] channel The frequency channel (11-26) for the network.
[in] panId The user assigned 16 bit panId.
Note:
To change the channel and panId assigned at start time, use the utility lase-bridge-cfg.pl with the --args command line parameter.

On secure ZigBee networks, each device must know the channel and panId parameters of the network.

sc_status sc_zigbeeBridgeDevice_destruct ( sc_zigbeeBridgeDevice brg  ) 

Destructs ZigBee bridge device brg.

sc_status sc_zigbeeBridgeDevice_discover ( sc_zigbeeBridgeDevice brg  ) 

Discovers devices that have joined the ZigBee network.

Note:
Not currently implemented.

sc_status sc_zigbeeBridgeDevice_newPacket ( sc_zigbeeBridgeDevice brg,
sc_automationPacketPtrh *  pptrh 
)

Returns a new packet object from the ZigBee 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_zigbeeBridgeDevice_processEvent ( sc_zigbeeBridgeDevice 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_zigbeeBridgeDevice_processRequest ( sc_zigbeeBridgeDevice 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 ZigBee 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.


doxygen