Neonode zForce(TM) SDK
Public Attributes | List of all members
Protocol Struct Reference

This structure represents the base class of all protocol definitions. More...

#include <Protocol.h>

Collaboration diagram for Protocol:
Collaboration graph
[legend]

Public Attributes

ProtocolBase
 The immediate base class of this Protocol class.
 
ConnectionConnection
 Each Protocol is linked to one connection.
 
uint64_t ResponseSerialNumber
 
uint64_t NotificationSerialNumber
 
void(* Destructor )(Protocol *self)
 The destructor for this class.
 
void(* DestroyPrivateDeviceData )(Protocol *self, void *privateDeviceData)
 Protocol Specific method to destroy any potential Protocol Specific Data stored in a Device;.
 
zForcezForce
 A pointer to the global zForce instance.
 
bool(* Connect )(Protocol *self)
 Perform protocol specific processing upon connection. More...
 
bool(* Disconnect )(Protocol *self)
 Perform protocol specific processing upon disconnection. More...
 
bool(* DecodeDataFrame )(Protocol *self, DataFrame *dataFrame)
 Give a data frame to Protocol for processing. More...
 
DataFrame *(* CreateResolutionRequest )(Protocol *self, Device *device, MessageAction action, uint32_t x, bool hasX, uint32_t y, bool hasY, uint32_t z, bool hasZ)
 Create a Resolution request. More...
 
DataFrame *(* CreateTouchActiveAreaRequest )(Protocol *self, Device *device, MessageAction action, uint32_t lowerBoundX, uint32_t upperBoundX, bool xIsValid, uint32_t lowerBoundY, uint32_t upperBoundY, bool yIsValid)
 Create a TouchActiveArea request. More...
 
DataFrame *(* CreateReverseTouchActiveAreaRequest )(Protocol *self, Device *device, MessageAction action, bool xIsReversed, bool yIsReversed)
 Create a ReverseTouchActiveArea request. More...
 
DataFrame *(* CreateFlipXYRequest )(Protocol *self, Device *device, MessageAction action, bool axesAreFlipped)
 Create a FlipXY request. More...
 
DataFrame *(* CreateReflectiveEdgeFilterRequest )(Protocol *self, Device *device, MessageAction action, bool isFilterOn)
 Create a ReflectiveEdgeFilter request. More...
 
DataFrame *(* CreateMergeTouchesRequest )(Protocol *self, Device *device, MessageAction action, bool areTouchesMerged)
 Create a MergeTouches request. More...
 
DataFrame *(* CreateDetectionModeRequest )(Protocol *self, Device *device, MessageAction action)
 Create a DetectionMode request. More...
 
DataFrame *(* CreateMcuUniqueIdentifierRequest )(Protocol *self, Device *device, MessageAction action, uint8_t *identifier, uint32_t bufferSize)
 Create a McuUniqueIdentifier request. More...
 
DataFrame *(* CreateEnableRequest )(Protocol *self, Device *device, MessageAction action, bool continuousMode, uint32_t numberOfMessages)
 Create an Enable request. More...
 
DataFrame *(* CreateOperationModesRequest )(Protocol *self, Device *device, MessageAction action, OperationModes modeMask, OperationModes modeValues)
 Create an OperationModes request. More...
 
DataFrame *(* CreateDisableRequest )(Protocol *self, Device *device, MessageAction action)
 Create a Disable request. More...
 
DataFrame *(* CreateFingerFrequencyRequest )(Protocol *self, Device *device, MessageAction action, uint32_t frequency)
 Create a FingerFrequency request. More...
 
DataFrame *(* CreateIdleFrequencyRequest )(Protocol *self, Device *device, MessageAction action, uint32_t frequency)
 Create an IdleFrequency request. More...
 
DataFrame *(* CreateDetectedObjectSizeRestrictionRequest )(Protocol *self, Device *device, MessageAction action, bool maximumSizeEnabled, uint32_t maximumSize, bool minimumSizeEnabled, uint32_t minimumSize)
 Create a DetectedObjectSizeRestriction request. More...
 
DataFrame *(* CreateNumberOfTrackedObjectsRequest )(Protocol *self, Device *device, MessageAction action, uint32_t numberOfTrackedObjects)
 Create a NumberOfTrackedObjects request. More...
 
DataFrame *(* CreateOffsetRequest )(Protocol *self, Device *device, MessageAction action, uint32_t offsetX, bool offsetXIsValid, uint32_t offsetY, bool offsetYIsValid)
 Create an Offset request. More...
 
DataFrame *(* CreateHidDisplaySizeRequest )(Protocol *self, Device *device, MessageAction action, uint32_t sizeX, bool sizeXIsValid, uint32_t sizeY, bool sizeYIsValid)
 Create a HidDisplaySize request. More...
 
DataFrame *(* CreateTouchModeRequest )(Protocol *self, Device *device, MessageAction action, TouchModes touchMode, bool touchModeIsValid, uint32_t clickOnTouchTime, bool clickOnTouchTimeIsValid, uint32_t clickOnTouchRadius, bool clickOnTouchRadiusIsValid)
 Create a TouchMode request. More...
 
DataFrame *(* CreateFloatingProtectionRequest )(Protocol *self, Device *device, MessageAction action, bool enabled, bool enabledIsValid, uint32_t time, bool timeIsValid)
 Create a FloatingProtection request. More...
 
DataFrame *(* CreateSnappingFilterRequest )(Protocol *self, Device *device, MessageAction action, bool enabled, bool enabledIsValid, uint32_t leftInner, uint32_t leftOuter, bool leftIsValid, uint32_t rightInner, uint32_t rightOuter, bool rightIsValid, uint32_t topInner, uint32_t topOuter, bool topIsValid, uint32_t bottomInner, uint32_t bottomOuter, bool bottomIsValid)
 Create a Snapping Filter request. More...
 
DataFrame *(* CreateDoubleClickPreventionRequest )(Protocol *self, Device *device, MessageAction action, bool enabled, bool enabledIsValid, uint32_t doubleClickPreventionTime, bool doubleClickPreventionTimeIsValid, uint32_t doubleClickPreventionRadius, bool doubleClickPreventionRadiusIsValid)
 Create a DoubleClickPrevention request. More...
 

Detailed Description

This structure represents the base class of all protocol definitions.

This structure represents the base class of all protocol definitions. The data and functions contained within the structure's fields are the essentials which are common to all such definitions.

Member Data Documentation

◆ Connect

bool( * Protocol::Connect) (Protocol *self)

Perform protocol specific processing upon connection.

Perform protocol specific processing upon connection.

On error, errno is set. Errno values can differ between protocols.

Parameters
selfPointer to the struct itself.
Returns
true upon success. On failure, inspect errno for the error code.

◆ CreateDetectedObjectSizeRestrictionRequest

DataFrame*( * Protocol::CreateDetectedObjectSizeRestrictionRequest) (Protocol *self, Device *device, MessageAction action, bool maximumSizeEnabled, uint32_t maximumSize, bool minimumSizeEnabled, uint32_t minimumSize)

Create a DetectedObjectSizeRestriction request.

Create a DetectedObjectSizeRestriction request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
maximumSizeEnabledMaximum size enabling flag.
maximumSizeThe maximum object size for detection.
minimumSizeEnabledMinimum size enabling flag.
minimumSizeThe minimum object size for detection.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateDetectionModeRequest

DataFrame*( * Protocol::CreateDetectionModeRequest) (Protocol *self, Device *device, MessageAction action)

Create a DetectionMode request.

Create a DetectionMode request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateDisableRequest

DataFrame*( * Protocol::CreateDisableRequest) (Protocol *self, Device *device, MessageAction action)

Create a Disable request.

Create a Disable request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateDoubleClickPreventionRequest

DataFrame*( * Protocol::CreateDoubleClickPreventionRequest) (Protocol *self, Device *device, MessageAction action, bool enabled, bool enabledIsValid, uint32_t doubleClickPreventionTime, bool doubleClickPreventionTimeIsValid, uint32_t doubleClickPreventionRadius, bool doubleClickPreventionRadiusIsValid)

Create a DoubleClickPrevention request.

Create a DoubleClickPrevention request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
enabledEnable or disable Double-Click Prevention.
enabledIsValidEnable is valid, i.e. you want to set it.
doubleClickPreventionTimeDouble-Click Prevention Time in ms.
doubleClickPreventionTimeIsValidDouble-Click Prevention Time is valid, i.e. you want to set Double-Click Prevention Time.
doubleClickPreventionRadiusDouble-Click Prevention Radius in 1/10th of mm.
doubleClickPreventionTimeIsValidDouble-Click Prevention Radius is valid, i.e. you want to set Double-Click Prevention Radius.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateEnableRequest

DataFrame*( * Protocol::CreateEnableRequest) (Protocol *self, Device *device, MessageAction action, bool continuousMode, uint32_t numberOfMessages)

Create an Enable request.

Create an Enable request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
continuousModeSet to true for continuous mode.
numberOfMessagesWhen in non-continuous mode, specifies how many Messages to receive before the Device disables itself. May not be 0 when continuousMode == false.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateFingerFrequencyRequest

DataFrame*( * Protocol::CreateFingerFrequencyRequest) (Protocol *self, Device *device, MessageAction action, uint32_t frequency)

Create a FingerFrequency request.

