gll_distr/inc/glutl_rt.h File Reference

Retransmission Transport. More...

#include "glgpsapi.h"
Include dependency graph for glutl_rt.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()

Detailed Description

Retransmission Transport.


Typedef Documentation

typedef void(* GlrtLogCallback)(struct GlrtManagement *pGlrtManagement, const plain_char *pFmt,...)

The GLRT has logging data.

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.


Enumeration Type Documentation

The GLRT_TEST_FLAGS assist bringup and validation by controlling aspects of the GLRT behavior and injecting errors.

Enumerator:
GLRT_TEST_IGNORE_CRC 

Assume all CRCs are 100% correct.

GLRT_TEST_SUPPRESS_RETRANSMIT 

Never retransmit.

GLRT_TEST_INJECT_ERROR_0B 

Every 3000th RX character is overwritten by a 0.

GLRT_TEST_INJECT_ERROR_BIT 

Every 3000th RX character has 1 bit inverted.

GLRT_TEST_INJECT_ERROR_DROP12 

Every 3000th RX character: drop 1 to 12 bytes.

GLRT_TEST_INJECT_SIGNAL 

Every 3000th RX character: inject a long signal.

GLRT_TEST_TX_MAX_8 

Allow 8 TX packets outstanding (instead of default 20)

GLRT_TEST_RETRANSMIT_TIMEOUT 

25ms must expire before retransmissions

GLRT_TEST_INJECT_ERROR_DROP32 

Drop 32 bytes on 4th packet and every 20th subsequent packet.

GLRT_TEST_INJECT_ERROR_ONCE 

Drop only one error.

GLRT_TEST_LOG_DATA 

log TX and RX callback data

GLRT_TEST_EXTRA_DEBUG 

Extreme internal debugging for bringup.


Function Documentation

void GlrtClose ( const plain_char *  pSignal)

GlrtClose()

The GLL closes the connection to the unreliable serial transport. Sends an optional GlrtSignal.

void GlrtDeinit ( )

GlrtDeinit()

The inverse of GlrtInit(). Calls GlrtClose() if needed.

unsigned short GlrtInit ( GlrtManagement pGlrtManagement)

GlrtInit()

The HAL needs to initialize and configure the GLRT.

Returns an error code upon failure

void GlrtOpen ( )

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.

void GlrtRx ( const GlrtChar pucData,
unsigned long  ulDataLen 
)

GlrtRx()

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)

GlrtSignal()

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 ( )

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 
)

GlrtTx()

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:

  • CRC corruption
  • dropped byte/packet In these cases, we'll resend the data via callback GlrtCfig.OnWriteData()
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines