|
MMDevice
|
#include "MMDevice.h"Go to the source code of this file.
Macros | |
| #define | MODULE_INTERFACE_VERSION 10 |
| Module interface version. | |
| #define | MODULE_API __attribute__((visibility("default"))) |
Functions | |
| MODULE_API void | InitializeModuleData () |
| Initialize the device adapter module. | |
| MODULE_API MM::Device * | CreateDevice (const char *name) |
| Instantiate the named device. | |
| MODULE_API void | DeleteDevice (MM::Device *pDevice) |
| Destroy a device instance. | |
| MODULE_API long | GetModuleVersion () |
| MODULE_API long | GetDeviceInterfaceVersion () |
| MODULE_API unsigned | GetNumberOfDevices () |
| MODULE_API bool | GetDeviceName (unsigned deviceIndex, char *name, unsigned bufferLength) |
| MODULE_API bool | GetDeviceType (const char *deviceName, int *type) |
| MODULE_API bool | GetDeviceDescription (const char *deviceName, char *name, unsigned bufferLength) |
| void | RegisterDevice (const char *deviceName, MM::DeviceType deviceType, const char *description) |
| Register a device class provided by the device adapter library. | |
| #define MODULE_API __attribute__((visibility("default"))) |
| #define MODULE_INTERFACE_VERSION 10 |
Module interface version.
The Core ensures that any loaded device adapter modules have a matching version, to ensure ABI compatibility.
| MODULE_API MM::Device * CreateDevice | ( | const char * | name | ) |
Instantiate the named device.
Device adapter modules must provide an implementation of this function.
The implementation of this function should create an instance of the device and return a raw pointer to it.
| MODULE_API void DeleteDevice | ( | MM::Device * | pDevice | ) |
Destroy a device instance.
Device adapter modules must provide an implementation of this function.
The implementation of this function should deallocate (delete) the given device instance (which is guaranteed to be one that was previously returned by CreateDevice()).
| MODULE_API bool GetDeviceDescription | ( | const char * | deviceName, |
| char * | name, | ||
| unsigned | bufferLength ) |
| MODULE_API long GetDeviceInterfaceVersion | ( | ) |
| MODULE_API bool GetDeviceName | ( | unsigned | deviceIndex, |
| char * | name, | ||
| unsigned | bufferLength ) |
| MODULE_API bool GetDeviceType | ( | const char * | deviceName, |
| int * | type ) |
| MODULE_API long GetModuleVersion | ( | ) |
| MODULE_API unsigned GetNumberOfDevices | ( | ) |
| MODULE_API void InitializeModuleData | ( | ) |
Initialize the device adapter module.
Device adapter modules must provide an implementation of this function.
The implementation of this function should call RegisterDevice() to indicate the set of available devices in the module. The body of the function normally should not do any other processing.
This function may be called multiple times and therefore must be idempotent (since RegisterDevice() is idempotent, nothing special has to be done in most cases).
| void RegisterDevice | ( | const char * | deviceName, |
| MM::DeviceType | deviceType, | ||
| const char * | description ) |
Register a device class provided by the device adapter library.
To be called in the device adapter module's implementation of InitializeModuleData().
Calling this function indicates that the module provides a device with the given name and type, and provides a user-visible description string.