175 lines
5.4 KiB
C
175 lines
5.4 KiB
C
#ifndef GSMDBG_H__
|
|
#define GSMDBG_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif // __cplusplus
|
|
|
|
/****************************************************************************
|
|
* Includes *
|
|
****************************************************************************/
|
|
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
|
|
#include "gsml1types.h" // GsmL1_RxBurst_t
|
|
|
|
/****************************************************************************
|
|
* Defines *
|
|
****************************************************************************/
|
|
|
|
// Debugging system's verbosity level flags
|
|
#define DBG_NONE 0x00000000
|
|
#define DBG_ALL 0xFFFFFFFF
|
|
|
|
#define DBG_DEBUG 0x80000000
|
|
#define DBG_L1WARNING 0x40000000
|
|
#define DBG_ERROR 0x20000000
|
|
#define DBG_L1RXMSG 0x10000000
|
|
|
|
#define DBG_L1RXMSGBYTE 0x08000000
|
|
#define DBG_L1TXMSG 0x04000000
|
|
#define DBG_L1TXMSGBYTE 0x02000000
|
|
#define DBG_MPHCNF 0x01000000
|
|
|
|
#define DBG_MPHIND 0x00800000
|
|
#define DBG_MPHREQ 0x00400000
|
|
#define DBG_PHIND 0x00200000
|
|
#define DBG_PHREQ 0x00100000
|
|
|
|
#define DBG_PHYRF 0x00080000
|
|
#define DBG_PHYRFMSGBYTE 0x00040000
|
|
#define DBG_MODE 0x00020000
|
|
#define DBG_TDMAINFO 0x00010000
|
|
|
|
#define DBG_BADCRC 0x00008000
|
|
#define DBG_PHINDBYTE 0x00004000
|
|
#define DBG_PHREQBYTE 0x00002000
|
|
|
|
#define DBG_DEVICEMSG 0x00000800
|
|
#define DBG_RACHINFO 0x00000040
|
|
#define DBG_LOGCHINFO 0x00000020
|
|
#define DBG_MEMORY 0x00000010
|
|
|
|
#define DBG_PROFILING 0x00000008
|
|
#define DBG_TESTCOMMENT 0x00000004
|
|
#define DBG_TEST 0x00000002
|
|
#define DBG_STATUS 0x00000001
|
|
|
|
#define DBG_RSSI_THRESHOLD -60.0f ///< Minimum RSSI to be considered a valid burst
|
|
|
|
/****************************************************************************
|
|
* Public functions *
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Function : GsmL1Dbg_Init
|
|
************************************************************************//**
|
|
*
|
|
* Print a debug string to the standard output.
|
|
*
|
|
* @param [in] u32Level
|
|
* Verbosity level of the printed message.
|
|
*
|
|
* @param [in] pExtPrintfCb
|
|
* Function pointer to an external routine able to print the formated string.
|
|
*
|
|
* @param [out] pstrOutputFileName
|
|
* Name of the output file ( Set to NULL in order to disable this feature )
|
|
*
|
|
* @return
|
|
* None.
|
|
*
|
|
* @ingroup gsm_common_debug
|
|
*
|
|
***************************************************************************/
|
|
void GsmL1Dbg_Init( uint32_t u32Level,
|
|
void (*pExtPrintfCb) ( char *pString),
|
|
char *pstrOutputFileName );
|
|
|
|
/****************************************************************************
|
|
* Function : GsmL1Dbg_SetLevel
|
|
************************************************************************//**
|
|
*
|
|
* Set the verbosity level.
|
|
*
|
|
* @param [in] u32Level
|
|
* Verbosity level of the printed message.
|
|
*
|
|
* @return
|
|
* None.
|
|
*
|
|
* @ingroup gsm_common_debug
|
|
*
|
|
***************************************************************************/
|
|
void GsmL1Dbg_SetLevel( uint32_t u32Level );
|
|
|
|
/****************************************************************************
|
|
* Function : GsmL1Dbg_Close
|
|
************************************************************************//**
|
|
*
|
|
* Close the debugging system.
|
|
*
|
|
* @return
|
|
* None.
|
|
*
|
|
* @ingroup gsm_common_debug
|
|
*
|
|
***************************************************************************/
|
|
void GsmL1Dbg_Close();
|
|
|
|
/****************************************************************************
|
|
* Function : GsmL1Dbg_Printf
|
|
************************************************************************//**
|
|
*
|
|
* Print a debug string to the standard output.
|
|
*
|
|
* @param [in] u32Level
|
|
* Verbosity level of the printed message.
|
|
*
|
|
* @param [in] *format
|
|
* String that contains the text to be written to the stdout.
|
|
*
|
|
* @return
|
|
* None.
|
|
*
|
|
* @ingroup gsm_common_debug
|
|
*
|
|
***************************************************************************/
|
|
void GsmL1Dbg_Printf( uint32_t u32Level, char const *format, ... );
|
|
|
|
/****************************************************************************
|
|
* Function : GsmL1Dbg_DumpBuffer
|
|
************************************************************************//**
|
|
*
|
|
* Dump a generic uint8_t buffer.
|
|
*
|
|
* @param [in] u32Level
|
|
* Verbosity level of the printed message.
|
|
*
|
|
* @param [in] u32FirstByte
|
|
* Starting byte index
|
|
*
|
|
* @param [in] u32Length
|
|
* Number of bytes to dump
|
|
*
|
|
* @param [in] pu8Buffer
|
|
* Pointer to the dumped buffer
|
|
*
|
|
* @return
|
|
* None.
|
|
*
|
|
* @ingroup gsm_common_debug
|
|
*
|
|
***************************************************************************/
|
|
void GsmL1Dbg_DumpBuffer( uint32_t u32Level,
|
|
uint32_t u32FirstByte,
|
|
uint32_t u32Length,
|
|
uint8_t *pu8Buffer );
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif // extern "C"
|
|
|
|
#endif // GSMDBG_H__
|