Neonode zForce(TM) SDK

HidPipeTransport.h
Go to the documentation of this file.
1
10 #ifndef TRANSPORT_HIDPIPETRANSPORT_HIDPIPETRANSPORT_H
11 #define TRANSPORT_HIDPIPETRANSPORT_HIDPIPETRANSPORT_H 1
12
13 #ifndef ZFORCECOMMON_H
14 #error Please include "zForceCommon.h" before this file.
15 #endif // ZFORCECOMMON_H
16
20 typedef struct HidPipeTransport HidPipeTransport;
26 struct HidPipeTransport
27 {
36 Transport * Base;
37
45 Connection * Connection;
46
54 zForce * zForce;
55
66 char ConnectionString [TRANSPORTPROTOCOL_MaxOptionParameterLength + 1];
67
75 volatile bool Terminate;
76
84 Queue * WriteQueue;
85
93 bool IsOpen;
94
102 bool Opening;
103
111 zForceThread * WriteThread;
112
120 zForceThread * ReadThread;
121
129 volatile ReadWriteThreadStatus WriteThreadStatus;
130
138 volatile ReadWriteThreadStatus ReadThreadStatus;
139
162 bool ( * Open) (Transport * self);
163
180 bool ( * Close) (Transport * self);
181
197 DataFrame * ( * Read) (Transport * self);
198
216 bool ( * Write) (Transport * self, DataFrame * payload);
217
229 uint64_t ( * GetTimeOutValue) (Transport * self);
230
249 bool ( * EnqueueDataFrame) (Transport * self, DataFrame * dataFrame);
250
260 void ( * Destructor ) (Transport * self);
261
271 void ( * TransportLost) (Transport * self);
272
280 bool StopCommunication;
281
282 void * Private;
283 };
284
285 #ifdef __cplusplus
286 extern "C"
287 {
288 #endif // __cplusplus
289
304 DLLINTERNAL bool HidPipeTransport_AddHidPipeTransportEntry (void);
305
306 #ifdef __cplusplus
307 }
308 #endif // __cplusplus
309
310 #endif // TRANSPORT_HIDPIPETRANSPORT_HIDPIPETRANSPORT_H
HidPipeTransport_AddHidPipeTransportEntry
DLLINTERNAL bool HidPipeTransport_AddHidPipeTransportEntry(void)
Internal call to add a HidPipeTransport to the list of available transports.
zForceThread
void zForceThread
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:20
ReadWriteThreadStatus
ReadWriteThreadStatus
Enum describing the current status of a Read or Write thread.
Definition: Transport.h:21
Connection
The main Connection struct.
Definition: Connection.h:66
DataFrame
Struct containing the DataFrame information.
Definition: DataFrame.h:25
HidPipeTransport
Struct containing the HidPipeTransport information.
Definition: HidPipeTransport.h:27
HidPipeTransport::ReadThreadStatus
volatile ReadWriteThreadStatus ReadThreadStatus
Thread is active.
Definition: HidPipeTransport.h:138
HidPipeTransport::Close
bool(* Close)(Transport *self)
Close the generic Transport.
Definition: HidPipeTransport.h:180
HidPipeTransport::GetTimeOutValue
uint64_t(* GetTimeOutValue)(Transport *self)
Function pointer to Transport's GetTimeOutValue.
Definition: HidPipeTransport.h:229
HidPipeTransport::WriteThread
zForceThread * WriteThread
Write Thread pointer.
Definition: HidPipeTransport.h:111
HidPipeTransport::Terminate
volatile bool Terminate
A flag indicating if the Transport Read and Write threads should terminate (true) or not (false).
Definition: HidPipeTransport.h:75
HidPipeTransport::zForce
zForce * zForce
A pointer to the global zForce instance.
Definition: HidPipeTransport.h:54
HidPipeTransport::Connection
Connection * Connection
Each Transport is linked to one Connection.
Definition: HidPipeTransport.h:45
HidPipeTransport::ReadThread
zForceThread * ReadThread
Read Thread pointer.
Definition: HidPipeTransport.h:120
HidPipeTransport::Destructor
void(* Destructor)(Transport *self)
Destructor frees all the resources that have been allocated.
Definition: HidPipeTransport.h:260
HidPipeTransport::WriteThreadStatus
volatile ReadWriteThreadStatus WriteThreadStatus
Thread is active.
Definition: HidPipeTransport.h:129
HidPipeTransport::WriteQueue
Queue * WriteQueue
A pointer to the Write queue used by EnqueueDataFrame.
Definition: HidPipeTransport.h:84
HidPipeTransport::Opening
bool Opening
Transport is in Opening phase.
Definition: HidPipeTransport.h:102
HidPipeTransport::TransportLost
void(* TransportLost)(Transport *self)
Signals the transport that it has been lost and acts accordingly.
Definition: HidPipeTransport.h:271
HidPipeTransport::Private
void * Private
Private members of HidPipeTransport.
Definition: HidPipeTransport.h:282
HidPipeTransport::Base
Transport * Base
Base pointer to the immediate base Transport class.
Definition: HidPipeTransport.h:36
HidPipeTransport::IsOpen
bool IsOpen
A flag indicating if the Transport is open (true) or not (false).
Definition: HidPipeTransport.h:93
HidPipeTransport::EnqueueDataFrame
bool(* EnqueueDataFrame)(Transport *self, DataFrame *dataFrame)
Enqueue given dataframe.
Definition: HidPipeTransport.h:249
HidPipeTransport::Open
bool(* Open)(Transport *self)
Open the generic Transport.
Definition: HidPipeTransport.h:162
HidPipeTransport::ConnectionString
char ConnectionString[TRANSPORTPROTOCOL_MaxOptionParameterLength+1]
Connection string.
Definition: HidPipeTransport.h:66
HidPipeTransport::Write
bool(* Write)(Transport *self, DataFrame *payload)
Function pointer to Transport's Write.
Definition: HidPipeTransport.h:216
HidPipeTransport::StopCommunication
bool StopCommunication
Boolean value that indicates that there is no longer any communication. Internal use only.
Definition: HidPipeTransport.h:280
Queue
The Queue struct.
Definition: Queue.h:25
Transport
Transport struct. This structure represents the base class of all Transport definitions.
Definition: Transport.h:43
zForce
Main struct.
Definition: zForce.h:29