![]() |
gxPL
1.0
Tools, Application and Framework for xPL
|
gxPLDevice xPL corresponds to a device. This is the basic network element. It is identified by vendor ID, device and instance. A device signals its arrival and departure on the network by transmitting a heartbeat message.
It starts working after having had an echo to his heartbeat.
gxPL provides two types of devices: simple devices and configurable devices.
A device must be instantiated from an application using the gxPLAppAddDevice() or gxPLAppAddConfigurableDevice().
![]() |
Modules | |
Groups | |
Filters | |
Configurable devices | |
Functions | |
gxPLDevice * | gxPLAppAddDevice (gxPLApplication *app, const char *vendor_id, const char *device_id, const char *instance_id) |
Adds a new device to an application. More... | |
gxPLDevice * | gxPLAppDeviceAt (gxPLApplication *app, int index) |
Return a device at a given index. More... | |
int | gxPLAppDeviceCount (gxPLApplication *app) |
Return number of devices. | |
int | gxPLAppDeviceIndex (gxPLApplication *app, const gxPLDevice *device) |
Return index for a given device. More... | |
int | gxPLAppRemoveDevice (gxPLApplication *app, gxPLDevice *device) |
Removes a device. More... | |
const char * | gxPLDeviceDeviceId (const gxPLDevice *device) |
Gets the device identifier. More... | |
int | gxPLDeviceDeviceIdSet (gxPLDevice *device, const char *device_id) |
Sets the device identifier. More... | |
int | gxPLDeviceEnable (gxPLDevice *device, bool enabled) |
Enabled or not a device. More... | |
int | gxPLDeviceHeartbeatInterval (const gxPLDevice *device) |
Gets the heartbeat interval. More... | |
int | gxPLDeviceHeartbeatIntervalSet (gxPLDevice *device, int interval) |
Sets the heartbeat interval. More... | |
long | gxPLDeviceHeartbeatLast (const gxPLDevice *device) |
Gets the time of the last heartbeat sent. More... | |
const gxPLId * | gxPLDeviceId (const gxPLDevice *device) |
Gets the identifier. More... | |
int | gxPLDeviceIdSet (gxPLDevice *device, const gxPLId *id) |
Sets the identifier. More... | |
const char * | gxPLDeviceInstanceId (const gxPLDevice *device) |
Gets the instance identifier. More... | |
int | gxPLDeviceInstanceIdSet (gxPLDevice *device, const char *instance_id) |
Sets the instance identifier. More... | |
int | gxPLDeviceIsConfigurale (const gxPLDevice *device) |
Indicates whether the device is configurable. More... | |
int | gxPLDeviceIsConfigured (const gxPLDevice *device) |
Indicates whether the device is configured. More... | |
int | gxPLDeviceIsEnabled (const gxPLDevice *device) |
Indicates whether the device is enabled. More... | |
int | gxPLDeviceIsHubConfirmed (const gxPLDevice *device) |
Indicates whether the device has detected a hub. More... | |
int | gxPLDeviceIsReportOwnMessages (const gxPLDevice *device) |
Indicates whether the device will transmit its own messages to the listeners. More... | |
int | gxPLDeviceIsRespondToBroadcast (const gxPLDevice *device) |
Indicates whether the device will respond to broadcast messages. More... | |
int | gxPLDeviceListenerAdd (gxPLDevice *device, gxPLDeviceListener listener, gxPLMessageType type, char *schema_class, char *schema_type, void *udata) |
Add a listener for the device. More... | |
int | gxPLDeviceListenerRemove (gxPLDevice *device, gxPLDeviceListener listener) |
Remove a device listener. More... | |
gxPLApplication * | gxPLDeviceParent (gxPLDevice *device) |
Gets the parent gxPLApplication object. More... | |
int | gxPLDeviceReportOwnMessagesSet (gxPLDevice *device, bool isreportownmsg) |
Process own messages. More... | |
int | gxPLDeviceRespondToBroadcastSet (gxPLDevice *device, bool respond) |
Enable the response to broadcast messages. More... | |
const char * | gxPLDeviceVendorId (const gxPLDevice *device) |
Gets the vendor identifier. More... | |
int | gxPLDeviceVendorIdSet (gxPLDevice *device, const char *vendor_id) |
Sets the vendor identifier. More... | |
const char * | gxPLDeviceVersion (const gxPLDevice *device) |
Gets the version string. More... | |
int | gxPLDeviceVersionSet (gxPLDevice *device, const char *version) |
Sets the version. More... | |
Typedefs | |
typedef void(* | gxPLDeviceListener) (gxPLDevice *, gxPLMessage *, void *) |
Listener for a device The end-user can add listener functions that will be called each time the device will receive messages addressed or broadcast it. . | |
gxPLDevice* gxPLAppAddDevice | ( | gxPLApplication * | app, |
const char * | vendor_id, | ||
const char * | device_id, | ||
const char * | instance_id | ||
) |
Adds a new device to an application.
app | pointer to a gxPLApplication object |
vendor_id | pointer to the vendor id |
device_id | pointer to the device id |
instance_id | pointer to the instance id |
gxPLDevice* gxPLAppDeviceAt | ( | gxPLApplication * | app, |
int | index | ||
) |
Return a device at a given index.
app | pointer to a gxPLApplication object |
index | of the device |
int gxPLAppDeviceIndex | ( | gxPLApplication * | app, |
const gxPLDevice * | device | ||
) |
Return index for a given device.
app | pointer to a gxPLApplication object |
device | pointer on the device |
int gxPLAppRemoveDevice | ( | gxPLApplication * | app, |
gxPLDevice * | device | ||
) |
Removes a device.
app | pointer to a gxPLApplication object |
device | pointer on the device |
const char* gxPLDeviceDeviceId | ( | const gxPLDevice * | device | ) |
Gets the device identifier.
device | pointer on the device |
int gxPLDeviceDeviceIdSet | ( | gxPLDevice * | device, |
const char * | device_id | ||
) |
Sets the device identifier.
device | pointer on the device |
device_id | pointer to the device id |
int gxPLDeviceEnable | ( | gxPLDevice * | device, |
bool | enabled | ||
) |
Enabled or not a device.
device | pointer on the device |
enabled | true for eanbled |
int gxPLDeviceHeartbeatInterval | ( | const gxPLDevice * | device | ) |
Gets the heartbeat interval.
device | pointer on the device |
int gxPLDeviceHeartbeatIntervalSet | ( | gxPLDevice * | device, |
int | interval | ||
) |
Sets the heartbeat interval.
device | pointer on the device |
interval | interval in seconds |
long gxPLDeviceHeartbeatLast | ( | const gxPLDevice * | device | ) |
Gets the time of the last heartbeat sent.
The time is given in a unit dependent on the host system, most of the time is given in seconds. On a unix system with a real time clock that value is the number of seconds since the first second of January 1, 1970.
device | pointer on the device |
const gxPLId* gxPLDeviceId | ( | const gxPLDevice * | device | ) |
Gets the identifier.
device | pointer on the device |
int gxPLDeviceIdSet | ( | gxPLDevice * | device, |
const gxPLId * | id | ||
) |
Sets the identifier.
device | pointer on the device |
id | pointer to identifier |
const char* gxPLDeviceInstanceId | ( | const gxPLDevice * | device | ) |
Gets the instance identifier.
device | pointer on the device |
int gxPLDeviceInstanceIdSet | ( | gxPLDevice * | device, |
const char * | instance_id | ||
) |
Sets the instance identifier.
device | pointer on the device |
instance_id | pointer to the instance id |
int gxPLDeviceIsConfigurale | ( | const gxPLDevice * | device | ) |
Indicates whether the device is configurable.
device | pointer on the device |
int gxPLDeviceIsConfigured | ( | const gxPLDevice * | device | ) |
Indicates whether the device is configured.
device | pointer on the device |
int gxPLDeviceIsEnabled | ( | const gxPLDevice * | device | ) |
Indicates whether the device is enabled.
device | pointer on the device |
int gxPLDeviceIsHubConfirmed | ( | const gxPLDevice * | device | ) |
Indicates whether the device has detected a hub.
device | pointer on the device |
int gxPLDeviceIsReportOwnMessages | ( | const gxPLDevice * | device | ) |
Indicates whether the device will transmit its own messages to the listeners.
device | pointer on the device |
int gxPLDeviceIsRespondToBroadcast | ( | const gxPLDevice * | device | ) |
Indicates whether the device will respond to broadcast messages.
device | pointer on the device |
int gxPLDeviceListenerAdd | ( | gxPLDevice * | device, |
gxPLDeviceListener | listener, | ||
gxPLMessageType | type, | ||
char * | schema_class, | ||
char * | schema_type, | ||
void * | udata | ||
) |
Add a listener for the device.
This function allows the user to install a listener that will be called for each message received for the service.
Only messages matching type, schema_class and schema_type are forwarded to the listener.
device | pointer on the device |
listener | the function listening device messages |
type | type of message to be processed, gxPLMessageAny to manage any |
schema_class | schema class to process, NULL to manage everything |
schema_type | schema type to process, NULL to manage everything |
udata | pointer to the user data that will be passed to the listener, NULL if not used. |
int gxPLDeviceListenerRemove | ( | gxPLDevice * | device, |
gxPLDeviceListener | listener | ||
) |
Remove a device listener.
device | pointer on the device |
listener | the listener |
gxPLApplication* gxPLDeviceParent | ( | gxPLDevice * | device | ) |
Gets the parent gxPLApplication object.
device | pointer on the device |
int gxPLDeviceReportOwnMessagesSet | ( | gxPLDevice * | device, |
bool | isreportownmsg | ||
) |
Process own messages.
device | pointer on the device |
isreportownmsg | true or flase |
int gxPLDeviceRespondToBroadcastSet | ( | gxPLDevice * | device, |
bool | respond | ||
) |
Enable the response to broadcast messages.
device | pointer on the device |
respond | true for respond |
const char* gxPLDeviceVendorId | ( | const gxPLDevice * | device | ) |
Gets the vendor identifier.
device | pointer on the device |
int gxPLDeviceVendorIdSet | ( | gxPLDevice * | device, |
const char * | vendor_id | ||
) |
Sets the vendor identifier.
device | pointer on the device |
vendor_id | pointer to the vendor id |
const char* gxPLDeviceVersion | ( | const gxPLDevice * | device | ) |
Gets the version string.
This information is transmitted with the heartbeat.
device | pointer on the device |
int gxPLDeviceVersionSet | ( | gxPLDevice * | device, |
const char * | version | ||
) |
Sets the version.
device | pointer on the device |
version |