wirbelscan implements, starting from version 0.0.5-pre12, a service interface, allowing other plugins to communicate with or control wirbelscan. The service interface can be implemented by including wirbelscans service header. You may also provide a copy of this header file in your source code, but pointing to wirbelscan is the preferred solution.
#include "../wirbelscan/wirbelscan_services.h" using namespace WIRBELSCAN_SERVICE; |
virtual bool Service(const char *Id, void *Data = NULL); |
Id is a unique identification string that identifies the plugin, the requested service and its protocol version number. A service id for wirbelscan looks like this: "wirbelscan_<SERVICE>#<VERSION>". At the moment of writing this, its assumed that higher versions will stay backward compatible, but in general, a plugin using the interface should use services only with matching service version.
NOTE: The function service returns true for any service id string it handles, and false otherwise.
The following services are available:
Data is a pointer to a data structure, depending on the service used. If Data is set to NULL and wirbelscan supports this service it will return true. You may use this as a 'service supported' check.
Id = "wirbelscan_GetVersion".
Data is a pointer of type cWirbelscanInfo.
Id = "wirbelscan_GetStatus#<VERSION>".
Data is a pointer of type cWirbelscanStatus.
The following properties are returned in version 0001:
NOTE: Most of the properties are meaningless, if no scan in progress.
Id = "wirbelscan_DoCmd#<VERSION>".
Data is a pointer of type cWirbelscanCmd.
Data->replycode will be true on success, false otherwise.
The following commands are defined in version 0001:
Id = "wirbelscan_GetSetup#<VERSION>".
Data is a pointer of type cWirbelscanScanSetup.
Id = "wirbelscan_SetSetup#<VERSION>".
Data is a pointer of type cWirbelscanScanSetup.
NOTE: The changes will be only permanent, if the command Store is called afterwards, see DoCmd.
Id = "wirbelscan_GetCountry#<VERSION>".
Data is a pointer of type cPreAllocBuffer.
Should be called twice.
NOTE: It's the calling plugins responsibility to provide a buffer of sufficient size and to cleanup this buffer. If the provided buffer is too small, segmentation fault / memory corruption will occur.
Id = "wirbelscan_GetSat#<VERSION>".
Data is a pointer of type cPreAllocBuffer.
Should be called twice.
NOTE: It's the calling plugins responsibility to provide a buffer of sufficient size and to cleanup this buffer. If the provided buffer is too small, segmentation fault / memory corruption will occur.
For further details, please refer to VDRs PLUGIN.html and wirbelscan_services.h.