gwenhywfar  5.11.2beta
Macros | Functions
msg.c File Reference
#include "msgio/msg_p.h"
#include <gwenhywfar/error.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/text.h>
Include dependency graph for msg.c:

Go to the source code of this file.

Macros

#define GWEN_MSG_SIZE_MASK   (~4095)
 
#define GWEN_MSG_SIZE_STEP   4096
 

Functions

int GWEN_Msg_AddByte (GWEN_MSG *msg, uint8_t b)
 
int GWEN_Msg_AddBytes (GWEN_MSG *msg, const uint8_t *bufferPtr, uint32_t bufferLen)
 
void GWEN_Msg_AddFlags (GWEN_MSG *msg, uint32_t f)
 
void GWEN_Msg_Attach (GWEN_MSG *msg)
 
void GWEN_Msg_DelFlags (GWEN_MSG *msg, uint32_t f)
 
void GWEN_Msg_Dump (const GWEN_MSG *msg, GWEN_BUFFER *buf)
 
GWEN_MSGGWEN_Msg_dup (const GWEN_MSG *srcMsg)
 
void GWEN_Msg_free (GWEN_MSG *msg)
 
GWEN_MSGGWEN_Msg_fromBytes (const uint8_t *ptr, uint32_t len)
 
uint8_t * GWEN_Msg_GetBuffer (GWEN_MSG *msg)
 
uint32_t GWEN_Msg_GetBytesInBuffer (const GWEN_MSG *msg)
 
const uint8_t * GWEN_Msg_GetConstBuffer (const GWEN_MSG *msg)
 
uint32_t GWEN_Msg_GetCurrentPos (const GWEN_MSG *msg)
 
GWEN_DB_NODEGWEN_Msg_GetDbParsedInfo (const GWEN_MSG *msg)
 
uint32_t GWEN_Msg_GetFlags (const GWEN_MSG *msg)
 
int GWEN_Msg_GetGroupId (const GWEN_MSG *msg)
 
uint32_t GWEN_Msg_GetMaxSize (const GWEN_MSG *msg)
 
uint32_t GWEN_Msg_GetParsedPayloadOffset (const GWEN_MSG *msg)
 
uint32_t GWEN_Msg_GetParsedPayloadSize (const GWEN_MSG *msg)
 
int GWEN_Msg_GetRemainingBytes (const GWEN_MSG *msg)
 
uint16_t GWEN_Msg_GetUint16At (const GWEN_MSG *msg, int offs, uint16_t defaultValue)
 
uint32_t GWEN_Msg_GetUint32At (const GWEN_MSG *msg, int offs, uint32_t defaultValue)
 
uint64_t GWEN_Msg_GetUint64At (const GWEN_MSG *msg, int offs, uint64_t defaultValue)
 
uint8_t GWEN_Msg_GetUint8At (const GWEN_MSG *msg, int offs, uint8_t defaultValue)
 
int GWEN_Msg_IncCurrentPos (GWEN_MSG *msg, uint32_t i)
 
GWEN_MSGGWEN_Msg_new (uint32_t bufferSize)
 
int GWEN_Msg_ReadNextByte (GWEN_MSG *msg)
 
int GWEN_Msg_RewindCurrentPos (GWEN_MSG *msg)
 
void GWEN_Msg_SetBytesInBuffer (GWEN_MSG *msg, uint32_t i)
 
void GWEN_Msg_SetDbParsedInfo (GWEN_MSG *msg, GWEN_DB_NODE *db)
 
void GWEN_Msg_SetFlags (GWEN_MSG *msg, uint32_t f)
 
void GWEN_Msg_SetGroupId (GWEN_MSG *msg, int groupId)
 
void GWEN_Msg_SetParsedPayloadOffset (GWEN_MSG *msg, uint32_t v)
 
void GWEN_Msg_SetParsedPayloadSize (GWEN_MSG *msg, uint32_t v)
 

Macro Definition Documentation

◆ GWEN_MSG_SIZE_MASK

#define GWEN_MSG_SIZE_MASK   (~4095)

Definition at line 25 of file msg.c.

Referenced by GWEN_Msg_AddBytes().

◆ GWEN_MSG_SIZE_STEP

#define GWEN_MSG_SIZE_STEP   4096

Definition at line 24 of file msg.c.

Referenced by GWEN_Msg_AddBytes().

Function Documentation

◆ GWEN_Msg_AddByte()

