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
 
uint64_t ResponseSerialNumber
 
uint64_t NotificationSerialNumber
 
void(* Destructor )(Protocol *self)
 The destructor for this class.
 
void(* DestroyPrivateDeviceData )(Protocol *self, void *privateDeviceData)
 
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 lowerBoundaryX, uint32_t upperBoundaryX, bool xIsValid, bool xIsReversed, uint32_t lowerBoundaryY, uint32_t upperBoundaryY, bool yIsValid, bool yIsReversed)
 Create a TouchActiveArea 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...
 

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

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

Perform protocol specific processing upon connection.

Parameters
selfPointer to the struct itself.
Returns
true upon success. Otherwise false which indicates failure and the errno variable should be inspected for the reason why.
Connection* Protocol::Connection

Each Protocol is linked to one connection.

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

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.
DataFrame*( * Protocol::CreateDisableRequest) (Protocol *self, Device *device, MessageAction action)

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.
DataFrame*( * Protocol::CreateEnableRequest) (Protocol *self, Device *device, MessageAction action, bool continuousMode, uint32_t numberOfMessages)

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.
DataFrame*( * Protocol::CreateFingerFrequencyRequest) (Protocol *self, Device *device, MessageAction action, uint32_t frequency)

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.
DataFrame*( * Protocol::CreateIdleFrequencyRequest) (Protocol *self, Device *device, MessageAction action, uint32_t frequency)

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.
DataFrame*( * Protocol::CreateNumberOfTrackedObjectsRequest) (Protocol *self, Device *device, MessageAction action, uint32_t numberOfTrackedObjects)

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.
DataFrame*( * Protocol::CreateOperationModesRequest) (Protocol *self, Device *device, MessageAction action, OperationModes modeMask, OperationModes modeValues)

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.
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.

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.
DataFrame*( * Protocol::CreateTouchActiveAreaRequest) (Protocol *self, Device *device, MessageAction action, uint32_t lowerBoundaryX, uint32_t upperBoundaryX, bool xIsValid, bool xIsReversed, uint32_t lowerBoundaryY, uint32_t upperBoundaryY, bool yIsValid, bool yIsReversed)

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.
lowerBoundaryXX axis value of lower boundary.
lowerBoundaryYY axis value of lower boundary.
upperBoundaryXX axis value of upper boundary.
upperBoundaryYY axis value of upper boundary.
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.
bool( * Protocol::DecodeDataFrame) (Protocol *self, DataFrame *dataFrame)

Give a data frame to Protocol for processing.

Parameters
selfPointer to the struct itself.
dataFrameDataFrame pointer.
Returns
true if the data frame has been decoded. Otherwise false which indicates failure and the errno variable should be inspected for the reason why.
void( * Protocol::DestroyPrivateDeviceData) (Protocol *self, void *privateDeviceData)

Protocol Specific method to destroy any potential Protocol Specific Data stored in a Device;

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

Perform protocol specific processing upon disconnection.

Parameters
selfPointer to the struct itself.
Returns
true upon success. Otherwise false which indicates failure and the errno variable should be inspected for the reason why.
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.

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: