spandsp: at_interpreter.h File Reference

spandsp 0.0.6

Classes | Typedefs | Enumerations | Functions
at_interpreter.h File Reference

Go to the source code of this file.

## Classes
struct | at_profile_t

## Typedefs
typedef struct at_state_s | at_state_t
typedef int() | at_modem_control_handler_t(at_state_t *s, void *user_data, int op, const char *num)
typedef int() | at_tx_handler_t(at_state_t *s, void *user_data, const uint8_t *buf, size_t len)
typedef int() | at_class1_handler_t(at_state_t *s, void *user_data, int direction, int operation, int val)

## Enumerations
enum | at_rx_mode_e { AT_MODE_ONHOOK_COMMAND , AT_MODE_OFFHOOK_COMMAND , AT_MODE_CONNECTED , AT_MODE_DELIVERY , AT_MODE_HDLC , AT_MODE_STUFFED }
enum | at_call_event_e { AT_CALL_EVENT_ALERTING = 1 , AT_CALL_EVENT_CONNECTED , AT_CALL_EVENT_ANSWERED , AT_CALL_EVENT_BUSY , AT_CALL_EVENT_NO_DIALTONE , AT_CALL_EVENT_NO_ANSWER , AT_CALL_EVENT_HANGUP }
enum | at_modem_control_operation_e { AT_MODEM_CONTROL_CALL , AT_MODEM_CONTROL_ANSWER , AT_MODEM_CONTROL_HANGUP , AT_MODEM_CONTROL_OFFHOOK , AT_MODEM_CONTROL_ONHOOK , AT_MODEM_CONTROL_DTR , AT_MODEM_CONTROL_RTS , AT_MODEM_CONTROL_CTS , AT_MODEM_CONTROL_CAR , AT_MODEM_CONTROL_RNG , AT_MODEM_CONTROL_DSR , AT_MODEM_CONTROL_SETID , AT_MODEM_CONTROL_RESTART , AT_MODEM_CONTROL_DTE_TIMEOUT }
enum | { AT_RESPONSE_CODE_OK = 0 , AT_RESPONSE_CODE_CONNECT , AT_RESPONSE_CODE_RING , AT_RESPONSE_CODE_NO_CARRIER , AT_RESPONSE_CODE_ERROR , AT_RESPONSE_CODE_XXX , AT_RESPONSE_CODE_NO_DIALTONE , AT_RESPONSE_CODE_BUSY , AT_RESPONSE_CODE_NO_ANSWER , AT_RESPONSE_CODE_FCERROR , AT_RESPONSE_CODE_FRH3 }

## Functions
void | at_set_at_rx_mode (at_state_t *s, int new_mode)
void | at_put_response (at_state_t *s, const char *t)
void | at_put_numeric_response (at_state_t *s, int val)
void | at_put_response_code (at_state_t *s, int code)
void | at_reset_call_info (at_state_t *s)
void | at_set_call_info (at_state_t *s, char const *id, char const *value)
| Set the call information for an AT interpreter.
void | at_display_call_info (at_state_t *s)
int | at_modem_control (at_state_t *s, int op, const char *num)
void | at_call_event (at_state_t *s, int event)
void | at_interpreter (at_state_t *s, const char *cmd, int len)
void | at_set_class1_handler (at_state_t *s, at_class1_handler_t handler, void *user_data)
at_state_t * | at_init (at_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, at_modem_control_handler_t *modem_control_handler, void *modem_control_user_data)
| Initialise an AT interpreter context.
int | at_release (at_state_t *s)
| Release an AT interpreter context.
int | at_free (at_state_t *s)
| Free an AT interpreter context.

## Enumeration Type Documentation

## ◆ at_modem_control_operation_e

enum at_modem_control_operation_e

Enumerator
AT_MODEM_CONTROL_CALL | Start an outgoing call.
AT_MODEM_CONTROL_ANSWER | Answer an incoming call.
AT_MODEM_CONTROL_HANGUP | Hangup a call.
AT_MODEM_CONTROL_OFFHOOK | Take the line off hook.
AT_MODEM_CONTROL_ONHOOK | Put the line on hook.
AT_MODEM_CONTROL_DTR | Control V.24 Circuit 108, "data terminal ready".
AT_MODEM_CONTROL_RTS | Control V.24 Circuit 105, "request to send".
AT_MODEM_CONTROL_CTS | Control V.24 Circuit 106, "clear to send".
AT_MODEM_CONTROL_CAR | Control V.24 Circuit 109, "receive line signal detector" (i.e. carrier detect).
AT_MODEM_CONTROL_RNG | Control V.24 Circuit 125, "ring indicator".
AT_MODEM_CONTROL_DSR | Control V.24 Circuit 107, "data set ready".
AT_MODEM_CONTROL_SETID | Set the caller ID for outgoing calls.

## Function Documentation

## ◆ at_free()

int at_free | ( | at_state_t * | s | ) |

Free an AT interpreter context.

Free an AT interpreter context.

Parameters

  s | The AT context.

Returns
  0 for OK

References at_release().

## ◆ at_init()

at_state_t * at_init | ( | at_state_t * | s,
|  | at_tx_handler_t * | at_tx_handler,
|  | void * | at_tx_user_data,
|  | at_modem_control_handler_t * | modem_control_handler,
|  | void * | modem_control_user_data
| ) |  |

Initialise an AT interpreter context.

Initialise an AT interpreter context.

Parameters

  s | The AT context.
  at_tx_handler | x.
  at_tx_user_data | x.
  modem_control_handler | x.
  modem_control_user_data | x.

Returns
  A pointer to the AT context, or NULL if there was a problem.

References at_state_s::logging.

Referenced by t31_init().

## ◆ at_release()

int at_release | ( | at_state_t * | s | ) |

Release an AT interpreter context.

Release an AT interpreter context.

Parameters

  s | The AT context.

Returns
  0 for OK

Referenced by at_free().

## ◆ at_set_call_info()

void at_set_call_info | ( | at_state_t * | s,
|  | char const * | id,
|  | char const * | value
| ) |  |

Set the call information for an AT interpreter.

Set the call information for an AT interpreter.

Parameters

  s | The AT interpreter context.
  id | .
  value | .