|
spandsp 3.0.0
|
#include <stdio.h>#include <stdlib.h>#include <inttypes.h>#include <string.h>#include <errno.h>#include <fcntl.h>#include <ctype.h>#include "spandsp/stdbool.h"#include <assert.h>#include "spandsp/telephony.h"#include "spandsp/alloc.h"#include "spandsp/unaligned.h"#include "spandsp/logging.h"#include "spandsp/bit_operations.h"#include "spandsp/async.h"#include "spandsp/hdlc.h"#include "spandsp/v42.h"#include "spandsp/private/logging.h"#include "spandsp/private/hdlc.h"#include "spandsp/private/v42.h"Macros | |
| #define | T_400 750 |
| #define | T_401 1000 |
| #define | T_402 1000 |
| #define | T_403 10000 |
| #define | LAPM_DLCI_DTE_TO_DTE 0 |
| #define | LAPM_DLCI_LAYER2_MANAGEMENT 63 |
| #define | elements(a) |
| #define | LAPM_FRAMETYPE_MASK 0x03 |
| #define | LAPM_S_PF 0x01 |
| #define | LAPM_U_PF 0x10 |
| #define | FI_GENERAL 0x82 |
| #define | GI_PARAM_NEGOTIATION 0x80 |
| #define | GI_PRIVATE_NEGOTIATION 0xF0 |
| #define | GI_USER_DATA 0xFF |
| #define | LAPM_DLCI_DTE_TO_DTE 0 |
| #define | LAPM_DLCI_LAYER2_MANAGEMENT 63 |
Enumerations | |
| enum | { LAPM_FRAMETYPE_I = 0x00 , LAPM_FRAMETYPE_I_ALT = 0x02 , LAPM_FRAMETYPE_S = 0x01 , LAPM_FRAMETYPE_U = 0x03 } |
| enum | { LAPM_S_RR = 0x00 , LAPM_S_RNR = 0x04 , LAPM_S_REJ = 0x08 , LAPM_S_SREJ = 0x0C } |
| enum | { LAPM_U_UI = 0x00 , LAPM_U_DM = 0x0C , LAPM_U_DISC = 0x40 , LAPM_U_UA = 0x60 , LAPM_U_SABME = 0x6C , LAPM_U_FRMR = 0x84 , LAPM_U_XID = 0xAC , LAPM_U_TEST = 0xE0 } |
| enum | { PI_HDLC_OPTIONAL_FUNCTIONS = 0x03 , PI_TX_INFO_MAXSIZE = 0x05 , PI_RX_INFO_MAXSIZE = 0x06 , PI_TX_WINDOW_SIZE = 0x07 , PI_RX_WINDOW_SIZE = 0x08 } |
| enum | { PI_PARAMETER_SET_ID = 0x00 , PI_V42BIS_COMPRESSION_REQUEST = 0x01 , PI_V42BIS_NUM_CODEWORDS = 0x02 , PI_V42BIS_MAX_STRING_LENGTH = 0x03 } |
| enum | { LAPM_DETECT = 0 , LAPM_IDLE = 1 , LAPM_ESTABLISH = 2 , LAPM_DATA = 3 , LAPM_RELEASE = 4 , LAPM_SIGNAL = 5 , LAPM_SETPARM = 6 , LAPM_TEST = 7 , LAPM_V42_UNSUPPORTED = 8 } |
Functions | |
| const char * | lapm_status_to_str (int status) |
| void | lapm_receive (void *user_data, const uint8_t *frame, int len, int ok) |
| void | v42_stop (v42_state_t *ss) |
| void | v42_rx_bit (void *user_data, int bit) |
| int | v42_tx_bit (void *user_data) |
| bool | v42_set_local_busy_status (v42_state_t *s, bool busy) |
| bool | v42_get_far_busy_status (v42_state_t *s) |
| logging_state_t * | v42_get_logging_state (v42_state_t *s) |
| Get the logging context associated with a V.42 context. | |
| void | v42_set_status_callback (v42_state_t *s, span_modem_status_func_t status_handler, void *user_data) |
| void | v42_restart (v42_state_t *s) |
| v42_state_t * | v42_init (v42_state_t *ss, bool calling_party, bool detect, span_get_msg_func_t iframe_get, span_put_msg_func_t iframe_put, void *user_data) |
| int | v42_release (v42_state_t *s) |
| int | v42_free (v42_state_t *s) |
| #define elements | ( | a | ) |
| int v42_free | ( | v42_state_t * | s | ) |
Free a V.42 context.
| s | The V.42 context. |
| bool v42_get_far_busy_status | ( | v42_state_t * | s | ) |
Get the busy status of the far end of a V.42 context.
| s | The V.42 context. |
| logging_state_t * v42_get_logging_state | ( | v42_state_t * | s | ) |
Get the logging context associated with a V.42 context.
Get the logging context associated with a V.42 context.
| s | The V.42 context. |
References v42_state_s::logging.
| v42_state_t * v42_init | ( | v42_state_t * | s, |
| bool | calling_party, | ||
| bool | detect, | ||
| span_get_msg_func_t | iframe_get, | ||
| span_put_msg_func_t | iframe_put, | ||
| void * | user_data ) |
Initialise a V.42 context.
| s | The V.42 context. |
| calling_party | True if caller mode, else answerer mode. |
| detect | True to perform the V.42 detection, else go straight into LAP.M |
| iframe_get | A callback function to handle received frames of data. |
| iframe_put | A callback function to get frames of data for transmission. |
| user_data | An opaque pointer passed to the frame handler routines. |
References v42_state_s::calling_party, v42_state_s::detect, v42_state_s::logging, and v42_state_s::tx_bit_rate.
| int v42_release | ( | v42_state_t * | s | ) |
Release a V.42 context.
| s | The V.42 context. |
| void v42_restart | ( | v42_state_t * | s | ) |
Restart a V.42 context.
| s | The V.42 context. |
References v42_state_s::detect, hdlc_rx_init(), hdlc_tx_init(), and v42_negotiation_t::rx_negotiation_step.
| bool v42_set_local_busy_status | ( | v42_state_t * | s, |
| bool | busy ) |
Set the busy status of the local end of a V.42 context.
| s | The V.42 context. |
| busy | The new local end busy status. |