gxPL  1.0
Tools, Application and Framework for xPL
Bridge

Detailed Description

A bridge connects two networks do not have the same physical layer.
The outside of a bridge uses UDP and behaves like a device associated with a schema. The inside of a bridge acts as a hub and does not use UDP.

Functions

int gxPLBridgeClose (gxPLBridge *bridge)
 Close a gxPLBridge object and release all ressources. More...
 
gxPLDevice * gxPLBridgeDevice (gxPLBridge *bridge)
 Returns the device for the outsite network. More...
 
int gxPLBridgeDeviceEnable (gxPLBridge *bridge, bool enable)
 Enable device for the outsite network. More...
 
int gxPLBridgeDeviceIsEnabled (const gxPLBridge *bridge)
 Checks if device is enabled. More...
 
int gxPLBridgeDeviceSet (gxPLBridge *bridge, const char *vendor_id, const char *device_id, const char *filename, const char *version)
 Sets the device for the outsite network. More...
 
gxPLApplication * gxPLBridgeInApp (gxPLBridge *bridge)
 Returns the inside application. More...
 
gxPLBridge * gxPLBridgeOpen (gxPLSetting *insetting, gxPLSetting *outsetting, uint8_t max_hop)
 Opens a new gxPLBridge object. More...
 
gxPLApplication * gxPLBridgeOutApp (gxPLBridge *bridge)
 Returns the outside application. More...
 
int gxPLBridgePoll (gxPLBridge *bridge, int timeout_ms)
 Polling event of a bridge. More...
 
int gxPLBridgeSetNewInSetting (gxPLBridge *bridge, gxPLSetting *insetting)
 Sets new setting for inside network If configuration differ, the network will be closed then opened with the new configuration. More...
 

Function Documentation

int gxPLBridgeClose ( gxPLBridge *  bridge)

Close a gxPLBridge object and release all ressources.

Parameters
bridgepointer to a gxPLBridge object
Returns
0, -1 if an error occurs
gxPLDevice* gxPLBridgeDevice ( gxPLBridge *  bridge)

Returns the device for the outsite network.

Parameters
bridgepointer to a gxPLBridge object
Returns
int gxPLBridgeDeviceEnable ( gxPLBridge *  bridge,
bool  enable 
)

Enable device for the outsite network.

Parameters
bridgepointer to a gxPLBridge object
enable
Returns
0, -1 if an error occurs
int gxPLBridgeDeviceIsEnabled ( const gxPLBridge *  bridge)

Checks if device is enabled.

Parameters
bridgepointer to a gxPLBridge object
Returns
false, true, -1 if an error occurs
int gxPLBridgeDeviceSet ( gxPLBridge *  bridge,
const char *  vendor_id,
const char *  device_id,
const char *  filename,
const char *  version 
)

Sets the device for the outsite network.

Parameters
bridgepointer to a gxPLBridge object
vendor_id
device_id
filename
version
Returns
0, -1 if an error occurs
gxPLApplication* gxPLBridgeInApp ( gxPLBridge *  bridge)

Returns the inside application.

Parameters
bridgepointer to a gxPLBridge object
Returns
the application
gxPLBridge* gxPLBridgeOpen ( gxPLSetting insetting,
gxPLSetting outsetting,
uint8_t  max_hop 
)

Opens a new gxPLBridge object.

Parameters
insettingpointer to the inside configuration, this configuration can be modified by the function to return the actual configuration.
outsettingpointer to the outside configuration (udp), this configuration can be modified by the function to return the actual configuration
max_hoponly messages with a hop count less than or equal to max_hop cross the bridge
Returns
the object or NULL if error occurs
gxPLApplication* gxPLBridgeOutApp ( gxPLBridge *  bridge)

Returns the outside application.

Parameters
bridgepointer to a gxPLBridge object
Returns
the application
int gxPLBridgePoll ( gxPLBridge *  bridge,
int  timeout_ms 
)

Polling event of a bridge.

Parameters
bridgepointer to a gxPLBridge object
timeout_mswaiting period in ms before output if no event occurs
Returns
0, -1 if an error occurs
int gxPLBridgeSetNewInSetting ( gxPLBridge *  bridge,
gxPLSetting insetting 
)

Sets new setting for inside network If configuration differ, the network will be closed then opened with the new configuration.

Parameters
bridgepointer to a gxPLBridge object
insettingnew inside network setting
Returns
0, -1 if an error occurs