Page tree

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

...

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.

...