int GWEN_Msg_AddByte ( GWEN_MSG msg,
uint8_t  b 
)

Definition at line 182 of file msg.c.

References GWEN_Msg_AddBytes().

Here is the call graph for this function:

◆ GWEN_Msg_AddBytes()

int GWEN_Msg_AddBytes ( GWEN_MSG msg,
const uint8_t *  bufferPtr,
uint32_t  bufferLen 
)

Definition at line 189 of file msg.c.

References DBG_ERROR, DBG_INFO, GWEN_ERROR_GENERIC, GWEN_ERROR_MEMORY_FULL, GWEN_LOGDOMAIN, GWEN_MSG_SIZE_MASK, GWEN_MSG_SIZE_STEP, and NULL.

Referenced by _distributeBufferContent(), and GWEN_Msg_AddByte().

Here is the caller graph for this function:

◆ GWEN_Msg_AddFlags()

void GWEN_Msg_AddFlags ( GWEN_MSG msg,
uint32_t  f 
)

Definition at line 318 of file msg.c.

◆ GWEN_Msg_Attach()

void GWEN_Msg_Attach ( GWEN_MSG msg)

Definition at line 66 of file msg.c.

◆ GWEN_Msg_DelFlags()

void GWEN_Msg_DelFlags ( GWEN_MSG msg,
uint32_t  f 
)

Definition at line 326 of file msg.c.

◆ GWEN_Msg_Dump()

void GWEN_Msg_Dump ( const GWEN_MSG msg,
GWEN_BUFFER buf 
)

Definition at line 423 of file msg.c.

References GWEN_Buffer_AppendArgs(), GWEN_Buffer_AppendByte(), and GWEN_Text_DumpString2Buffer().

Here is the call graph for this function:

◆ GWEN_Msg_dup()

GWEN_MSG* GWEN_Msg_dup ( const GWEN_MSG srcMsg)

Definition at line 91 of file msg.c.

References GWEN_DB_Group_dup(), GWEN_Msg_new(), and NULL.

Here is the call graph for this function:

◆ GWEN_Msg_free()

void GWEN_Msg_free ( GWEN_MSG msg)

Definition at line 74 of file msg.c.

References GWEN_DB_Group_free(), GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, and GWEN_LIST_FINI.

Referenced by _writeCurrentMessage(), and GWEN_MsgEndpoint_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Msg_fromBytes()

GWEN_MSG* GWEN_Msg_fromBytes ( const uint8_t *  ptr,
uint32_t  len 
)

Definition at line 50 of file msg.c.

References GWEN_Msg_new(), and NULL.

Here is the call graph for this function:

◆ GWEN_Msg_GetBuffer()

uint8_t* GWEN_Msg_GetBuffer ( GWEN_MSG msg)

Definition at line 129 of file msg.c.

References NULL.

Referenced by _writeCurrentMessage().

Here is the caller graph for this function:

◆ GWEN_Msg_GetBytesInBuffer()

uint32_t GWEN_Msg_GetBytesInBuffer ( const GWEN_MSG msg)

Definition at line 147 of file msg.c.

Referenced by _getBytesNeededForMessage().

Here is the caller graph for this function:

◆ GWEN_Msg_GetConstBuffer()

const uint8_t* GWEN_Msg_GetConstBuffer ( const GWEN_MSG msg)

Definition at line 138 of file msg.c.

References NULL.

◆ GWEN_Msg_GetCurrentPos()

uint32_t GWEN_Msg_GetCurrentPos ( const GWEN_MSG msg)

Definition at line 172 of file msg.c.

Referenced by _writeCurrentMessage().

Here is the caller graph for this function:

◆ GWEN_Msg_GetDbParsedInfo()

GWEN_DB_NODE* GWEN_Msg_GetDbParsedInfo ( const GWEN_MSG msg)

Definition at line 334 of file msg.c.

References NULL.

◆ GWEN_Msg_GetFlags()

uint32_t GWEN_Msg_GetFlags ( const GWEN_MSG msg)

Definition at line 301 of file msg.c.

◆ GWEN_Msg_GetGroupId()

int GWEN_Msg_GetGroupId ( const GWEN_MSG msg)

Definition at line 115 of file msg.c.

◆ GWEN_Msg_GetMaxSize()

uint32_t GWEN_Msg_GetMaxSize ( const GWEN_MSG msg)

Definition at line 165 of file msg.c.

◆ GWEN_Msg_GetParsedPayloadOffset()

uint32_t GWEN_Msg_GetParsedPayloadOffset ( const GWEN_MSG msg)

Definition at line 284 of file msg.c.

◆ GWEN_Msg_GetParsedPayloadSize()

uint32_t GWEN_Msg_GetParsedPayloadSize ( const GWEN_MSG msg)

Definition at line 267 of file msg.c.

◆ GWEN_Msg_GetRemainingBytes()

int GWEN_Msg_GetRemainingBytes ( const GWEN_MSG msg)

Definition at line 258 of file msg.c.

Referenced by _writeCurrentMessage().

Here is the caller graph for this function:

◆ GWEN_Msg_GetUint16At()

uint16_t GWEN_Msg_GetUint16At ( const GWEN_MSG msg,
int  offs,
uint16_t  defaultValue 
)

Definition at line 393 of file msg.c.

◆ GWEN_Msg_GetUint32At()

uint32_t GWEN_Msg_GetUint32At ( const GWEN_MSG msg,
int  offs,
uint32_t  defaultValue 
)

Definition at line 378 of file msg.c.

◆ GWEN_Msg_GetUint64At()

uint64_t GWEN_Msg_GetUint64At ( const GWEN_MSG msg,
int  offs,
uint64_t  defaultValue 
)

Definition at line 354 of file msg.c.

◆ GWEN_Msg_GetUint8At()

uint8_t GWEN_Msg_GetUint8At ( const GWEN_MSG msg,
int  offs,
uint8_t  defaultValue 
)

Definition at line 408 of file msg.c.

◆ GWEN_Msg_IncCurrentPos()

int GWEN_Msg_IncCurrentPos ( GWEN_MSG msg,
uint32_t  i 
)

Definition at line 233 of file msg.c.

References GWEN_ERROR_EOF.

Referenced by _writeCurrentMessage().

Here is the caller graph for this function:

◆ GWEN_Msg_new()

GWEN_MSG* GWEN_Msg_new ( uint32_t  bufferSize)

Definition at line 33 of file msg.c.

References GWEN_INHERIT_INIT, GWEN_LIST_INIT, and GWEN_NEW_OBJECT.

Referenced by _distributeBufferContent(), GWEN_IpcMsg_new(), GWEN_Msg_dup(), and GWEN_Msg_fromBytes().

Here is the caller graph for this function:

◆ GWEN_Msg_ReadNextByte()

int GWEN_Msg_ReadNextByte ( GWEN_MSG msg)

Definition at line 220 of file msg.c.

References GWEN_ERROR_EOF.

◆ GWEN_Msg_RewindCurrentPos()

int GWEN_Msg_RewindCurrentPos ( GWEN_MSG msg)

Definition at line 247 of file msg.c.

References GWEN_ERROR_EOF.

Referenced by GWEN_MsgEndpoint_AddReceivedMessage(), and GWEN_MsgEndpoint_AddSendMessage().

Here is the caller graph for this function:

◆ GWEN_Msg_SetBytesInBuffer()

void GWEN_Msg_SetBytesInBuffer ( GWEN_MSG msg,
uint32_t  i 
)

Definition at line 157 of file msg.c.

◆ GWEN_Msg_SetDbParsedInfo()

void GWEN_Msg_SetDbParsedInfo ( GWEN_MSG msg,
GWEN_DB_NODE db 
)

Definition at line 343 of file msg.c.

References GWEN_DB_Group_free().

Here is the call graph for this function:

◆ GWEN_Msg_SetFlags()

void GWEN_Msg_SetFlags ( GWEN_MSG msg,
uint32_t  f 
)

Definition at line 310 of file msg.c.

◆ GWEN_Msg_SetGroupId()

void GWEN_Msg_SetGroupId ( GWEN_MSG msg,
int  groupId 
)

Definition at line 122 of file msg.c.

Referenced by _distributeBufferContent().

Here is the caller graph for this function:

◆ GWEN_Msg_SetParsedPayloadOffset()

void GWEN_Msg_SetParsedPayloadOffset ( GWEN_MSG msg,
uint32_t  v 
)

Definition at line 293 of file msg.c.

◆ GWEN_Msg_SetParsedPayloadSize()

void GWEN_Msg_SetParsedPayloadSize ( GWEN_MSG msg,
uint32_t  v 
)

Definition at line 276 of file msg.c.