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

📄 ccdapi.h

📁 是一个手机功能的模拟程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/* 
+----------------------------------------------------------------------------- 
|  Project :  
|  Modul   :  ccdapi.h
+----------------------------------------------------------------------------- 
|  Copyright 2002 Texas Instruments Berlin, AG 
|                 All rights reserved. 
| 
|                 This file is confidential and a trade secret of Texas 
|                 Instruments Berlin, AG 
|                 The receipt of or possession of this file does not convey 
|                 any rights to reproduce or disclose its contents or to 
|                 manufacture, use, or sell anything it may describe, in 
|                 whole, or in part, without the specific written consent of 
|                 Texas Instruments Berlin, AG. 
+----------------------------------------------------------------------------- 
|  Purpose :  Condat Coder Decoder Application Interface
|
|             Use this header to integrate the condat coder decoder
|             in your target system !
|
|             The application must define USE_DRIVER if CCD is
|             not linked but used as a driver
+----------------------------------------------------------------------------- 
*/ 

#ifndef CCDAPI_H
#define CCDAPI_H

#ifdef __cplusplus
extern  "C" {
#endif /*_cplusplus*/

/**************************************************************
  Types and constants for CCD
  used in application, in stub1 (api) and in driver body
 **************************************************************/

/*==== CONSTANTS ==================================================*/
/*
 * constants for the direction-parameter for coding/decoding
 */

#define UPLINK             0
#define DOWNLINK           1
#define BOTH		   UPLINK

                                /*  ccd Error codes */
#define  ccdOK              0
#define  ccdWarning         1
#define  ccdError           2

/*
 * Error codes to use with ccd_setError()
 */
#define ERR_NO_MORE_ERROR       0   /* Returned by ccd_getFirst/NextError   */
                                    /* in case of the end of the error list */              

#define ERR_INVALID_CALC        1   /* Invalid combination of calculations  */
                                    /* Error params: none                   */

#define ERR_PATTERN_MISMATCH    2   /* A spare pattern does not match with  */
                                    /* the specified content                */
                                    /* Error params[0] = bitposition        */

#define ERR_COMPREH_REQUIRED    3   /* Comprehension of an unknown TAG      */
                                    /* required.                            */
                                    /* Error params[0] = TAG                */
                                    /*             [1] = bitposition        */

#define ERR_IE_NOT_EXPECTED     4   /* Unknown or unexpected TAG found      */
                                    /* Error params[0] = TAG                */
                                    /*             [1] = bitposition        */

#define ERR_IE_SEQUENCE         5   /* A valid TAG is found but not in the  */
                                    /* defined sequence.                    */
                                    /* Error params[0] = TAG                */
                                    /*             [1] = bitposition        */

#define ERR_MAX_IE_EXCEED       6   /* A repeatable TAG is found but it     */
                                    /* occurs more often than it is defined */
                                    /* Error params[0] = TAG                */
                                    /*             [1] = bitposition        */

#define ERR_MAND_ELEM_MISS      7   /* A as mandatory defined element is    */
                                    /* not in the message                   */
                                    /* Error params: none                   */

#define ERR_EOC_TAG_MISSING     8   /* A indefinite length is specified for */
                                    /* an ASN.1 element but the correspond. */
                                    /* End of Component TAG is missiong     */
                                    /* Error params[0] = TAG                */
                                    /*             [1] = bitposition        */
                          
#define ERR_INVALID_MID         9   /* The message starts with an undefined */
                                    /* message identifier                   */
                                    /* Error params[0] = Message ID         */

#define ERR_INVALID_TYPE       10   /* The actual element has an invalid    */
                                    /* type e.g. S_PADDING without a spare  */
                                    /* Error params[0] = bitposition        */

#define ERR_MAX_REPEAT         11   /* A repeatable element occurs to often */
                                    /* in the message                       */

#define ERR_NO_MEM             12   /* Memory allocation failed. May result */
                                    /* occur when using pointer types.      */
                                    /* (Dynamic array addition)             */

#define ERR_INTERNAL_ERROR     20   /* An internal error occured            */
                                    /* (hopefully not!)                     */
                                    /* Error params[0] = none               */
#define ERR_DEFECT_CCDDATA     21   /* The value read from a ccd table      */
                                    /* (one of the *.cdg files) is not      */
                                    /* expected by CCD, e.g. extGroup has   */ 
                                    /* another value than ' ', '+', '-',    */
                                    /* '!' or '#'.                          */ 
                                    /* Error params[0] = bitposition        */
                                    /* this error code is needed only in    */
                                    /* the development phase.               */
#define ERR_END_OF_BUF         22   /* According to the lenght indicator    */
                                    /* there must be more bits to read but  */
                                    /* end of bit buffer is reached         */

#define ERR_INT_VALUE          23   /* Error on encoding of integer value.  */
                                    /* IE of coding type ASN1_INTEGER is    */
                                    /* out of the given range.              */

#define ERR_LONG_MSG           24   /* UNUSED error code                    */
                                    /* According to l_buf and due to an     */
                                    /* unknown message extension there are  */
                                    /* more bits to be decoded than CCD or  */
                                    /* ccddata expects.                     */

#define ERR_ASN1_ENCODING      25   /* Error on IE in the outermost level.  */
#define ERR_ASN1_MAND_IE       26   /* Error on mandatory IE of type        */
                                    /* ASN1_INTEGER. The decoded value is   */
                                    /* out of the range given by the loaded */
                                    /* ccd data tables.                     */
                                    /* data tables.                         */
#define ERR_ASN1_OPT_IE        27   /* Error on optional IE of type.        */
                                    /* ASN1_INTEGER. The decoded value is   */
                                    /* out of the range given by the loaded */
                                    /* ccd data tables.                     */
#define ERR_ASN1_COND_IE       28   /* UNUSED error code                    */ 
#define ERR_COND_ELEM_MISS     29   /* UNUSED error code                    */
                                    /* Condition is met but the IE is not   */
                                    /* present in the message.              */
#define ERR_BUFFER_OF          30   /* On coding, more bits were written,   */
                                    /* than the input l_buf suggested.      */

#define ERR_NONCRITICAL_EXT    31   /* Warning (if decoding) or error (if   */
                                    /* encoding) on inappropriate usage of  */
                                    /* a nonCriticalExtensions element.     */
                                    /* The CCDTYPE_NONCRITICAL_EXTENSIONS   */
                                    /* says the IE is not extended yet from */
                                    /* a CCD point of view. So it needs     */
                                    /* neither to be encoded nor decoded.   */
                                    /* In the latter case additional parts  */
                                    /* at the end the message will be       */
                                    /* ignored by CCD. Known extensions are */
                                    /* to be encoded by CCD.                */

#define ERR_CRITICAL_EXT       32   /* Error on inappropriate usage of a    */
                                    /* nonCriticalExtensions element. The   */
                                    /* CCDTYPE_CRITICAL_EXTENSIONS says     */
                                    /* the IE is not extended yet, from a   */
                                    /* CCD point of view. So it needs not   */
                                    /* to be encoded or decoded. In latter  */
                                    /* case message is not comprehendable   */
                                    /* and must be rejected.                */
                                   
#define ERR_INVALID_CCDID      33   /* The ccd identifier for the element   */
                                    /* to be decoded did not result a valid */
                                    /* data table entry.                    */

#define ERR_MSG_LEN            34   /* Decoding is just finished. But the   */
                                    /* CCD internal bit pointer is beyond   */
                                    /* the given message length, l_buf e.g. */

#define ERR_INVALID_PTR        35   /* Pointer used in C struct for encoding*/
                                    /* is not valid.                        */
#define ERR_PROTOCOL_EXTENSION 36   /* IE of type S_PADDING_0 is preceded   */
                                    /* by 1 instead of 0.                   */
                                    /* Error params[0] = CCDID              */
                                    /*             [1] = bitposition        */

/*
 * max number of parameters per error for parlist
 * param ccd_getFirst/NextError
 */
#define MAX_ERR_PAR             3 
#define CCD_ERR_KIND_PARA_LIST  1
#define CCD_ERR_KIND_IE_TYPE    2


/*==== TYPES ======================================================*/

/*
 * T_MSGBUF contains the coded message.
 * o_buf specified the * offset (in Bits), * where the message
 *       starts in the buffer.
 * l_buf contains the * length (in Bits) of the coded message.
 * buf   contains the * bitcoded message as an array of Bytes.
 *
 * (Do not modify this structure !)
 */

typedef struct
{
  USHORT l_buf;
  USHORT o_buf;
  UBYTE  buf [1];
} T_MSGBUF;


/*
 * new style of error information container, used in umts
 */
#ifdef CCD_USE_ENUM_IDS
#include "ccdid.h"      /* to get enumeration for fault elements */
typedef T_CCD_ID T_ERR_INFO;
#else
typedef ULONG T_ERR_INFO;

⌨️ 快捷键说明

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