Neonode zForce(TM) SDK

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

Protocol.h
Go to the documentation of this file.
1
12 #if !defined(PROTOCOL_PROTOCOL_H) && !defined(CONTAINS_PROTOCOL)
13
14 #ifndef ZFORCECOMMON_H
15 #error Please include "zForceCommon.h" before this file.
16 #endif // ZFORCECOMMON_H
17
21 typedef struct Protocol Protocol;
30 struct Protocol
31 {
32 #endif // !defined(PROTOCOL_PROTOCOL_H) && !defined(CONTAINS_PROTOCOL)
33 #if !defined(PROTOCOL_PROTOCOL_H) || defined(CONTAINS_PROTOCOL)
34 Protocol * Base;
35 Connection * Connection;
36 uint64_t ResponseSerialNumber;
39
42 uint64_t NotificationSerialNumber;
43
45 void ( * Destructor)(Protocol * self);
46
49 void ( * DestroyPrivateDeviceData)(Protocol * self,
50 void * privateDeviceData);
51
52 zForce * zForce;
53
63 bool ( * Connect)(Protocol * self);
64
74 bool ( * Disconnect)(Protocol * self);
75
86 bool ( * DecodeDataFrame) (Protocol * self, DataFrame * dataFrame);
87 #if 0
88
103 DataFrame * ( * CreateDeviceCountRequest) (Protocol * self,
104 Device * device,
105 MessageAction action,
106 uint32_t totalNumberOfDevices,
107 bool HasTotalNumberOfDevices,
108 uint32_t coreDevices,
109 bool HasCoreDevices,
110 uint32_t airDevices,
111 bool HasAirDevices,
112 uint32_t plusDevices,
113 bool HasPlusDevices,
114 uint32_t lightingDevices,
115 bool HasLightingDevices);
116 #endif // 0
117
138 DataFrame * ( * CreateResolutionRequest) (Protocol * self,
139 Device * device,
140 MessageAction action,
141 uint32_t x,
142 bool hasX,
143 uint32_t y,
144 bool hasY,
145 uint32_t z,
146 bool hasZ);
166 DataFrame * ( * CreateTouchActiveAreaRequest) (Protocol * self,
167 Device * device,
168 MessageAction action,
169 uint32_t lowerBoundaryX,
170 uint32_t upperBoundaryX,
171 bool xIsValid,
172 uint32_t lowerBoundaryY,
173 uint32_t upperBoundaryY,
174 bool yIsValid);
175
193 DataFrame * ( * CreateReverseTouchActiveAreaRequest) (Protocol * self,
194 Device * device,
195 MessageAction action,
196 bool xIsReversed,
197 bool yIsReversed);
198
215 DataFrame * ( * CreateFlipXYRequest) (Protocol * self, Device * device, MessageAction action, bool axesAreFlipped);
216
232 DataFrame * ( * CreateReflectiveEdgeFilterRequest) (Protocol * self, Device * device, MessageAction action,
233 bool isFilterOn);
234
251 DataFrame * ( * CreateMergeTouchesRequest) (Protocol * self, Device * device, MessageAction action,
252 bool areTouchesMerged);
253
269 DataFrame * ( * CreateDetectionModeRequest) (Protocol * self, Device * device, MessageAction action);
270
288 DataFrame * ( * CreateMcuUniqueIdentifierRequest) (Protocol * self, Device * device, MessageAction action,
289 uint8_t * identifier, uint32_t bufferSize);
290
311 DataFrame * ( * CreateEnableRequest) (Protocol * self,
312 Device * device,
313 MessageAction action,
314 bool continuousMode,
315 uint32_t numberOfMessages);
333 DataFrame * ( * CreateOperationModesRequest) (Protocol * self,
334 Device * device,
335 MessageAction action,
336 OperationModes modeMask,
337 OperationModes modeValues);
353 DataFrame * ( * CreateDisableRequest) (Protocol * self,
354 Device * device,
355 MessageAction action);
372 DataFrame * ( * CreateFingerFrequencyRequest) (Protocol * self,
373 Device * device,
374 MessageAction action,
375 uint32_t frequency);
392 DataFrame * ( * CreateIdleFrequencyRequest) (Protocol * self,
393 Device * device,
394 MessageAction action,
395 uint32_t frequency);
415 DataFrame * ( * CreateDetectedObjectSizeRestrictionRequest)
416 (Protocol * self,
417 Device * device,
418 MessageAction action,
419 bool maximumSizeEnabled,
420 uint32_t maximumSize,
421 bool minimumSizeEnabled,
422 uint32_t minimumSize);
423
440 DataFrame * ( * CreateNumberOfTrackedObjectsRequest)
441 (Protocol * self,
442 Device * device,
443 MessageAction action,
444 uint32_t numberOfTrackedObjects);
445
465 DataFrame * ( * CreateOffsetRequest) (Protocol * self, Device * device, MessageAction action,
466 uint32_t offsetX, bool offsetXIsValid,
467 uint32_t offsetY, bool offsetYIsValid);
468
488 DataFrame * ( * CreateHidDisplaySizeRequest) (Protocol * self, Device * device, MessageAction action,
489 uint32_t sizeX, bool sizeXIsValid,
490 uint32_t sizeY, bool sizeYIsValid);
491
492 #endif // !defined(PROTOCOL_PROTOCOL_H) || defined(CONTAINS_PROTOCOL)
493 #if !defined(PROTOCOL_PROTOCOL_H) && !defined(CONTAINS_PROTOCOL)
494 };
495
496 // Exported Functions
497
498 #ifdef __cplusplus
499 extern "C"
500 {
501 #endif // __cplusplus
502
535 DLLEXTERNAL Protocol * Protocol_GetInstance (Connection * connection,
536 char * protocolString,
537 char * dataFrameType);
538
560 DLLEXTERNAL bool Protocol_AddProtocol (ProtocolEntry * protocolEntry);
561
572 DLLINTERNAL bool Protocol_Initialize (void);
573
582 DLLINTERNAL void Protocol_Uninitialize (void);
583
584 #ifdef __cplusplus
585 }
586 #endif // __cplusplus
587
588 #define PROTOCOL_PROTOCOL_H
589 #endif // !defined(PROTOCOL_PROTOCOL_H) && !defined(CONTAINS_PROTOCOL)
590
Protocol::Disconnect
bool(* Disconnect)(Protocol *self)
Perform protocol specific processing upon disconnection.
Definition: Protocol.h:74
OperationModes
OperationModes
Enum describing the OperationModes that a sensor can operate in.
Definition: zForceTypes.h:143
Protocol_AddProtocol
DLLEXTERNAL bool Protocol_AddProtocol(ProtocolEntry *protocolEntry)
Add a new protocol to the list of those available.
Protocol::ResponseSerialNumber
uint64_t ResponseSerialNumber
Definition: Protocol.h:38
Protocol::DestroyPrivateDeviceData
void(* DestroyPrivateDeviceData)(Protocol *self, void *privateDeviceData)
Definition: Protocol.h:49
Protocol_Initialize
DLLINTERNAL bool Protocol_Initialize(void)
Initialize the Protocol module.
Connection
The main Connection struct.
Definition: Connection.h:64
Protocol::Base
Protocol * Base
The immediate base class of this Protocol class.
Definition: Protocol.h:34
Protocol::Connect
bool(* Connect)(Protocol *self)
Perform protocol specific processing upon connection.
Definition: Protocol.h:63
Protocol::Connection
Connection * Connection
Definition: Protocol.h:35
Protocol::Destructor
void(* Destructor)(Protocol *self)
The destructor for this class.
Definition: Protocol.h:45
Protocol_Uninitialize
DLLINTERNAL void Protocol_Uninitialize(void)
Unitialize the Protocol module.
DataFrame
Struct containing the DataFrame information.
Definition: DataFrame.h:26
Protocol
This structure represents the base class of all protocol definitions.
Definition: Protocol.h:30
Protocol::DecodeDataFrame
bool(* DecodeDataFrame)(Protocol *self, DataFrame *dataFrame)
Give a data frame to Protocol for processing.
Definition: Protocol.h:86
zForce
Main struct.
Definition: zForce.h:28
Protocol::zForce
zForce * zForce
A pointer to the global zForce instance.
Definition: Protocol.h:52
Device
Brief Device base class.
Definition: Device.h:23
ProtocolEntry
struct ProtocolEntry ProtocolEntry
Definition: zForceTypes.h:35
MessageAction
MessageAction
Enum describing the action of a message.
Definition: zForceTypes.h:134
Protocol::NotificationSerialNumber
uint64_t NotificationSerialNumber
Definition: Protocol.h:42
Protocol_GetInstance
DLLEXTERNAL Protocol * Protocol_GetInstance(Connection *connection, char *protocolString, char *dataFrameType)
This is the Protocol factory function.