139 #if IS_ACTIVE(CONFIG_AT_SEND_EOL_WINDOWS) 
  140 #define CONFIG_AT_SEND_EOL   "\r\n" 
  141 #elif IS_ACTIVE(CONFIG_AT_SEND_EOL_UNIX) 
  142 #define CONFIG_AT_SEND_EOL   "\n" 
  143 #elif IS_ACTIVE(CONFIG_AT_SEND_EOL_MAC) 
  144 #define CONFIG_AT_SEND_EOL   "\r" 
  147 #ifndef CONFIG_AT_SEND_EOL 
  148 #define CONFIG_AT_SEND_EOL "\r" 
  156 #define CONFIG_AT_SEND_SKIP_ECHO 
  162 #ifndef AT_RECV_EOL_1 
  163 #define AT_RECV_EOL_1   "\r" 
  169 #ifndef AT_RECV_EOL_2 
  170 #define AT_RECV_EOL_2   "\n" 
  176 #define AT_RECV_EOL AT_RECV_EOL_1 AT_RECV_EOL_2 
  181 #ifndef CONFIG_AT_RECV_OK 
  182 #define CONFIG_AT_RECV_OK "OK" 
  188 #ifndef CONFIG_AT_RECV_ERROR 
  189 #define CONFIG_AT_RECV_ERROR "ERROR" 
  193 #if defined(MODULE_AT_URC) || DOXYGEN 
  215 #define AT_ERR_EXTENDED 200 
  218 #define AT_SEND_EOL_LEN  (sizeof(CONFIG_AT_SEND_EOL) - 1) 
  230 #ifdef MODULE_AT_URC_ISR 
  231     bool awaiting_response; 
 
  353                              size_t len, uint32_t timeout);
 
  381                                 char *resp_buf, 
size_t len, uint32_t timeout);
 
  411                                      char *resp_buf, 
size_t len, uint32_t timeout);
 
  440                               size_t len, uint32_t timeout);
 
  482                                char *bytes, 
size_t *bytes_len,
 
  570                                bool keep_eol, uint32_t timeout);
 
  613 #if defined(MODULE_AT_URC) || DOXYGEN 
void at_add_urc(at_dev_t *dev, at_urc_t *urc)
Add a callback for an unsolicited response code.
int at_wait_bytes(at_dev_t *dev, const char *bytes, uint32_t timeout)
Repeatedly calls at_expect_bytes() until a match or timeout occurs.
int at_wait_ok(at_dev_t *dev, uint32_t timeout)
Wait for an OK response.
void at_send_bytes(at_dev_t *dev, const char *bytes, size_t len)
Send raw bytes to a device.
ssize_t at_get_resp_with_prefix(at_dev_t *dev, const char *resp_prefix, char *resp_buf, size_t len, uint32_t timeout)
Wait for a response with a specific prefix.
ssize_t at_send_cmd_get_resp(at_dev_t *dev, const char *command, char *resp_buf, size_t len, uint32_t timeout)
Send AT command, wait for response.
void at_process_urc(at_dev_t *dev, uint32_t timeout)
Process out-of-band data received from the device.
ssize_t at_recv_bytes(at_dev_t *dev, char *bytes, size_t len, uint32_t timeout)
Receive raw bytes from a device.
int at_send_cmd(at_dev_t *dev, const char *command, uint32_t timeout)
Send command to device.
int at_send_cmd_wait_ok(at_dev_t *dev, const char *command, uint32_t timeout)
Simple command helper.
void(* at_urc_cb_t)(void *arg, const char *code)
Unsolicited result code callback.
void at_dev_poweroff(at_dev_t *dev)
Power device off.
ssize_t at_send_cmd_get_resp_wait_ok(at_dev_t *dev, const char *command, const char *resp_prefix, char *resp_buf, size_t len, uint32_t timeout)
Send AT command, wait for response plus OK.
int at_expect_bytes(at_dev_t *dev, const char *bytes, uint32_t timeout)
Expect bytes from device.
ssize_t at_readline(at_dev_t *dev, char *resp_buf, size_t len, bool keep_eol, uint32_t timeout)
Read a line from device.
ssize_t at_send_cmd_get_lines(at_dev_t *dev, const char *command, char *resp_buf, size_t len, uint32_t timeout)
Send AT command, wait for multiline response.
static char const  * at_get_err_info(at_dev_t const *dev)
Get extended error information of the last command sent.
int at_recv_bytes_until_string(at_dev_t *dev, const char *string, char *bytes, size_t *bytes_len, uint32_t timeout)
Receives bytes into bytes buffer until the string pattern string is received or the buffer is full.
int at_send_cmd_wait_prompt(at_dev_t *dev, const char *command, uint32_t timeout)
Send AT command, wait for a prompt.
int at_parse_resp(at_dev_t *dev, char const *resp)
Parse a response from the device.
ssize_t at_readline_skip_empty(at_dev_t *dev, char *resp_buf, size_t len, bool keep_eol, uint32_t timeout)
Read a line from device, skipping a possibly empty line.
void at_postprocess_urc(at_dev_t *dev, char *buf)
Process one URC from the provided buffer.
void at_drain(at_dev_t *dev)
Drain device input buffer.
int at_dev_init(at_dev_t *dev, at_dev_init_t const *init)
Initialize AT device struct.
int at_wait_prompt(at_dev_t *dev, uint32_t timeout)
Waits for the prompt character (>).
void at_postprocess_urc_all(at_dev_t *dev, char *buf)
Process all URCs from the provided buffer.
void at_remove_urc(at_dev_t *dev, at_urc_t *urc)
Remove an unsolicited response code from the list.
void at_dev_poweron(at_dev_t *dev)
Power device on.
uint_fast8_t uart_t
Define default UART type identifier.
Common macros and compiler attributes/pragmas configuration.
AT device initialization parameters.
char * rp_buf
Response parsing buffer - used for classifying DCE responses and holding detailed error information.
size_t rp_buf_size
response parsing buffer size
uint32_t baudrate
UART device baudrate.
uart_t uart
UART device where the AT device is attached.
char * rx_buf
UART rx buffer.
size_t rx_buf_size
UART rx buffer size.
uart_t uart
UART device where the AT device is attached.
isrpipe_t isrpipe
isrpipe used for getting data from uart
size_t rp_buf_size
response parsing buffer size
char * rp_buf
response parsing buffer
Unsolicited result code data structure.
clist_node_t list_node
node list
void * arg
optional argument
const char * code
URC string which must match.
Context structure for isrpipe.
Low-level UART peripheral driver interface definition.