Neonode zForce(TM) SDK
|
Handles connections. More...
Go to the source code of this file.
Classes | |
struct | ConnectionMessage |
Connection messages struct. More... | |
struct | Connection |
The main Connection struct. More... | |
Typedefs | |
typedef enum ConnectionStatus | ConnectionStatus |
typedef struct ConnectionMessage | ConnectionMessage |
typedef struct Connection | Connection |
Enumerations | |
enum | ConnectionStatus { Connected, Disconnected, ConnectionFault } |
Connection events. More... | |
Functions | |
DLLINTERNAL ConnectionMessage * | ConnectionMessage_New (ConnectionStatus connectionStatus, uint32_t errorCode) |
Internal call used to create a new ConnectionMessage. More... | |
DLLEXTERNAL Connection * | Connection_New (char *connectionString, char *protocolString, char *dataFrameType) |
Create a new Connection. More... | |
Handles connections.
Handles connections, acts as the glue between devices, protocols and transports. Also handles queues to notify software about incoming messages.
typedef struct Connection Connection |
typedef struct ConnectionMessage ConnectionMessage |
typedef enum ConnectionStatus ConnectionStatus |
enum ConnectionStatus |
Connection events.
Enumerator | |
---|---|
Connected |
Status changed to Connected. |
Disconnected |
Status changed to Disconnected. |
ConnectionFault |
Connection Fault. Only set internally. |
DLLEXTERNAL Connection* Connection_New | ( | char * | connectionString, |
char * | protocolString, | ||
char * | dataFrameType | ||
) |
Create a new Connection.
This call does not actually connect, it just creates the binding between the Protocol and Transport.
On failure, errno is set.
Each Transport and Protocol has its own options.
Example to connect to a sensor over Hid using Asn1 as protocol.
HidPipeTransport (hidpipe) has the following options:
Asn1Protocol (asn1) currently has no options.
StreamingDataFrame (Streaming) is the DataFrame type used by both HidPipeTransport and Asn1Protocol.
MyConnection = Connection_New (
"hidpipe://vid=0x1536,pid=0x0101,index=0",
"asn1://",
"Streaming");
connectionString | A Transport specific connection string. |
protocolString | A Protocol specific prototocol string. |
dataFrameType | Which Data Frame Type the Transport and Protocol uses. |
DLLINTERNAL ConnectionMessage* ConnectionMessage_New | ( | ConnectionStatus | connectionStatus, |
uint32_t | errorCode | ||
) |
Internal call used to create a new ConnectionMessage.
On failure, errno is set.
connectionStatus | ConnectionStatus of message. |
errorCode | ErrorCode of message. |