Retransmission Transport. More...
#include "glgpsapi.h"
Classes | |
struct | GlrtCfig |
The GlrtCfig structure is how the HAL tells the GLRT what to do. More... | |
struct | GlrtCtrl |
The GlrtCtrl structure is how the GLRT tells the HAL what to do. More... | |
struct | GlrtStat |
The GlrtCtrl structure is how the GLRT tells the HAL what happened. More... | |
struct | GlrtManagement |
The GlrtManagement structure combines the configuration, control and statistics into one structure. More... | |
Typedefs | |
typedef unsigned char | GlrtChar |
A stream of bytes that the GLRT has encoded and wrapped. | |
typedef void * | GlrtUserData |
The HAL can save a local pointer inside the GlrtManagement structure. | |
typedef unsigned long(* | GlrtWriteDataCallback )(struct GlrtManagement *pGlrtManagement, const GlrtChar *pucData, unsigned long ulDataLen) |
The GLRT has converted binary data and wishes to send it to the unreliable data link. | |
typedef unsigned long(* | GlrtReadDataCallback )(struct GlrtManagement *pGlrtManagement, const unsigned char *pucData, unsigned long ulDataLen) |
The GLRT has converted GLRT data into binary and now can send it to the GLL. | |
typedef void(* | GlrtSignalCallback )(struct GlrtManagement *pGlrtManagement, const plain_char *pcData) |
The application on the peer has a message for us. | |
typedef void(* | GlrtLogCallback )(struct GlrtManagement *pGlrtManagement, const plain_char *pFmt,...) |
The GLRT has logging data. | |
typedef unsigned long(* | GlrtTimerCallback )(struct GlrtManagement *pGlrtManagement) |
The GLRT needs to read a 32-bit millisecond timer. | |
typedef struct GlrtCfig | GlrtCfig |
The GlrtCfig structure is how the HAL tells the GLRT what to do. | |
typedef struct GlrtCtrl | GlrtCtrl |
The GlrtCtrl structure is how the GLRT tells the HAL what to do. | |
typedef struct GlrtStat | GlrtStat |
The GlrtCtrl structure is how the GLRT tells the HAL what happened. | |
typedef struct GlrtManagement | GlrtManagement |
The GlrtManagement structure combines the configuration, control and statistics into one structure. | |
Enumerations | |
enum | GLRT_TEST_FLAGS { GLRT_TEST_IGNORE_CRC = 1, GLRT_TEST_SUPPRESS_RETRANSMIT = 2, GLRT_TEST_INJECT_ERROR_0B = 4, GLRT_TEST_INJECT_ERROR_BIT = 8, GLRT_TEST_INJECT_ERROR_DROP12 = 16, GLRT_TEST_INJECT_SIGNAL = 32, GLRT_TEST_TX_MAX_8 = 64, GLRT_TEST_RETRANSMIT_TIMEOUT = 128, GLRT_TEST_INJECT_ERROR_DROP32 = 256, GLRT_TEST_INJECT_ERROR_ONCE = 0x200, GLRT_TEST_LOG_DATA = 0x400, GLRT_TEST_EXTRA_DEBUG = (1ul << 31) } |
The GLRT_TEST_FLAGS assist bringup and validation by controlling aspects of the GLRT behavior and injecting errors. More... | |
Functions | |
unsigned short | GlrtInit (GlrtManagement *pGlrtManagement) |
GlrtInit() | |
void | GlrtOpen () |
GlrtOpen() | |
unsigned long | GlrtTx (const unsigned char *pucData, unsigned long ulDataLen) |
GlrtTx() | |
void | GlrtRx (const GlrtChar *pucData, unsigned long ulDataLen) |
GlrtRx() | |
unsigned long | GlrtSignal (const plain_char *pucData) |
GlrtSignal() | |
void | GlrtTimeout () |
GlrtTimeout() | |
void | GlrtClose (const plain_char *pSignal) |
GlrtClose() | |
void | GlrtDeinit () |
GlrtDeinit() |
Retransmission Transport.
typedef void(* GlrtLogCallback)(struct GlrtManagement *pGlrtManagement, const plain_char *pFmt,...) |
The GLRT has logging data.
typedef struct GlrtManagement GlrtManagement |
The GlrtManagement structure combines the configuration, control and statistics into one structure.
typedef unsigned long(* GlrtReadDataCallback)(struct GlrtManagement *pGlrtManagement, const unsigned char *pucData, unsigned long ulDataLen) |
The GLRT has converted GLRT data into binary and now can send it to the GLL.
typedef void(* GlrtSignalCallback)(struct GlrtManagement *pGlrtManagement, const plain_char *pcData) |
The application on the peer has a message for us.
typedef unsigned long(* GlrtWriteDataCallback)(struct GlrtManagement *pGlrtManagement, const GlrtChar *pucData, unsigned long ulDataLen) |
The GLRT has converted binary data and wishes to send it to the unreliable data link.
enum GLRT_TEST_FLAGS |
The GLRT_TEST_FLAGS assist bringup and validation by controlling aspects of the GLRT behavior and injecting errors.
void GlrtClose | ( | const plain_char * | pSignal | ) |
The GLL closes the connection to the unreliable serial transport. Sends an optional GlrtSignal.
void GlrtDeinit | ( | ) |
The inverse of GlrtInit(). Calls GlrtClose() if needed.
unsigned short GlrtInit | ( | GlrtManagement * | pGlrtManagement | ) |
void GlrtOpen | ( | ) |
The GLL needs to open a connection using an unreliable serial transport.
Send an INIT packet to tell the other side we're ready. When we recieve an INIT packet from the other side, then return. If we start after the other side, we'll never see their packet. BUT! they see our INIT packet and will respond, so we're good to go then.
Data has arrived from a device driver that read from an unreliable serial transport.
Check the data and call GlrtCfig.OnReadData() if it is OK. Otherwise, send a NAK using callback GlrtCfig.OnWriteData().
unsigned long GlrtSignal | ( | const plain_char * | pucData | ) |
Signal the peer GLRT with some out-of-band text string. Returns the number of bytes sent. Longer strings will be received truncated to the length sent. String length is: (MIN(255, GlrtManagement::otCfig.ucDataMax) - 1)
void GlrtTimeout | ( | ) |
The timeout has expired. The HAL calls this when: otGlrt.otCtrl.usAckDeadlineMs && (HalTimer() > otGlrt.usAckDeadlineMs) )
Ref: glhal/win_xp/glgps_hal_rt.c
unsigned long GlrtTx | ( | const unsigned char * | pucData, |
unsigned long | ulDataLen | ||
) |
The GLL needs to send data to the unreliable serial transport. Send it via callback GlrtCfig.OnWriteData() Save it internally in case of transmission problems: