Neonode zForce(TM) SDK

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Members

Public Attributes | List of all members
HidPipeTransport Struct Reference

Struct containing the HidPipeTransport information. More...

`#include <HidPipeTransport.h>`

Collaboration diagram for HidPipeTransport:
[legend]

## Public Attributes
Transport * | Base
| Base pointer to the immediate base Transport class. The inheritance is nested so for example WinSerTransport inherits from SerTransport which inherits from Transport. If Base is a NULL pointer then it is the base Transport class itself.
Connection * | Connection
| Each Transport is linked to one Connection.
zForce * | zForce
| A pointer to the global zForce instance.
char | ConnectionString [TRANSPORTPROTOCOL_MaxOptionParameterLength+1]
| Connection string. This string contain the type of transport and the option parameters on the following form: type://port=portOption e.g "serial://port=/dev/ttyACM0".
volatile bool | Terminate
| A flag indicating if the Transport Read and Write threads should terminate (true) or not (false).
Queue * | WriteQueue
| A pointer to the Write queue used by EnqueueDataFrame.
bool | IsOpen
| A flag indicating if the Transport is open (true) or not (false).
bool | Opening
| Transport is in Opening phase.
zForceThread * | WriteThread
| Write Thread pointer.
zForceThread * | ReadThread
| Read Thread pointer.
volatile ReadWriteThreadStatus | WriteThreadStatus
| Thread is active.
volatile ReadWriteThreadStatus | ReadThreadStatus
| Thread is active.
bool(* | Open )(Transport *self)
| Open the generic Transport. More...
bool(* | Close )(Transport *self)
| Close the generic Transport. More...
DataFrame *(* | Read )(Transport *self)
| Function pointer to Transport's Read. More...
bool(* | Write )(Transport *self, DataFrame *payload)
| Function pointer to Transport's Write. More...
uint64_t(* | GetTimeOutValue )(Transport *self)
| Function pointer to Transport's GetTimeOutValue. More...
bool(* | EnqueueDataFrame )(Transport *self, DataFrame *dataFrame)
| Enqueue given dataframe. More...
void(* | Destructor )(Transport *self)
| Destructor frees all the resources that have been allocated. More...
void(* | TransportLost )(Transport *self)
| Signals the transport that it has been lost and acts accordingly. More...
bool | StopCommunication
| Boolean value that indicates that there is no longer any communication. Internal use only.
void * | Private
| Private members of HidPipeTransport.

## Detailed Description

Struct containing the HidPipeTransport information.

HidPipeTransport contains the Transport base, a pointer to the base Transport class.

## Member Data Documentation

bool( * HidPipeTransport::Close) (Transport *self)

Close the generic Transport.

On failure, errno is set.

- ENOTOPENED - Transport is not open.
- ECLOSEFAILED - Closing file descriptor failed.
- EBADTHREAD - Bad thread pointer, problem with exiting thread.

Parameters

  self | Pointer to the struct itself.

Returns
  True if successful, false if not, and errno set accordingly.

void( * HidPipeTransport::Destructor) (Transport *self)

Destructor frees all the resources that have been allocated.

Parameters

  self | Pointer to the struct itself.

bool( * HidPipeTransport::EnqueueDataFrame) (Transport *self, DataFrame *dataFrame)

Enqueue given dataframe.

On failure, errno is set.

- EENQUEUEFAILED - Generic enqueue error.
- EOUTOFMEMORY - Memory allocation failed.
- EBADQUEUE - Bad Queue pointer.
- ENOTOPENED - Transport is not open.

Parameters

  self | Pointer to the struct itself.
  dataFrame | the data frame to be put in the Write queue

Returns
  True if successful, false if not, and errno set accordingly.

uint64_t( * HidPipeTransport::GetTimeOutValue) (Transport *self)

Function pointer to Transport's GetTimeOutValue.

Parameters

  self | Pointer to the struct itself.

Returns
  the Transport specific timeout value.

bool( * HidPipeTransport::Open) (Transport *self)

Open the generic Transport.

This function opens the Transport specified by the ConnectionString. If the ConnectionString contains a port as an options string that port will be used. Open also sets up the Read and Write.
On failure, errno is set.

- ETHREADCREATEFAILED - Thread creation failed.
- EOUTOFMEMORY - Out of memory.
- EBADTHREAD - Bad thread pointer.
- EQUEUECREATIONFAILED - Queue creation failed.
- EOPENFAILED - Could not open file.
- ENOPORTENTRY - No such file or directory.
- EALREADYOPEN - Specific transport is already opened.
- ENODEVICEENTRY - No device with that name.

Parameters

  self | Pointer to the struct itself.

Returns
  True if successful, false if not, and errno set accordingly.

DataFrame*( * HidPipeTransport::Read) (Transport *self)

Function pointer to Transport's Read.

On failure, errno is set.

- ENOTOPENED - Transport is not open.
- EREADFAILED - Read failed.
- EOUTOFMEMORY - Memory allocation failed.

Parameters

  self | Pointer to the struct itself.

Returns
  A pointer to the read data frame, NULL either if no data frames exist or an error has occurred. Upon error see errno.

void( * HidPipeTransport::TransportLost) (Transport *self)

Signals the transport that it has been lost and acts accordingly.

Parameters

  self | Pointer to the struct itself.

bool( * HidPipeTransport::Write) (Transport *self, DataFrame *payload)

Function pointer to Transport's Write.

On failure, errno is set.

- EWRITEFAILED - Write failed.
- EPARTIALWRITE - Not all bytes written.
- ENOTOPENED - Transport is not open.

Parameters

  self | Pointer to the struct itself.
  payload | The payload pointer.

Returns
  True if success, false if failed. See errno.

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

- HidPipeTransport.h