#include <device_intf.h>
Inherits adtf::ucom::ant::IObject.
|
| enum | tIOCTL_Command : uint16_t {
IOCTL_Unknown = 0
, IOCTL_GetDeviceInfo = 1
, IOCTL_RegisterHandler = 2
, IOCTL_UnregisterHandler = 3
,
IOCTL_GetDataSize = 4
, IOCTL_GetDataTime = 5
, IOCTL_Start = 6
, IOCTL_Stop = 7
,
IOCTL_Pause = 8
, IOCTL_GetConfig = 9
, IOCTL_SetConfig = 10
, IOCTL_BusWakeup = 11
,
IOCTL_BusSleep = 12
, IOCTL_User = 0x0100
} |
| | Device I/O control commands. More...
|
| |
| enum | tDeviceMode : uint8_t { DM_Unknown = 0
, DM_Read = 1
, DM_Write = 2
, DM_ReadWrite = 3
} |
| | Device access modes. More...
|
| |
| enum | tDeviceFlags { DF_None = 0x00
, DF_AsyncIO = 0x01
} |
| | Device operation flags. More...
|
| |
|
| | ADTF_IID (IDevice, "device.ant.ucom.adtf.iid") |
| |
| virtual tResult | Open (const char *strDeviceName, int nMode=0)=0 |
| |
| virtual tResult | Close ()=0 |
| |
| virtual int | Read (void *pvBuffer, int nBufferSize)=0 |
| |
| virtual int | Write (const void *pvBuffer, int nBufferSize)=0 |
| |
| virtual int | IOCtl (int nCommand, void *pvData=NULL, int nDataSize=0)=0 |
| |
| | ADTF_IID (IObject, "object.ant.ucom.adtf.iid") |
| |
|
|
| ~IDevice ()=default |
| | Protected destructor --> Only the final implementation can be destroyed!
|
| |
|
| ~IObject ()=default |
| | Protected destructor --> Only the final implementation can be destroyed!
|
| |
The IDevice interface wraps I/O devices.
◆ tDeviceFlags
Device operation flags.
| Enumerator |
|---|
| DF_None | No flags specified.
|
| DF_AsyncIO | Device needs to by synchronized to frequency.
|
◆ tDeviceMode
Device access modes.
| Enumerator |
|---|
| DM_Unknown | Unknown mode.
|
| DM_Read | Device will be opened for read-only access.
|
| DM_Write | Device will be opened for write-only access.
|
| DM_ReadWrite | Device will be opened for read-write access.
|
◆ tIOCTL_Command
Device I/O control commands.
| Enumerator |
|---|
| IOCTL_Unknown | Unknown.
|
| IOCTL_GetDeviceInfo | Get device info.
|
| IOCTL_RegisterHandler | Register callback handler.
|
| IOCTL_UnregisterHandler | Unregister callback handler.
|
| IOCTL_GetDataSize | Get data size.
|
| IOCTL_GetDataTime | Get data time.
|
| IOCTL_Start | Start device.
|
| IOCTL_Stop | Stop device.
|
| IOCTL_Pause | Pause device.
|
| IOCTL_GetConfig | Get device configuration.
|
| IOCTL_SetConfig | Set device configuration.
|
| IOCTL_BusWakeup | Wakeup bus.
|
| IOCTL_BusSleep | Suspend bus.
|
| IOCTL_User | Start identifier for user control commands.
|
◆ ADTF_IID()
| adtf::ucom::ant::IDevice::ADTF_IID |
( |
IDevice | , |
|
|
"device.ant.ucom.adtf.iid" | ) |
◆ Close()
| virtual tResult adtf::ucom::ant::IDevice::Close |
( |
| ) |
|
|
pure virtual |
Close device. The Close method closes a device.
- Returns
- Returns a standard result code.
◆ IOCtl()
| virtual int adtf::ucom::ant::IDevice::IOCtl |
( |
int | nCommand, |
|
|
void * | pvData = NULL, |
|
|
int | nDataSize = 0 ) |
|
pure virtual |
Execute I/O control command. The IOCtl method executes a device specific I/O control command.
- Parameters
-
| [in] | nCommand | Command identifier. |
| [in] | pvData | Pointer to command specific data. |
| [in] | nDataSize | Size of command specific data. |
- Returns
- Returns a command specific value, usually -1 if the command failed.
◆ Open()
| virtual tResult adtf::ucom::ant::IDevice::Open |
( |
const char * | strDeviceName, |
|
|
int | nMode = 0 ) |
|
pure virtual |
Open device. The Open method opens a device.
- Parameters
-
| [in] | strDeviceName | Name or identifier to be used to specifiy the device. |
| [in] | nMode | Access mode to be opened the device for. |
- Returns
- Returns a standard result code.
◆ Read()
| virtual int adtf::ucom::ant::IDevice::Read |
( |
void * | pvBuffer, |
|
|
int | nBufferSize ) |
|
pure virtual |
Read data from device. The Read method reads data from an opened device.
- Parameters
-
| [in] | pvBuffer | Pointer to an existing buffer. |
| [in] | nBufferSize | Size in bytes of the existing buffer. |
- Returns
- Returns the number of bytes read from the device or -1 if failed.
◆ Write()
| virtual int adtf::ucom::ant::IDevice::Write |
( |
const void * | pvBuffer, |
|
|
int | nBufferSize ) |
|
pure virtual |
Write data to device. The Write method writes data to an opened device.
- Parameters
-
| pvBuffer | [in] Pointer to an existing buffer. |
| nBufferSize | [in] Size in bytes of the existing buffer. |
- Returns
- Returns the number of bytes written to the device or -1 if failed.
The documentation for this class was generated from the following file: