Neonode zForce(TM) SDK

Public Attributes | List of all members
Transport Struct Reference

Transport struct. This structure represents the base class of all Transport definitions. More...

`#include <Transport.h>`

Collaboration diagram for Transport:
[legend]

## Public Attributes
Transport * | Base
| Base pointer to the immediate base Transport class. More...
Connection * | Connection
| Each Transport is linked to one Connection. More...
zForce * | zForce
| A pointer to the global zForce instance. More...
char | ConnectionString [TRANSPORTPROTOCOL_MaxOptionParameterLength+1]
| Connection string. More...
volatile bool | Terminate
| A flag indicating if the Transport Read and Write threads should terminate (true) or not (false). More...
Queue * | WriteQueue
| A pointer to the Write queue used by EnqueueDataFrame. More...
bool | IsOpen
| A flag indicating if the Transport is open (true) or not (false). More...
bool | Opening
| Transport is in Opening phase. More...
zForceThread * | WriteThread
| Write Thread pointer. More...
zForceThread * | ReadThread
| Read Thread pointer. More...
volatile ReadWriteThreadStatus | WriteThreadStatus
| Thread is active. More...
volatile ReadWriteThreadStatus | ReadThreadStatus
| Thread is active. More...
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. More...

## Detailed Description

Transport struct. This structure represents the base class of all Transport definitions.

## Member Data Documentation

## ◆ Base

Transport* Transport::Base

Base pointer to the immediate base Transport class.

Base pointer to the immediate base Transport class. If Base is a NULL pointer then it is the base Transport class itself.

## ◆ Close

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

Close the generic Transport.

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.

## ◆ Connection

Connection* Transport::Connection

Each Transport is linked to one Connection.

Each Transport is linked to one Connection.

## ◆ ConnectionString

char Transport::ConnectionString[TRANSPORTPROTOCOL_MaxOptionParameterLength+1]

Connection string.

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

## ◆ Destructor

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

Destructor frees all the resources that have been allocated.

Destructor frees all the resources that have been allocated.

Parameters

  self | Pointer to the struct itself.

## ◆ EnqueueDataFrame

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

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

## ◆ GetTimeOutValue

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

Function pointer to Transport's GetTimeOutValue.

Function pointer to Transport's GetTimeOutValue.

Parameters

  self | Pointer to the struct itself.

Returns
  the Transport specific timeout value.

## ◆ IsOpen

bool Transport::IsOpen

A flag indicating if the Transport is open (true) or not (false).

A flag indicating if the Transport is open (true) or not (false).

## ◆ Open

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

Open the generic Transport.

Opens the Transport specified by the ConnectionString. The ConnectionString's options are used.
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.

## ◆ Opening

bool Transport::Opening

Transport is in Opening phase.

Transport is in Opening phase.

## ◆ Read

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

Function pointer to Transport's Read.

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.

## ◆ ReadThread

zForceThread* Transport::ReadThread

Read Thread pointer.

Read Thread pointer.

## ◆ ReadThreadStatus

volatile ReadWriteThreadStatus Transport::ReadThreadStatus

Thread is active.

Thread is active.

## ◆ StopCommunication

bool Transport::StopCommunication

Boolean value that indicates that there is no longer any communication. Internal use only.

Boolean value that indicates that there is no longer any communication. Internal use only.

## ◆ Terminate

volatile bool Transport::Terminate

A flag indicating if the Transport Read and Write threads should terminate (true) or not (false).

A flag indicating if the Transport Read and Write threads should terminate (true) or not (false).

## ◆ TransportLost

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

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

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

Parameters

  self | Pointer to the struct itself.

## ◆ Write

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

Function pointer to Transport's Write.

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.

## ◆ WriteQueue

Queue* Transport::WriteQueue

A pointer to the Write queue used by EnqueueDataFrame.

A pointer to the Write queue used by EnqueueDataFrame.

## ◆ WriteThread

zForceThread* Transport::WriteThread

Write Thread pointer.

Write Thread pointer.

## ◆ WriteThreadStatus

volatile ReadWriteThreadStatus Transport::WriteThreadStatus

Thread is active.

Thread is active.

## ◆ zForce

zForce* Transport::zForce

A pointer to the global zForce instance.

A pointer to the global zForce instance.

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

- Transport.h