Neonode zForce(TM) SDK

Asn1Protocol.h
Go to the documentation of this file.
1
8 #ifndef PROTOCOL_ASN1PROTOCOL_ASN1PROTOCOL_H
9 #define PROTOCOL_ASN1PROTOCOL_ASN1PROTOCOL_H 1
10
11 #ifndef ZFORCECOMMON_H
12 #error Please include "zForceCommon.h" before this file.
13 #endif // ZFORCECOMMON_H
14
16 typedef enum Asn1InitializationStatus Asn1InitializationStatus;
18 enum Asn1InitializationStatus
19 {
20 Asn1Uninitialized = 0,
21 Asn1Initialized
22 };
23
25 typedef struct Asn1Protocol Asn1Protocol;
29 struct Asn1Protocol
30 {
36 Protocol * Base;
37
42 Connection * Connection;
43
49 uint64_t ResponseSerialNumber;
50
56 uint64_t NotificationSerialNumber;
57
62 void ( * Destructor) (Protocol * self);
63
68 void ( * DestroyPrivateDeviceData) (Protocol * self, void * privateDeviceData);
69
74 zForce * zForce;
75
89 bool ( * Connect) (Protocol * self);
90
104 bool ( * Disconnect) (Protocol * self);
105
120 bool ( * DecodeDataFrame) (Protocol * self, DataFrame * dataFrame);
121 #if 0
122 // When this is implemented, or a placeholder is placed, it will be an ABI-breaking change, but only
123 // for programs implementing their own protocol.
124 // So maybe better that, when we actually do other ABI-breaking changes, we implement this,
125 // even if it always returns an error, as opposed to not existing.
144 DataFrame * ( * CreateDeviceCountRequest) (Protocol * self, Device * device, MessageAction action,
145 uint32_t totalNumberOfDevices, bool HasTotalNumberOfDevices,
146 uint32_t coreDevices, bool HasCoreDevices,
147 uint32_t airDevices, bool HasAirDevices,
148 uint32_t plusDevices, bool HasPlusDevices,
149 uint32_t lightingDevices, bool HasLightingDevices);
150 #endif // 0
175 DataFrame * ( * CreateResolutionRequest) (Protocol * self, Device * device, MessageAction action,
176 uint32_t x, bool hasX,
177 uint32_t y, bool hasY,
178 uint32_t z, bool hasZ);
179
202 DataFrame * ( * CreateTouchActiveAreaRequest) (Protocol * self, Device * device, MessageAction action,
203 uint32_t lowerBoundX, uint32_t upperBoundX, bool xIsValid,
204 uint32_t lowerBoundY, uint32_t upperBoundY, bool yIsValid);
205
226 DataFrame * ( * CreateReverseTouchActiveAreaRequest) (Protocol * self, Device * device, MessageAction action,
227 bool xIsReversed, bool yIsReversed);
228
248 DataFrame * ( * CreateFlipXYRequest) (Protocol * self, Device * device, MessageAction action, bool axesAreFlipped);
249
268 DataFrame * ( * CreateReflectiveEdgeFilterRequest) (Protocol * self, Device * device, MessageAction action,
269 bool isFilterOn);
270
290 DataFrame * ( * CreateMergeTouchesRequest) (Protocol * self, Device * device, MessageAction action,
291 bool areTouchesMerged);
292
311 DataFrame * ( * CreateDetectionModeRequest) (Protocol * self, Device * device, MessageAction action);
312
333 DataFrame * ( * CreateMcuUniqueIdentifierRequest) (Protocol * self, Device * device, MessageAction action,
334 uint8_t * identifier, uint32_t bufferSize);
335
357 DataFrame * ( * CreateEnableRequest) (Protocol * self, Device * device, MessageAction action,
358 bool continuousMode, uint32_t numberOfMessages);
359
380 DataFrame * ( * CreateOperationModesRequest) (Protocol * self,
381 Device * device,
382 MessageAction action,
383 OperationModes modeMask,
384 OperationModes modeValues);
385
404 DataFrame * ( * CreateDisableRequest) (Protocol * self, Device * device, MessageAction action);
405
425 DataFrame * ( * CreateFingerFrequencyRequest) (Protocol * self, Device * device, MessageAction action,
426 uint32_t frequency);
427
447 DataFrame * ( * CreateIdleFrequencyRequest) (Protocol * self, Device * device, MessageAction action,
448 uint32_t frequency);
449
472 DataFrame * ( * CreateDetectedObjectSizeRestrictionRequest) (Protocol * self, Device * device, MessageAction action,
473 bool maximumSizeEnabled, uint32_t maximumSize,
474 bool minimumSizeEnabled, uint32_t minimumSize);
475
495 DataFrame * ( * CreateNumberOfTrackedObjectsRequest) (Protocol * self, Device * device, MessageAction action,
496 uint32_t numberOfTrackedObjects);
497
520 DataFrame * ( * CreateOffsetRequest) (Protocol * self, Device * device, MessageAction action,
521 uint32_t offsetX, bool offsetXIsValid,
522 uint32_t offsetY, bool offsetYIsValid);
523
546 DataFrame * ( * CreateHidDisplaySizeRequest) (Protocol * self, Device * device, MessageAction action,
547 uint32_t sizeX, bool sizeXIsValid,
548 uint32_t sizeY, bool sizeYIsValid);
549
573 DataFrame * ( * CreateTouchModeRequest) (Protocol * self, Device * device, MessageAction action,
574 TouchModes touchMode, bool touchModeIsValid,
575 uint32_t clickOnTouchTime, bool clickOnTouchTimeIsValid,
576 uint32_t clickOnTouchRadius, bool clickOnTouchRadiusIsValid);
577
600 DataFrame * ( * CreateFloatingProtectionRequest) (Protocol * self, Device * device, MessageAction action,
601 bool enabled, bool enabledIsValid,
602 uint32_t time, bool timeIsValid);
603
632 DataFrame * ( * CreateSnappingFilterRequest) (Protocol * self, Device * device, MessageAction action,
633 bool enabled, bool enabledIsValid,
634 uint32_t leftInner,
635 uint32_t leftOuter, bool leftIsValid,
636 uint32_t rightInner,
637 uint32_t rightOuter, bool rightIsValid,
638 uint32_t topInner,
639 uint32_t topOuter, bool topIsValid,
640 uint32_t bottomInner,
641 uint32_t bottomOuter, bool bottomIsValid);
642
667 DataFrame * ( * CreateDoubleClickPreventionRequest) (Protocol * self, Device * device,
668 MessageAction action,
669 bool enabled,
670 bool enabledIsValid,
671 uint32_t doubleClickPreventionTime,
672 bool doubleClickPreventionTimeIsValid,
673 uint32_t doubleClickPreventionRadius,
674 bool doubleClickPreventionRadiusIsValid);
675
676 Asn1InitializationStatus InitializationStatus;
677 void * Private;
678 };
679
680 // Exported Functions (prefixed with module name and underscore)
681
682 #ifdef __cplusplus
683 extern "C"
684 {
685 #endif // __cplusplus
686
699 DLLINTERNAL bool Asn1Protocol_Initialize (void);
700
701 #ifdef __cplusplus
702 }
703 #endif // __cplusplus
704
705 #endif // PROTOCOL_ASN1PROTOCOL_ASN1PROTOCOL_H
Asn1InitializationStatus
Asn1InitializationStatus
Enum describing if initialization messages has been sent and received.
Definition: Asn1Protocol.h:19
Asn1Uninitialized
@ Asn1Uninitialized
Initialization sequence not completed.
Definition: Asn1Protocol.h:20
Asn1Initialized
@ Asn1Initialized
Initialization sequence completed.
Definition: Asn1Protocol.h:21
Asn1Protocol_Initialize
DLLINTERNAL bool Asn1Protocol_Initialize(void)
Adds the ASN.1 Protocol to the ProtocolTable.
Asn1Protocol
This structure represents the ASN.1 protocol class.
Definition: Asn1Protocol.h:30
Asn1Protocol::NotificationSerialNumber
uint64_t NotificationSerialNumber
Definition: Asn1Protocol.h:56
Asn1Protocol::DestroyPrivateDeviceData
void(* DestroyPrivateDeviceData)(Protocol *self, void *privateDeviceData)
Definition: Asn1Protocol.h:68
Asn1Protocol::ResponseSerialNumber
uint64_t ResponseSerialNumber
Definition: Asn1Protocol.h:49
Asn1Protocol::Connection
Connection * Connection
Definition: Asn1Protocol.h:42
Asn1Protocol::zForce
zForce * zForce
Definition: Asn1Protocol.h:74
Asn1Protocol::Connect
bool(* Connect)(Protocol *self)
Perform protocol specific processing upon connection.
Definition: Asn1Protocol.h:89
Asn1Protocol::Base
Protocol * Base
Definition: Asn1Protocol.h:36
Asn1Protocol::Destructor
void(* Destructor)(Protocol *self)
Definition: Asn1Protocol.h:62
Asn1Protocol::InitializationStatus
Asn1InitializationStatus InitializationStatus
Initialization status.
Definition: Asn1Protocol.h:676
Asn1Protocol::Private
void * Private
Private members.
Definition: Asn1Protocol.h:677
Asn1Protocol::DecodeDataFrame
bool(* DecodeDataFrame)(Protocol *self, DataFrame *dataFrame)
Give a data frame to Protocol for processing.
Definition: Asn1Protocol.h:120
Asn1Protocol::Disconnect
bool(* Disconnect)(Protocol *self)
Perform protocol specific processing upon disconnection.
Definition: Asn1Protocol.h:104
Connection
The main Connection struct.
Definition: Connection.h:66
DataFrame
Struct containing the DataFrame information.
Definition: DataFrame.h:25
Device
Device base class.
Definition: Device.h:26
Protocol
This structure represents the base class of all protocol definitions.
Definition: Protocol.h:28
zForce
Main struct.
Definition: zForce.h:29
TouchModes
TouchModes
Enum describing what touch mode a device can be in.
Definition: zForceTypes.h:191
MessageAction
MessageAction
Enum describing the action of a message.
Definition: zForceTypes.h:146
OperationModes
OperationModes
Enum describing the OperationModes that a sensor can operate in.
Definition: zForceTypes.h:155