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

📄 adsi.h

📁 传真通信V27 V29 V17 T38解调与解码
💻 H
📖 第 1 页 / 共 2 页
字号:
#define ACLIP_MDMF_CALLERID     0x80/*! A-CLIP MDM message IDs *//*! Date and time (MMDDHHMM) */#define ACLIP_DATETIME          0x01/*! Caller number */#define ACLIP_CALLER_NUMBER     0x02/*! Dialed number */#define ACLIP_DIALED_NUMBER     0x03/*! Caller number absent: 'O' or 'P' */#define ACLIP_ABSENCE1          0x04/*! Call forward: universal, on busy, or on unanswered */#define ACLIP_REDIRECT          0x05/*! Long distance call: 'L' */#define ACLIP_QUALIFIER         0x06/*! Caller's name */#define ACLIP_CALLER_NAME       0x07/*! Caller's name absent: 'O' or 'P' */#define ACLIP_ABSENCE2          0x08/*! Definitions for J-CLIP (Japan Calling Line Identity Presentation) *//*! Multiple data message caller ID frame */#define JCLIP_MDMF_CALLERID     0x40/*! J-CLIP MDM message IDs *//*! Caller number */#define JCLIP_CALLER_NUMBER     0x02/*! Caller number data extension signal */#define JCLIP_CALLER_NUM_DES    0x21/*! Dialed number */#define JCLIP_DIALED_NUMBER     0x09/*! Dialed number data extension signal */#define JCLIP_DIALED_NUM_DES    0x22/*! Caller number absent: 'C', 'O', 'P' or 'S' */#define JCLIP_ABSENCE           0x04/* Dutch/Danish scheme from the ETSI documents.   We are looking for a string of digits ending with "#". There   is no special start marker. Only the caller number is supplied *//* Finland/Denmark/Iceland/Netherlands/India/Belgium/Sweden/   Brazil/Saudi Arabia/Uruguay scheme.   We are looking for a string of digits like "AnnnnBnnnDnnnnC"   where:        "A" is used as a start code for the Calling party number        "B" is used as a start code for the special information concerning the "not availability / restriction information" of the Calling party number        "C" is used as an end code for the information transfer        "D" is used as a start code for the Diverting party number in case of call diversion   The following special information codes are defined        Decimal value "00" is used to indicate, that the calling party number is not available        Decimal value "10" is used to indicate, that the presentation of the calling party number is restricted *//* Taiwan/Kuwait scheme.   We are looking for a string of digits like "DnnnnC", containing   the caller number. *//*! Definitions for CLIP-DTMF */#define CLIP_DTMF_HASH_TERMINATED       '#'#define CLIP_DTMF_C_TERMINATED          'C'/*! Caller number */#define CLIP_DTMF_HASH_CALLER_NUMBER    'A'/*! Caller number absent: private (1), overseas (2) or not available (3) */#define CLIP_DTMF_HASH_ABSENCE          'D'/*! Caller number */#define CLIP_DTMF_C_CALLER_NUMBER       'A'/*! Diverting number */#define CLIP_DTMF_C_REDIRECT_NUMBER     'D'/*! Caller number absent: private/restricted (00) or not available (10) */#define CLIP_DTMF_C_ABSENCE             'B'/*!    ADSI transmitter descriptor. This contains all the state information for an ADSI    (caller ID, CLASS, CLIP, ACLIP) transmit channel. */typedef struct{    int standard;    tone_gen_descriptor_t alert_tone_desc;    tone_gen_state_t alert_tone_gen;    fsk_tx_state_t fsktx;    dtmf_tx_state_t dtmftx;    async_tx_state_t asynctx;        int tx_signal_on;        int byte_no;    int bit_pos;    int bit_no;    uint8_t msg[256];    int msg_len;    int preamble_len;    int preamble_ones_len;    int postamble_ones_len;    int stop_bits;    int baudot_shift;        logging_state_t logging;} adsi_tx_state_t;/*!    ADSI receiver descriptor. This contains all the state information for an ADSI    (caller ID, CLASS, CLIP, ACLIP, JCLIP) receive channel. */typedef struct{    put_msg_func_t put_msg;    void *user_data;    int standard;    fsk_rx_state_t fskrx;    dtmf_rx_state_t dtmfrx;    async_rx_state_t asyncrx;        int consecutive_ones;    int bit_pos;    int in_progress;    uint8_t msg[256];    int msg_len;    int baudot_shift;        /*! A count of the framing errors. */    int framing_errors;    logging_state_t logging;} adsi_rx_state_t;#if defined(__cplusplus)extern "C"{#endif/*! \brief Initialise an ADSI receive context.    \param s The ADSI receive context.    \param standard The code for the ADSI standard to be used.    \param put_msg A callback routine called to deliver the received messages           to the application.    \param user_data An opaque pointer for the callback routine.*/void adsi_rx_init(adsi_rx_state_t *s, int standard, put_msg_func_t put_msg, void *user_data);/*! \brief Receive a chunk of ADSI audio.    \param s The ADSI receive context.    \param amp The audio sample buffer.    \param len The number of samples in the buffer.*/void adsi_rx(adsi_rx_state_t *s, const int16_t *amp, int len);/*! \brief Initialise an ADSI transmit context.    \param s The ADSI transmit context.    \param standard The code for the ADSI standard to be used.*/void adsi_tx_init(adsi_tx_state_t *s, int standard);/*! \brief Adjust the preamble associated with an ADSI transmit context.    \param s The ADSI transmit context.    \param preamble_len The number of bits of preamble.    \param preamble_ones_len The number of bits of continuous one before a message.    \param postamble_ones_len The number of bits of continuous one after a message.    \param stop_bits The number of stop bits per character.*/void adsi_tx_set_preamble(adsi_tx_state_t *s,                          int preamble_len,                          int preamble_ones_len,                          int postamble_ones_len,                          int stop_bits);/*! \brief Generate a block of ADSI audio samples.    \param s The ADSI transmit context.    \param amp The audio sample buffer.    \param max_len The number of samples to be generated.    \return The number of samples actually generated.*/int adsi_tx(adsi_tx_state_t *s, int16_t *amp, int max_len);/*! \brief Request generation of an ADSI alert tone.    \param s The ADSI transmit context.*/void adsi_send_alert_tone(adsi_tx_state_t *s);/*! \brief Put a message into the input buffer of an ADSI transmit context.    \param s The ADSI transmit context.    \param msg The message.    \param len The length of the message.    \return The length actually added. If a message is already in progress            in the transmitter, this function will return zero, as it will            not successfully add the message to the buffer.*/int adsi_put_message(adsi_tx_state_t *s, uint8_t *msg, int len);/*! \brief Get a field from an ADSI message.    \param s The ADSI receive context.    \param msg The message buffer.    \param msg_len The length of the message.    \param pos Current position within the message. Set to -1 when starting a message.    \param field_type The type code for the field.    \param field_body Pointer to the body of the field.    \param field_len The length of the field, or -1 for no more fields, or -2 for message structure corrupt.*/int adsi_next_field(adsi_rx_state_t *s, const uint8_t *msg, int msg_len, int pos, uint8_t *field_type, uint8_t const **field_body, int *field_len);/*! \brief Insert the header or a field into an ADSI message.    \param s The ADSI transmit context.    \param msg The message buffer.    \param len The current length of the message.    \param field_type The type code for the new field.    \param field_body Pointer to the body of the new field.    \param field_len The length of the new field.*/int adsi_add_field(adsi_tx_state_t *s, uint8_t *msg, int len, uint8_t field_type, uint8_t const *field_body, int field_len);/*! \brief Return a short name for an ADSI standard    \param standard The code for the standard.    \return A pointer to the name.*/const char *adsi_standard_to_str(int standard);#if defined(__cplusplus)}#endif#endif/*- End of file ------------------------------------------------------------*/

⌨️ 快捷键说明

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