Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DOCSDK and version 2.9

...

Function declarationInfo
Connection * Connection_New(char * connectionString, char * protocolString, char * dataFrameType )This call creates the binding between the Protocol and the Transport.
bool ( * Connect )(Connection * self)Connect to the unit using the previously specified Protocol and Transport done by Connection_New. This call asynchronously starts the connection process. The call exits immediately and if there is a direct connection problem, for example that the connection is already established, then the call exits with false and errno is set. If there is no immediate error, the call returns true but the connection cannot be considered established until the ConnectionQueue has returned with a message saying status Connected. If connection failed with a status of ConnectionFault, ErrorCode will be set. See documentation under Connection.
bool ( * Disconnect )(Connection * self)Disconnect the connection. This call is asynchronous and cannot be considered complete until the ConnectionQueue has reported status Disconnected.
void ( * Destructor )(Connection * self)Freeing up the memory allocated in Connection_New.
Device * ( * FindDevice )(Connection * self, DeviceType deviceType, uint32_t deviceIndex)Find a Device with a specified Type/Index combination. For Platform and Lighting devices, the Type/Index are searched for directly. For Core, Air Air (Touch Sensor Module), Core and Plus devices, the Type/Index are also searched for directly, but they can also be found using a meta Sensor device type. Sensor is not a real device type, and contains all functionality that is shared between all Sensor types (Air, Core, Air and Plus devices). Type = Sensor, Index = 0 is the first Sensor in the list, Type = Sensor, Index = 1 is the second Sensor. The "real" Device Index is not used for this search when searching for a Sensor.

...


Example of setting up a 
connect to a USB HID device connected on Linux device node using ASN.1 and HidPipeTransport where vid is vendor id and pid is product id. If the computer has multiple connected Neonode sensorsTouch Sensor Modules, the first one has index 0, the second has index 1, etc. The order is decided by the Operating System.

...

This is an example on FindDevice for both sensor device SensorDevice and platform devicePlatformDevice.

Code Block
languagecpp
themeConfluence
PlatformDevice * platformDevice = (PlatformDevice *)MyConnection->FindDevice (MyConnection, Platform, 0);
// Find the first Sensor type device (Core/Air/Plus).
SensorDevice * sensorDevice = (SensorDevice *)MyConnection->FindDevice (MyConnection, Sensor, 0);

...

The SensorDevice.h class holds most of the zForce commands in the zForce SDK that is currently available with any sensor device type (Core/Air/Plus). Each command has a Get which when sent to the device will retrieve the current state of that command from the device. The class also contains a set for each  commandcommand, that will set given values in the sensor device. A Set command will also return current status after the set command has executed, same as Get would.

...

Function declarationInfo
bool ( * GetEnable )( SensorDevice * self) Ask the Device if it is enabled. Also reports if the device is in continuous mode and number of messages left to receive
bool ( *  SetEnable )(SensorDevice * self, bool continuousMode, uint32_t numberOfMessages)Enable the device and set it to either continuous mode or a specified number of messages. Not all protocols handle non-continuous mode
bool ( *  GetDisable )(SensorDevice * self)Returns true if the device is disabled.
bool ( *  SetDisable )(SensorDevice * self)Disable the device. Messages will stop arriving as soon as the Device processes the request, but Messages already in progress will still arrive as normal.
bool ( *  GetOperationModes )(SensorDevice * self)Gets the current Operating Modes of the Device as two bitmasks.
bool ( *  SetOperationModes )(SensorDevice * self, OperationModes modeMask, OperationModes modeValues)Sets the current Operating Modes of the Device as two bitmasks. Setting the modeMask bit for a specific Mode to 1 changes it to become the corresponding bit in modeValues but setting the bit to 0 does not change it.
bool ( *  GetResolution )(SensorDevice * self)Gets the current Resolution of the Device.
bool ( *  SetResolution )(SensorDevice * self, uint32_t x, bool xIsValid, uint32_t y, bool yIsValid, uint32_t z, bool zIsValid)Sets the current Resolution of the Device.
bool ( *  GetTouchActiveArea )(SensorDevice * self)Gets the current Touch Active Area of the Device.
bool ( *  SetTouchActiveArea )(SensorDevice * self, uint32_t lowerBoundaryX, uint32_t upperBoundaryX, bool xIsValid, bool xIsReversed, uint32_t lowerBoundaryY, uint32_t upperBoundaryY, bool yIsValid, bool yIsReversed)Sets the current Touch Active Area of the Device.
bool ( *  GetDetectedObjectSizeRestriction )(SensorDevice * self)Gets the current Detected Object Size Restriction.
bool ( *  SetDetectedObjectSizeRestriction )(SensorDevice * self, uint32_t minimumSize, uint32_t maximumSize, bool minimumSizeIsValid, bool maximumSizeIsValid)Sets the current Detected Object Size Restriction of the device.
bool ( *  GetNumberOfTrackedObjects )(SensorDevice * self)Get the number of tracked objects.
bool ( *  SetNumberOfTrackedObjects )(SensorDevice * self, uint32_t numberOfTrackedObjects)Set the number of tracked objects.

Example

bool ( * GetFloatingProtection) (SensorDevice * self)Gets the state of Floating Protection.
bool ( * SetFloatingProtection) (SensorDevice * self, bool enabled, bool enabledIsValid, uint32_t time, bool timeIsValid)Sets Floating Protection.
bool ( * GetSnappingFilter) (SensorDevice * self)Gets the state of Snapping Filter.
bool ( * SetSnappingFilter) (SensorDevice * self, 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)Sets Snapping Filter.
bool ( * GetDoubleClickPrevention) (SensorDevice * self)Gets the state of Double-Click Prevention.
bool ( * SetDoubleClickPrevention) (SensorDevice * self, bool enabled, bool enabledIsValid, uint32_t doubleClickPreventionTime, bool doubleClickPreventionTimeIsValid, uint32_t doubleClickPreventionRadius, bool doubleClickPreventionRadiusIsValid)Sets Double-Click Prevention.

Example

Example of sending GetResolution command to Example of sending GetResolution command to sensor device following by receiving response and destroying message. One for GetResolution and one for SetEnable. 

...

Code Block
languagecpp
themeConfluence
bool result = platformDevice->GetFingerFrequency(platformDevice);
// Wait for the answer to arrive, timeout after 1 second.
Message * message = MyConnection->DeviceQueue->Dequeue (MyConnection->DeviceQueue,1000);
// Freeing up the memory allocated for the message.
message->Destructor (message);
 
result = platformDevice->SetFingerFrequency(platformDevice, 10);
// Wait for the answer to arrive, timeout after 1 second.
Message * message = MyConnection->DeviceQueue->Dequeue (MyConnection->DeviceQueue,1000);
// Freeing up the memory allocated for the message.
message->Destructor (message);
Panel
borderColordarkblue
bgColorlightgrey
titleRead More

Children Display
depth1
pageNeonode® zForce® SDK User's Guide