Filters provide an incredibly powerful method of addressing devices and applications. Filters are only applied to incoming broadcast messages, and are intended to reduce the number of messages that a device will act upon.
If multiple filters are present, only one of the filters needs to match for the message to be processed.
Message Filters may also be specified via a configuration message.
Adds a filter to the device.
- Parameters
-
device | pointer on the device |
filter_name | new filter |
- Returns
- 0, -1 if an error occurs
int gxPLDeviceFilterAddFromStr |
( |
gxPLDevice * |
device, |
|
|
char * |
filter |
|
) |
| |
Adds a filter to the device from a string.
the format of the string is as follows:
1 filter = [msgtype].[vendor].[device].[instance].[class].[type]
for example:
- xpl-cmnd.wmute.k400.bedroom.drapes.basic
- xpl-cmnd.wmute.k400.bedroom.drapes.*
- xpl-cmnd.wmute.k400.bedroom.*.*
- xpl-cmnd.wmute.k400.*.drapes.basic
- .
- Parameters
-
device | pointer on the device |
filter_name | new filter as a string, will be modified by the function unusable after the call. |
- Returns
- 0, -1 if an error occurs
int gxPLDeviceFilterClearAll |
( |
gxPLDevice * |
device | ) |
|
Erases all filters.
- Parameters
-
device | pointer on the device |
- Returns
- 0, -1 if an error occurs
int gxPLDeviceFilterCount |
( |
const gxPLDevice * |
device | ) |
|
Number of filters.
- Parameters
-
device | pointer on the device |
- Returns
- the value, -1 if an error occurs
const char* gxPLDeviceFilterGet |
( |
const gxPLDevice * |
device, |
|
|
int |
index |
|
) |
| |
Gets a filter.
- Parameters
-
device | pointer on the device |
index | index of the filter to read |
- Returns
- the filter, NULL if error occurs
int gxPLDeviceFilterHave |
( |
const gxPLDevice * |
device | ) |
|
Indicates whether the device has filters.
- Parameters
-
device | pointer on the device |
- Returns
- 0, -1 if an error occurs
const char* gxPLDeviceFilterToString |
( |
const gxPLFilter * |
filter | ) |
|
Convert a filter to a string For display purposes.
- Parameters
-
- Returns
- a string in a static buffer that is overwritten with each call to the function.