Neonode zForce(TM) SDK
|
This module implements the Protocol base class. More...
Go to the source code of this file.
Classes | |
struct | Protocol |
This structure represents the base class of all protocol definitions. More... | |
Typedefs | |
typedef struct Protocol | Protocol |
Functions | |
DLLEXTERNAL Protocol * | Protocol_GetInstance (Connection *connection, char *protocolString, char *dataFrameType) |
This is the Protocol factory function. More... | |
DLLEXTERNAL bool | Protocol_AddProtocol (ProtocolEntry *protocolEntry) |
Add a new protocol to the list of those available. More... | |
DLLINTERNAL bool | Protocol_Initialize (void) |
Initialize the Protocol module. More... | |
DLLINTERNAL void | Protocol_Uninitialize (void) |
Unitialize the Protocol module. More... | |
This module implements the Protocol base class.
This module implements the Protocol base class. Here we find all that is essential for a Protocol.
DLLEXTERNAL bool Protocol_AddProtocol | ( | ProtocolEntry * | protocolEntry | ) |
Add a new protocol to the list of those available.
This is the method used to find inform the zForce SDK of protocols which can be used for communication.
Upon error the errno variable is set as follows:
protocolEntry | The description of the protocol to add. |
DLLEXTERNAL Protocol* Protocol_GetInstance | ( | Connection * | connection, |
char * | protocolString, | ||
char * | dataFrameType | ||
) |
This is the Protocol factory function.
This is the Protocol class factory function. A new Protocol structure is allocated and if this succeeds the fields of the structure are populated using the arguments passed to the constructor.
Should allocation fail, NULL will be returned and errno is set as follows:
connection | A pointer to the Connection instance that will be used with this protocol. |
protocolString | A pointer to a NUL terminated char string holding a unique human readable identifer. The contents of the string are copied to the Protocol structucture. The length of the string as measured by strlen should be at most MAX_ENTRY_NAME_LENGTH chars. |
dataFrameType | An identifying string that determines the type of data frames this protocol should traffic in. |
DLLINTERNAL bool Protocol_Initialize | ( | void | ) |
Initialize the Protocol module.
Perform the initialization of the Protocol module.
Upon error the errno variable is set as follows: