Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cPingGray Class Reference

#include <cPingGray.h>

Inheritance diagram for GrayLib::cPingGray:
IPingProtocol

Public Types

enum  HEAD_TYPE {
  HEAD_LENL = 0 , HEAD_LENH , HEAD_MSGTYPE , HEAD_CHECK ,
  HEAD_QTY
}
 

Public Member Functions

 cPingGray (const void *pPrefix, size_t iPrefixSize)
 
virtual size_t MakePingPacket (OUT BYTE *pData, MSGTYPE_TYPE eMsgType, const void *pPayload, size_t nPayloadSize) const override
 this is the default prefix for those that talk Gray UDP protocol. More...
 

Public Attributes

const void *const m_pPrefix
 all packets have this static Prefix. TX and RX. More...
 
size_t const m_nPrefixSize
 fixed length Prefix to id this packet. More...
 

Static Public Attributes

static const cPingGray k_Def
 this is the default prefix for those that talk Gray UDP protocol. More...
 

Detailed Description

The Gray UDP format ping. Minimal sized. (NOT XObject,XProtocol) Prefix, Header, Payload in a block. NOT the same as ICMP based ping 'PREFIX','LENL','LENH','MSGTYPE','PAYLOAD DATA'

Member Enumeration Documentation

◆ HEAD_TYPE

4 byte header after the m_pPrefix

Enumerator
HEAD_LENL 

low byte. more or less redundant with the UDP length.

HEAD_LENH 

high byte of payload length. does not include this headers length.

HEAD_MSGTYPE 

MSGTYPE_TYPE.

HEAD_CHECK 

1 byte of Checksum of all = payload + len + HEAD_MSGTYPE.

HEAD_QTY 

number of overhead bytes, not including the m_pPrefix = 4.

Constructor & Destructor Documentation

◆ cPingGray()

GrayLib::cPingGray::cPingGray ( const void *  pPrefix,
size_t  iPrefixSize 
)
inline

Member Function Documentation

◆ MakePingPacket()

size_t GrayLib::cPingGray::MakePingPacket ( OUT BYTE *  pData,
MSGTYPE_TYPE  eMsgType,
const void *  pPayload,
size_t  nPayloadSize 
) const
overridevirtual

this is the default prefix for those that talk Gray UDP protocol.

Make a ping packet that sends single UINT32 payload (just the time in Echo case) ASSUME: Size of pData is >= m_nPrefixSize + PING_OVERHEAD_QTY + dwPayloadSize.

Member Data Documentation

◆ k_Def

const cPingGray GrayLib::cPingGray::k_Def
static

this is the default prefix for those that talk Gray UDP protocol.

◆ m_nPrefixSize

size_t const GrayLib::cPingGray::m_nPrefixSize

fixed length Prefix to id this packet.

◆ m_pPrefix

const void* const GrayLib::cPingGray::m_pPrefix

all packets have this static Prefix. TX and RX.


The documentation for this class was generated from the following files: