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

📄 dti.h

📁 GSM手机设计软件代码
💻 H
📖 第 1 页 / 共 2 页
字号:
 * Connection states
 * NOTE: this is _obsolete_ and maintained only for compatibility reasons!!
 *       these states should be defined in the entities or the prefixec versiones
 *       above should be used
 */
#define CLOSED  0   /* DTI connection is not established */
#define SETUP   1   /* Waiting for connection_opened signal from DTILIB */
#define IDLE    2   /* DTI connection is opened */

/*
 * Entity states for sending
 * NOTE: this is _obsolete_ and maintained only for compatibility reasons!!
 *       these states should be defined in the entity itself
 *       to ensure proper prefixing
 */
#define TX_IDLE      3  /* The entity must not send data primitives (initial state) */
#define TX_READY     4  /* The entity can send data primitives */

/*
 * Entity states for receiving
 * NOTE: this is _obsolete_ and maintained only for compatibility reasons!!
 *       these states should be defined in the entity itself
 *       to ensure proper prefixing
 */
#define RX_IDLE     5   /* Data reception stopped (initial state) */
#define RX_READY    6   /* Ready to receive data */

#define ENTITY_NAME_LEN    0x6         

#define MAX_ATP_LINKS       0x4   /* max. number of links towards the RIV/ATP environment,
                                                       set by AAA*/
/*
 * Value constants for capability
 */
#define DTI_CPBLTY_NO                  0x0         /* used as initial value  = no capabilities */
#define DTI_CPBLTY_CMD                 0x1         /* AT cmd capability              */
#define DTI_CPBLTY_PKT                 0x2         /* packet capability              */
#define DTI_CPBLTY_SER                 0x4         /* serial capability              */

/**********************************************************************************
 * typedefs
 **********************************************************************************/

/*
 * Data Base for each entity.
 */

typedef struct
{
  T_HANDLE  handle;                   /* GPF task handle */ 
  U8 max_links;                       /* Number of links in the link list
                                        - started from the pointer first_link */
  U32 entity_options;                 /* user specified entity_options */
  void ((*sig_callback)               /* Callback function */
    (U8 instance,                     /* Instance of the entity */
     U8 interfac,                     /* Interface of the entity */
     U8 channel,                      /* Channel */
     U8 reason,                       /* Reason for the callback */
     T_DTI2_DATA_IND *dti_data_ind)); /* Data primitive ul */
#ifdef FF_TCP_IP
  char* own_name;                     /* name of the own entity, held by AAA */
  U16 entity_id_p;                    /* entity id within ATP, the same for all 
                                         entities and AAA */ 
#endif
  U32 first_link;                     /* Pointer to link table */
} DTI_DATA_BASE;

typedef DTI_DATA_BASE * DTI_HANDLE;   /* For calling the data base */


/*
 * Link Table, parameter for each DTI connection.
 * For detail information - please see the MSC DTILIB.DOC
 */
typedef struct
{
  U32             link_id;        /* Identity for the link communication */
  U8              direction;      /* Direction for the link communication */
  U32             version;        /* DTI Version */
  U8              instance;       /* Instance of the entity */
  U8              interfac;       /* Selected interface */
  U8              channel;        /* Channel number */
  U32             link_options;   /* type of flow control, queueing, .. */
  T_HANDLE        link_handle;    /* Handle for the communication channel */
  U8              queue_size;     /* DTI queue size */
  U8              queue_len;      /* length of the queue */
  T_DTI2_DATA_IND *dti_data_ind;  /* DTI data primitive */
  U8              connect_state;  /* State for connect */
  U8              rx_state;       /* State for receive */
  U8              tx_state;       /* State for send */
  U32             next_link;      /* Pointer to next DTI_LINK struct, last
                                  /* linkpointer = NULL */
  U8              link_type;      /* indicate Riviera, NULL or GPF link */
#ifdef FF_TCP_IP
  U16             ul_next_atp_data; /* data to be got from ATP */
  U8              atp_tx_state;   /* flow state of ATP */
  U8              dti_id;         /* ACI identity for the link */
  DTI_DATA_BASE*  entity_db;      /* pointer back to home database */
  UINT16          port_nb;        /* port number, if linked towards RIV */
#endif
                                      
} DTI_LINK;

/**********************************************************************************
 * Prototypes for DTILIB
 **********************************************************************************/

EXTERN DTI_HANDLE dti_init(
  U8 maximum_links,
  T_HANDLE handle,
  U32 entity_options,
  void (sig_callback(
    U8 instance,
    U8 interfac,
    U8 channel,
    U8 reason,
    T_DTI2_DATA_IND *dti_data_ind
    ) )
  );

EXTERN void dti_deinit( DTI_HANDLE hDTI);

EXTERN BOOL dti_open(
  DTI_HANDLE hDTI,
  U8 instance,
  U8 interfac,
  U8 channel,
  U8 queue_size,
  U8 direction,
  U32 link_options,
  U32 version,
  U8 *neighbor_entity,
  U32 link_id
  );

EXTERN BOOL dti_resolve_link_id(
  DTI_HANDLE hDTI,
  U8 instance,
  U8 interfac,
  U8 channel,
  U32 *link_id
  );

EXTERN void dti_close(
  DTI_HANDLE hDTI,
  U8 instance,
  U8 interfac,
  U8 channel,
  BOOL flush
  );

EXTERN void dti_start( DTI_HANDLE hDTI, U8 instance, U8 interfac, U8 channel);

EXTERN void dti_stop( DTI_HANDLE hDTI, U8 instance, U8 interfac, U8 channel);

EXTERN void dti_send_data(
  DTI_HANDLE hDTI,
  U8 instance,
  U8 interfac,
  U8 channel,
  T_DTI2_DATA_IND *dti_data_ind
  );

EXTERN void mfree_desc(DTI_HANDLE hDTI, T_desc_list2 * desc_list2);

EXTERN BOOL dti_tx_buffer_status(
  DTI_HANDLE hDTI,
  U8 instance,
  U8 interfac,
  U8 channel,
  U8 *queue_len
  );

/**********************************************************************************
 * Functions in ip_kerp.c
 **********************************************************************************/

#if defined (DTI2)
EXTERN GLOBAL const void dti_dti_connect_req (DTI_HANDLE hDTI,
                            T_DTI2_CONNECT_REQ *dti_connect_req);

EXTERN GLOBAL const void dti_dti_disconnect_req (DTI_HANDLE hDTI,
                            T_DTI2_DISCONNECT_REQ *dti_disconnect_req);

EXTERN GLOBAL const void dti_dti_disconnect_ind (DTI_HANDLE hDTI,
                            T_DTI2_DISCONNECT_IND *dti_disconnect_ind);

EXTERN GLOBAL const void dti_dti_connect_cnf (DTI_HANDLE hDTI,
                            T_DTI2_CONNECT_CNF *dti_connect_cnf);

EXTERN GLOBAL const void dti_dti_connect_res (DTI_HANDLE hDTI,
                            T_DTI2_CONNECT_RES *dti_connect_res);

EXTERN GLOBAL const void dti_dti_connect_ind (DTI_HANDLE hDTI,
                            T_DTI2_CONNECT_IND *dti_connect_ind);
#endif

EXTERN GLOBAL const void dti_dti_ready_ind (DTI_HANDLE hDTI,
                            T_DTI2_READY_IND *dti_ready_ind);

EXTERN GLOBAL const void dti_dti_data_req (DTI_HANDLE hDTI,
                            T_DTI2_DATA_REQ *dti_data_req);

EXTERN GLOBAL const void dti_dti_getdata_req (DTI_HANDLE hDTI,
                            T_DTI2_GETDATA_REQ *dti_getdata_req);

EXTERN GLOBAL const void dti_dti_data_ind (DTI_HANDLE hDTI,
                            T_DTI2_DATA_IND *dti_data_ind);

/**********************************************************************************
 * Test functions used in the windows operating system.
 **********************************************************************************/

#if defined (_SIMULATION_)
EXTERN const void dti_dti_data_test_ind (DTI_HANDLE hDTI,
                    T_DTI2_DATA_TEST_IND *dti_data_test_ind);

EXTERN const void dti_dti_data_test_req (DTI_HANDLE hDTI,
                    T_DTI2_DATA_TEST_REQ *dti_data_test_req);

EXTERN BOOL dti_make_new_desc (DTI_HANDLE hDTI,
                               T_desc2 **p_desc_new,
                               U16 malloc_len,
                               BOOL buff_init_0);

#endif /* _SIMULATION_ */
#endif /* DTI_H */

⌨️ 快捷键说明

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