LinuxQMISDK-Lite  SLQS04.00.23
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
common.h File Reference

Go to the source code of this file.

Data Structures

struct  pack_qmi_t
 
struct  unpack_qmi_t
 
struct  unpack_result_t
 

Macros

#define SDU_HDR_LEN   (3)
 
#define MINREQBKLEN   (2048)
 
#define MSGID_AND_LEN   (4)
 
#define MSGID_DONT_CARE   (0xffff)
 
#define UNUSEDPARAM(x)   (void)x
 
#define DEAULT_LOC_TIMEOUT_IN_SEC   2
 
#define SDK_VALIDATE_INPUT_PACK_PARAM(pCtx, pBuf, pLen)
 
#define SDK_VALIDATE_INPUT_PACK_PARAM_AND_FILL_XID(pCtx, pBuf, pLen)
 
#define SDK_VALIDATE_INPUT_UNPACK_PARAM(pResp, respLen, pOutput)
 
#define SWI_INIT_UNPACK_RESULT_VALUE   {0, SWI_UINT256_INT_VALUE}
 

Typedefs

typedef void(* logger )(uint8_t lvl, const char *buff)
 

Enumerations

enum  eLOG_LEVEL {
  eLOG_INFO,
  eLOG_DEBUG,
  eLOG_WARN,
  eLOG_FATAL
}
 
enum  eTimeout {
  eTIMEOUT_2_S = 2000,
  eTIMEOUT_5_S = 5000,
  eTIMEOUT_8_S = 8000,
  eTIMEOUT_10_S = 10000,
  eTIMEOUT_20_S = 20000,
  eTIMEOUT_30_S = 30000,
  eTIMEOUT_60_S = 60000,
  eTIMEOUT_300_S = 300000,
  eTIMEOUT_DEFAULT = eTIMEOUT_8_S
}
 
enum  eQMI_SVC {
  eCTL,
  eWDS,
  eDMS,
  eNAS =3,
  eQOS,
  eSMS =5,
  ePDS =0x06,
  eVOICE =0x09,
  eCAT =0x0A,
  eUIM =0x0B,
  eLOC =0x10,
  eSAR =0x11,
  eIMS =0x12,
  eTMD =0x18,
  eIMSA =0x21,
  eRMS =225,
  eSWIOMA =240,
  eAUDIO =241,
  eSWIM2MCMD =243,
  eSWIM2MCMD_AVC2 =0xfd,
  eSWIOMAEXT =244,
  eSWIAUDIO = 245,
  eSWILOC =246,
  eSWIDMS =254
}
 
enum  msgtype {
  eREQ =0,
  eRSP =2,
  eIND =4
}
 

Functions

uint16_t helper_get_xid (uint8_t *qmi_resp)
 
uint16_t helper_get_error_code (uint8_t *qmi_resp)
 
char * helper_get_error_reason (uint16_t retVal)
 
const char * helper_get_resp_ctx (uint8_t svc, uint8_t *pbuf, uint32_t len, unpack_qmi_t *pCtx)
 
const char * helper_get_req_str (uint8_t svc, uint8_t *req, uint32_t len)
 
unsigned unpack_result_code_only (uint8_t *pMdmResp)
 
int helper_set_log_func (logger *func)
 
void liteqmi_log (uint8_t lvl, const char *fmt,...)
 
int helper_set_log_lvl (uint8_t lvl)
 
void fill_sdu_hdr (pack_qmi_t *pCtx, uint8_t *pReqBuf)
 
void fill_pack_ctx (pack_qmi_t *pCtx, uint8_t *pReqBuf, uint16_t *pLen, uint8_t svc, int timeout)
 
char * get_version ()
 
char * liteqmi_GetVersion ()
 
void liteqmi_helper_decode7bitAsciiEncString (uint8_t *encoded_str, uint8_t encoded_len, uint8_t *decoded_str)
 
int helper_isBootLoader_DebugEnabled (const char *szPath, const char *pQsn)
 

Variables

loggerglog
 
uint8_t gloglvl
 

Macro Definition Documentation

#define DEAULT_LOC_TIMEOUT_IN_SEC   2
#define MINREQBKLEN   (2048)
#define MSGID_AND_LEN   (4)
#define MSGID_DONT_CARE   (0xffff)
#define SDK_VALIDATE_INPUT_PACK_PARAM (   pCtx,
  pBuf,
  pLen 
)
Value:
if ((pCtx == NULL) || (pBuf == NULL) || (pLen == NULL) ) \
{\
liteqmi_log(eLOG_DEBUG,"[ pack] %s parameter NULL\n",__func__); \
}
Definition: qmerrno.h:31
void liteqmi_log(uint8_t lvl, const char *fmt,...)
Definition: common.h:61
#define SDK_VALIDATE_INPUT_PACK_PARAM_AND_FILL_XID (   pCtx,
  pBuf,
  pLen 
)
Value:
if ((pCtx == NULL) || (pBuf == NULL) || (pLen == NULL) ) \
{\
liteqmi_log(eLOG_DEBUG,"[ pack] %s parameter NULL\n",__func__); \
} \
if (pCtx->xid == 0) \
pBuf[0] = eREQ; \
pBuf[1] = pCtx->xid & 0xff; \
pBuf[2] = pCtx->xid >> 8;
Definition: common.h:116
Definition: qmerrno.h:31
void liteqmi_log(uint8_t lvl, const char *fmt,...)
Definition: common.h:61
Definition: qmerrno.h:83
#define SDK_VALIDATE_INPUT_UNPACK_PARAM (   pResp,
  respLen,
  pOutput 
)
Value:
if ((pResp == NULL) || (respLen == 0) || (pOutput == NULL) ) \
{\
liteqmi_log(eLOG_DEBUG,"[ unpack] %s parameter NULL or invalid\n",__func__); \
}
Definition: qmerrno.h:31
void liteqmi_log(uint8_t lvl, const char *fmt,...)
Definition: common.h:61
#define SDU_HDR_LEN   (3)
#define SWI_INIT_UNPACK_RESULT_VALUE   {0, SWI_UINT256_INT_VALUE}
#define UNUSEDPARAM (   x)    (void)x

Typedef Documentation

typedef void(* logger)(uint8_t lvl, const char *buff)

Enumeration Type Documentation

enum eLOG_LEVEL

log levels

Enumerator
eLOG_INFO 
eLOG_DEBUG 
eLOG_WARN 
eLOG_FATAL 
enum eQMI_SVC

qmi service

Enumerator
eCTL 
eWDS 
eDMS 
eNAS 
eQOS 
eSMS 
ePDS 
eVOICE 
eCAT 
eUIM 
eLOC 
eSAR 
eIMS 
eTMD 
eIMSA 
eRMS 
eSWIOMA 
eAUDIO 
eSWIM2MCMD 
eSWIM2MCMD_AVC2 
eSWIOMAEXT 
eSWIAUDIO 
eSWILOC 
eSWIDMS 
enum eTimeout

eTimeout

Enumerator
eTIMEOUT_2_S 
eTIMEOUT_5_S 
eTIMEOUT_8_S 
eTIMEOUT_10_S 
eTIMEOUT_20_S 
eTIMEOUT_30_S 
eTIMEOUT_60_S 
eTIMEOUT_300_S 
eTIMEOUT_DEFAULT 
enum msgtype

qmi message type

Enumerator
eREQ 
eRSP 
eIND 

Function Documentation

void fill_pack_ctx ( pack_qmi_t pCtx,
uint8_t *  pReqBuf,
uint16_t *  pLen,
uint8_t  svc,
int  timeout 
)
void fill_sdu_hdr ( pack_qmi_t pCtx,
uint8_t *  pReqBuf 
)
char* get_version ( )
Returns
version string
uint16_t helper_get_error_code ( uint8_t *  qmi_resp)
char* helper_get_error_reason ( uint16_t  retVal)
const char* helper_get_req_str ( uint8_t  svc,
uint8_t *  req,
uint32_t  len 
)

extract msgid string from modem req

Parameters
[in]svcqmi service
[in]reqqmi request
[in]lenrequest length
Returns
qmi message string
const char* helper_get_resp_ctx ( uint8_t  svc,
uint8_t *  pbuf,
uint32_t  len,
unpack_qmi_t pCtx 
)

extract msgid/xid/type from modem reply

Parameters
[in]svcqmi service
[in]pbufqmi response/indication
[in]lenresponse/indication length
[out]pCtxunpacked context
Returns
qmi message string
uint16_t helper_get_xid ( uint8_t *  qmi_resp)
int helper_isBootLoader_DebugEnabled ( const char *  szPath,
const char *  pQsn 
)
Parameters
[in]szPaththe full path of the provided bootloader or firmware file
[in]pQsnthe QSN of a specific module user wants to check, it is a 4 bytes hex value without the prefix 0X. It can be retrieved by AT command AT!ENTERCND="<password>", AT!SECBOOTCFG?, the first parameter of the response of AT!SECBOOTCFG?.
Returns
values listed below
  • -1 bootloader is not debug enabled
  • 0 unbale to retrieve the bootloader debug info
  • 1 bootloader is debug enabled for the provided QSN
  • 4 either szPath or pQsn is invalid (NULL)
  • 18 invalid file
int helper_set_log_func ( logger func)

set log function

int helper_set_log_lvl ( uint8_t  lvl)

set log level

char* liteqmi_GetVersion ( )
Returns
version string
void liteqmi_helper_decode7bitAsciiEncString ( uint8_t *  encoded_str,
uint8_t  encoded_len,
uint8_t *  decoded_str 
)

decode 7bit encoded string

Parameters
[in]encoded_str7 bit encoded ASCII
[in]encoded_lenencoded length
[out]decoded_strdecoded ASCII string
void liteqmi_log ( uint8_t  lvl,
const char *  fmt,
  ... 
)
unsigned unpack_result_code_only ( uint8_t *  pMdmResp)

common handler for unpacking response with TLV type 0x02 only

Variable Documentation

logger* glog
uint8_t gloglvl

Copyright (c) 2011-2015 Sierra Wireless, Inc. All rights reserved