ADTF
Loading...
Searching...
No Matches
device_intf.h
Go to the documentation of this file.
1
7
8#ifndef _ADTF_UCOM_ANT_DEVICE_INTERFACE_INCLUDES_HEADER_
9#define _ADTF_UCOM_ANT_DEVICE_INTERFACE_INCLUDES_HEADER_
10
11namespace adtf
12{
13namespace ucom
14{
15namespace ant
16{
17
23class DOEXPORT IDevice : public IObject
24{
25public:
30 ADTF_IID(IDevice, "device.ant.ucom.adtf.iid");
31
32public:
34 typedef struct
35 {
37 char strIdentifier[128];
38
40 uint32_t ui32Flags;
42
44 typedef enum : uint16_t
45 {
48
51
54
57
60
63
66
69
72
75
78
81
84
86 IOCTL_User = 0x0100
87 } tIOCTL_Command;
88
90 typedef struct
91 {
93 const char* strConfigName;
94
96 const void* pvValue;
97
101
103 typedef enum : uint8_t
104 {
107
110
113
116 } tDeviceMode;
117
119 typedef enum
120 {
122 DF_None = 0x00,
123
126 } tDeviceFlags;
127
128public:
138 virtual tResult Open(const char* strDeviceName, int nMode=0) = 0;
139
146 virtual tResult Close() = 0;
147
158 virtual int Read(void* pvBuffer, int nBufferSize) = 0;
159
170 virtual int Write(const void* pvBuffer, int nBufferSize) = 0;
171
184 virtual int IOCtl(int nCommand, void* pvData=NULL, int nDataSize=0) = 0;
185
186protected:
188 ~IDevice() = default;
189};
190
191}//namespace ant
192
195
196}//namespace ucom
197}//namespace adtf
198
199//*************************************************************************************************
200#endif //_ADTF_UCOM_ANT_DEVICE_INTERFACE_INCLUDES_HEADER_
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
Definition device_intf.h:24
virtual tResult Open(const char *strDeviceName, int nMode=0)=0
virtual int Read(void *pvBuffer, int nBufferSize)=0
~IDevice()=default
Protected destructor --> Only the final implementation can be destroyed!
virtual tResult Close()=0
@ DF_AsyncIO
Device needs to by synchronized to frequency.
Definition device_intf.h:125
@ DF_None
No flags specified.
Definition device_intf.h:122
@ IOCTL_GetDataTime
Get data time.
Definition device_intf.h:62
@ IOCTL_Stop
Stop device.
Definition device_intf.h:68
@ IOCTL_UnregisterHandler
Unregister callback handler.
Definition device_intf.h:56
@ IOCTL_SetConfig
Set device configuration.
Definition device_intf.h:77
@ IOCTL_Start
Start device.
Definition device_intf.h:65
@ IOCTL_GetDataSize
Get data size.
Definition device_intf.h:59
@ IOCTL_GetDeviceInfo
Get device info.
Definition device_intf.h:50
@ IOCTL_Pause
Pause device.
Definition device_intf.h:71
@ IOCTL_GetConfig
Get device configuration.
Definition device_intf.h:74
@ IOCTL_User
Start identifier for user control commands.
Definition device_intf.h:86
@ IOCTL_BusWakeup
Wakeup bus.
Definition device_intf.h:80
@ IOCTL_Unknown
Unknown.
Definition device_intf.h:47
@ IOCTL_BusSleep
Suspend bus.
Definition device_intf.h:83
@ IOCTL_RegisterHandler
Register callback handler.
Definition device_intf.h:53
virtual int IOCtl(int nCommand, void *pvData=NULL, int nDataSize=0)=0
virtual int Write(const void *pvBuffer, int nBufferSize)=0
ADTF_IID(IDevice, "device.ant.ucom.adtf.iid")
@ DM_Write
Device will be opened for write-only access.
Definition device_intf.h:112
@ DM_Read
Device will be opened for read-only access.
Definition device_intf.h:109
@ DM_Unknown
Unknown mode.
Definition device_intf.h:106
@ DM_ReadWrite
Device will be opened for read-write access.
Definition device_intf.h:115
Definition object_intf.h:33
Namespace for all functionality of the ADTF UCOM SDK provided since v3.0.
Definition test_runtime.h:14
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
ant::IDevice IDevice
Alias always bringing the latest version of ant::IDevice into scope.
Definition device_intf.h:194
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14
Device configuration structure.
Definition device_intf.h:91
const void * pvValue
Parameter value.
Definition device_intf.h:96
int szValueSize
Parameter size.
Definition device_intf.h:99
const char * strConfigName
Parameter name.
Definition device_intf.h:93
Device information.
Definition device_intf.h:35
char strIdentifier[128]
Device identifier.
Definition device_intf.h:37
uint32_t ui32Flags
Device flags as defined in tDeviceFlags.
Definition device_intf.h:40