Create a FingerFrequency request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
frequencyThe value to set if this is a set action.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateFlipXYRequest

DataFrame*( * Protocol::CreateFlipXYRequest) (Protocol *self, Device *device, MessageAction action, bool axesAreFlipped)

Create a FlipXY request.

Create a FlipXY request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
flipthe X and Y axes.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateFloatingProtectionRequest

DataFrame*( * Protocol::CreateFloatingProtectionRequest) (Protocol *self, Device *device, MessageAction action, bool enabled, bool enabledIsValid, uint32_t time, bool timeIsValid)

Create a FloatingProtection request.

Create a FloatingProtection request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
enabledEnable or disable Floating Protection.
enabledIsValidEnable is valid, i.e. you want to set it.
timeFloating Protection Time in ms..
timeIsValidThe Time is valid, i.e. you want to set it.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateHidDisplaySizeRequest

DataFrame*( * Protocol::CreateHidDisplaySizeRequest) (Protocol *self, Device *device, MessageAction action, uint32_t sizeX, bool sizeXIsValid, uint32_t sizeY, bool sizeYIsValid)

Create a HidDisplaySize request.

Create a HidDisplaySize request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
sizeXThe X Size.
sizeXIsValidThe X Size is valid, i.e. you want to set it.
sizeYThe Y Size.
sizeYIsValidThe Y Size is valid, i.e. you want to set it.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateIdleFrequencyRequest

DataFrame*( * Protocol::CreateIdleFrequencyRequest) (Protocol *self, Device *device, MessageAction action, uint32_t frequency)

Create an IdleFrequency request.

Create an IdleFrequency request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
frequencyThe value to set if this is a set action.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateMcuUniqueIdentifierRequest

DataFrame*( * Protocol::CreateMcuUniqueIdentifierRequest) (Protocol *self, Device *device, MessageAction action, uint8_t *identifier, uint32_t bufferSize)

Create a McuUniqueIdentifier request.

Create a McuUniqueIdentifier request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
identifierPointer to the Identifier array to set.
bufferSizeBuffer size.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateMergeTouchesRequest

DataFrame*( * Protocol::CreateMergeTouchesRequest) (Protocol *self, Device *device, MessageAction action, bool areTouchesMerged)

Create a MergeTouches request.

Create a MergeTouches request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
areTouchesMergedtrue if the reported touches are merged, otherwise false.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateNumberOfTrackedObjectsRequest

DataFrame*( * Protocol::CreateNumberOfTrackedObjectsRequest) (Protocol *self, Device *device, MessageAction action, uint32_t numberOfTrackedObjects)

Create a NumberOfTrackedObjects request.

Create a NumberOfTrackedObjects request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
numberOfTrackedObjectsTracked object count.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateOffsetRequest

DataFrame*( * Protocol::CreateOffsetRequest) (Protocol *self, Device *device, MessageAction action, uint32_t offsetX, bool offsetXIsValid, uint32_t offsetY, bool offsetYIsValid)

Create an Offset request.

Create an Offset request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
offsetXThe X Offset.
offsetXIsValidThe X Offset is valid, i.e. you want to set it.
offsetYThe Y Offset.
offsetYIsValidThe Y Offset is valid, i.e. you want to set it.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateOperationModesRequest

DataFrame*( * Protocol::CreateOperationModesRequest) (Protocol *self, Device *device, MessageAction action, OperationModes modeMask, OperationModes modeValues)

Create an OperationModes request.

Create an OperationModes request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
modeMaskIndication of which modes have values in this call.
modeValuesOptional values for modes. See the modeMask argument.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateReflectiveEdgeFilterRequest

DataFrame*( * Protocol::CreateReflectiveEdgeFilterRequest) (Protocol *self, Device *device, MessageAction action, bool isFilterOn)

Create a ReflectiveEdgeFilter request.

Create a ReflectiveEdgeFilter request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
isFilterOntrue if the filter is on, otherwise false.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateResolutionRequest

DataFrame*( * Protocol::CreateResolutionRequest) (Protocol *self, Device *device, MessageAction action, uint32_t x, bool hasX, uint32_t y, bool hasY, uint32_t z, bool hasZ)

Create a Resolution request.

Create a Resolution request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
xX axis value if this is a set action.
hasXX axis value present flag if this is a set action.
yY axis value if this is a set action.
hasYY axis value present flag if this is a set action.
zZ axis value if this is a set action.
hasZZ axis value present flag if this is a set action.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateReverseTouchActiveAreaRequest

DataFrame*( * Protocol::CreateReverseTouchActiveAreaRequest) (Protocol *self, Device *device, MessageAction action, bool xIsReversed, bool yIsReversed)

Create a ReverseTouchActiveArea request.

Create a ReverseTouchActiveArea request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
reverseXX axis direction reversal flag.
reverseYY axis direction reversal flag.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateSnappingFilterRequest

DataFrame*( * Protocol::CreateSnappingFilterRequest) (Protocol *self, Device *device, MessageAction action, bool enabled, bool enabledIsValid, uint32_t leftInner, uint32_t leftOuter, bool leftIsValid, uint32_t rightInner, uint32_t rightOuter, bool rightIsValid, uint32_t topInner, uint32_t topOuter, bool topIsValid, uint32_t bottomInner, uint32_t bottomOuter, bool bottomIsValid)

Create a Snapping Filter request.

Create a FloatingProtection request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
enabledSnapping Filter is enabled.
enabledIsValidEnable is valid, i.e. you want to Enable/Disable Snapping Filter.
leftInnerDistance from edge to the inner snapping edge, left side of Touch Active Area.
leftOuterDistance from edge to the outer snapping edge, left side of Touch Active Area.
leftIsValidLeft is valid, i.e. you want to update leftInner & leftOuter in Snapping Filter.
rightInnerDistance from edge to the inner snapping edge, right side of Touch Active Area.
rightOuterDistance from edge to the outer snapping edge, right side of Touch Active Area.
rightIsValidRight is valid, i.e. you want to update rightInner & rightOuter in Snapping Filter.
topInnerDistance from edge to the inner snapping edge, top side of Touch Active Area.
topOuterDistance from edge to the outer snapping edge, top side of Touch Active Area.
topIsValidTop is valid, i.e. you want to update topInner & topOuter in Snapping Filter.
bottomInnerDistance from edge to the inner snapping edge, bottom side of Touch Active Area.
bottomOuterDistance from edge to the outer snapping edge, bottom side of Touch Active Area.
bottomIsValidBottom is valid, i.e. you want to update bottomInner & bottomOuter in Snapping Filter.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateTouchActiveAreaRequest

DataFrame*( * Protocol::CreateTouchActiveAreaRequest) (Protocol *self, Device *device, MessageAction action, uint32_t lowerBoundX, uint32_t upperBoundX, bool xIsValid, uint32_t lowerBoundY, uint32_t upperBoundY, bool yIsValid)

Create a TouchActiveArea request.

Create a TouchActiveArea request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
lowerBoundXX axis value of lower bound.
lowerBoundYY axis value of lower bound.
upperBoundXX axis value of upper bound.
upperBoundYY axis value of upper bound.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ CreateTouchModeRequest

DataFrame*( * Protocol::CreateTouchModeRequest) (Protocol *self, Device *device, MessageAction action, TouchModes touchMode, bool touchModeIsValid, uint32_t clickOnTouchTime, bool clickOnTouchTimeIsValid, uint32_t clickOnTouchRadius, bool clickOnTouchRadiusIsValid)

Create a TouchMode request.

Create a TouchMode request.

On error, errno is set.

Parameters
selfPointer to the struct itself.
devicePointer to the Device from which the request originated.
actionIndication of what type of action this message refers to.
touchModeWhich Touch Mode the device is in.
clickOnTouchTimeThe Click on Touch Time.
clickOnTouchTimeIsValidThe Click On Touch Time is valid, i.e. you want to set it.
clickOnTouchRadiusThe Click On Touch Radius.
clickOnTouchRadiusIsValidThe Click on Touch Radius is valid, i.e. you want to set it.
Returns
Pointer to data frame if it it worked, NULL if it didn't. See errno.

◆ DecodeDataFrame

bool( * Protocol::DecodeDataFrame) (Protocol *self, DataFrame *dataFrame)

Give a data frame to Protocol for processing.

Give a data frame to Protocol for processing.

On error, errno is set. Errno values can differ between protocols.

Parameters
selfPointer to the struct itself.
dataFrameDataFrame pointer.
Returns
true if the data frame has been decoded. On failure, inspect errno for the error code.

◆ Disconnect

bool( * Protocol::Disconnect) (Protocol *self)

Perform protocol specific processing upon disconnection.

Perform protocol specific processing upon disconnection.

On error, errno is set. Errno values can differ between protocols.

Parameters
selfPointer to the struct itself.
Returns
true upon success. On failure, inspect errno for the error code.

◆ NotificationSerialNumber

uint64_t Protocol::NotificationSerialNumber

A counter used for giving notifications a unique serial number. Serial numbers start at 1 and strictly increase with each notification.

◆ ResponseSerialNumber

uint64_t Protocol::ResponseSerialNumber

A counter used for giving responses a unique serial number. Serial numbers start at 1 and strictly increase with each response.


The documentation for this struct was generated from the following file: