⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ccdapi.h

📁 是一个手机功能的模拟程序
💻 H
📖 第 1 页 / 共 2 页
字号:
#endif

typedef struct
{
  T_ERR_INFO  err_info;
  ULONG       err_IEaddr;
} T_CCD_ERR_TYPE;

/*
 * old style of error information container, used in gsm/gprs
 */
#define MAX_ERR_PAR 3
typedef struct
{
  UBYTE  num_para;
  USHORT err_list[MAX_ERR_PAR];
} T_CCD_PARA_LIST;

/* 
 * union supports old and new type of error information container
 */
typedef union
{
  T_CCD_PARA_LIST  para_list;
  T_CCD_ERR_TYPE   err_type;
} T_CCD_ERR_PARA;

/*
 * general structure for error information passed to CCD caller 
 */
typedef struct
{
  UBYTE error;
  UBYTE kind;
  T_CCD_ERR_PARA para;
} T_CCD_ERR_ENTRY;



/**************************************************************
  function codes for CCD interface functions
  used in stub1 (application side) and stub2 (driver side)
 **************************************************************/

#define CCD_INIT       1
#define CCD_CODMSG     2
#define CCD_DECMSG     3
#define CCD_DECBYTE    4
#define CCD_CODBYTE    5
#define CCD_DECLONG    6
#define CCD_CODLONG    7
#define CCD_BITCOPY    8
#define CCD_FIRST_ERR  9
#define CCD_NEXT_ERR   10


/*==================== description  ===================================*/

/*
 * ccd_init
 *
 * Initializing the ccd-Module, must be called once before
 * any encoding/decoding
 */

/*
 * ccd_begin
 *
 * Returns the address of the CCD buffer for decoded
 * messages and locks it until ccd_end() is called
 */

/*
 * ccd_end
 *
 * Unlocks the CCD buffer for decoded
 * messages
 */

/*
 * ccd_codeMsg
 *
 * layer    : <IN>   	CCDENT_CMCE, CCDENT_MLE ..
 * direction: <IN>   	UPLINK, DOWNLINK
 * mBuf     : <IN>   	mBuf.o_buf - Offset in Bits from the
 *                                   start of mBuf.buf.
 *            <OUT>  	mBuf.l_buf - Contains the length of
 *                                   the message in Bits after
 *                                   coding.
 *            <OUT>  	mBuf.buf   - Contains the bitcoded message
 *                                   after coding.
 * mStruct:    <IN>     Pointer to the message specific structure.
 *                      The first element must contain the
 *                 	message-type (PDU-Type) as a UBYTE value.
 * 
 * pt       :  <IN>     If pt != 0xff the CCD will not decode the
 *                      the PDU-Type from the bitstream. In this
 *                      case pt is the coding of the PDU-Type.  
 */

/*
 * ccd_decodeMsg
 *
 * layer    :  <IN>    	CCDENT_CMCE, CCDENT_MLE, ...
 * direction:  <IN>    	UPLINK, DOWNLINK
 * mBuf     :  <IN>     mBuf.o_buf - Offset in Bits from start
 *                                   of mBuf.buf where the
 *                                   message starts.
 *             <IN>    	mBuf.l_buf - Contains the length of the
 *                                   message in Bits.
 *             <IN>     mBuf.buf   - Contains the bitcoded message.
 * mStruct  :  <OUT>    Pointer to the message specific structure.
 *                      The first element contains the	message-type
 *                      (PDU-Type) as a UBYTE value after decoding.
 * pt       :  <IN>     If pt != 0xff the CCD will not decode the
 *                      the PDU-Type from the bitstream. In this
 *                      case pt is the coding of the PDU-Type.
 */

/**************************************************************
  function prototypes for CCD interface functions
  used in application, stub2 (driver side) and driver body
 **************************************************************/
#ifndef CCD_C
  extern BYTE  ccd_init                   (void);
  extern void  ccd_exit                   (void);

  extern UBYTE *ccd_begin                 (void);

  extern void  ccd_end                    (void);

  extern BYTE  ccd_decodeMsg              (UBYTE           entity,
                                           UBYTE           direction,
                                           T_MSGBUF       *mBuf,
                                           UBYTE          *mStruct,
                                           UBYTE           pt);

  extern int  ccd_decodeElem              (ULONG           ccdid,
                                           USHORT          l_buf,
                                           USHORT          o_buf,
                                           UCHAR          *buf,
                                           UCHAR          *eStruct);

  extern BYTE ccd_decodeMsgPtr            (UBYTE          entity,
                                           UBYTE          direction,
                                           USHORT         l_buf,
                                           USHORT         o_buf,
                                           UBYTE         *buf,
                                           UBYTE        **mStructPtr,
                                           UBYTE          pt);

  extern BYTE  ccd_codeMsg                (UBYTE           entity,
                                           UBYTE           direction,
                                           T_MSGBUF        *mBuf,
                                           UBYTE           *mStruct,
                                           UBYTE           pt);

  extern BYTE ccd_codeMsgPtr              (UBYTE           entity,
                                           UBYTE           direction,
                                           USHORT         *l_buf,
                                           USHORT          o_buf,
                                           UBYTE          *buf,
                                           UBYTE          *mStruct,
                                           UBYTE           pt);

  extern int  ccd_encodeElem              (ULONG           ccdid,
                                           USHORT         *l_buf,
                                           USHORT          o_buf,
                                           UCHAR          *buf,
                                           UCHAR          *eStruct);

#endif /*! CCD_C */

#ifndef CCD_ERR_C
  extern UBYTE ccd_getFirstError          (UBYTE           entity,
                                           USHORT         *parlist);

  extern UBYTE ccd_getNextError           (UBYTE           entity,
                                           USHORT         *parlist);

  extern ULONG ccd_getFirstFault          (T_CCD_ERR_ENTRY **ccd_err_entry);

  extern ULONG ccd_getNextFault           (T_CCD_ERR_ENTRY **ccd_err_entry);

  extern void  ccd_free_faultlist         ();

  extern int   ccd_get_numFaults          ();
#endif /*! CCD_ERR_C */

#ifndef CDC_STD_C
  extern BYTE  ccd_decodeByte             (UBYTE          *bitstream,
                                           USHORT          startbit,
                                           USHORT          bitlen,
                                           UBYTE          *value);

  extern BYTE  ccd_codeByte               (UBYTE          *bitstream,
                                           USHORT          startbit,
                                           USHORT          bitlen,
                                           UBYTE           val);

  extern BYTE  ccd_codeLong               (UBYTE          *bitstream,
                                           USHORT          startbit,
                                           USHORT          bitlen,
                                           ULONG           value);

  extern BYTE  ccd_decodeLong             (UBYTE          *bitstream,
                                           USHORT          startbit,
                                           USHORT          bitlen,
                                           ULONG          *value);

  extern void  ccd_bitcopy                (UBYTE          *dest,
                                           UBYTE          *source,
                                           USHORT          bitlen,
                                           USHORT          offset);
#endif /*! CCD_STD_C */


#ifdef __cplusplus
}
#endif /*_cplusplus*/

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -