Go to the documentation of this file.
81 #if IS_ACTIVE(CONFIG_AT_SEND_EOL_WINDOWS)
82 #define CONFIG_AT_SEND_EOL "\r\n"
83 #elif IS_ACTIVE(CONFIG_AT_SEND_EOL_UNIX)
84 #define CONFIG_AT_SEND_EOL "\n"
85 #elif IS_ACTIVE(CONFIG_AT_SEND_EOL_MAC)
86 #define CONFIG_AT_SEND_EOL "\r"
89 #ifndef CONFIG_AT_SEND_EOL
90 #define CONFIG_AT_SEND_EOL "\r"
98 #define CONFIG_AT_SEND_SKIP_ECHO
108 #if IS_ACTIVE(CONFIG_AT_SEND_SKIP_ECHO)
109 #define AT_SEND_ECHO 0
111 #define AT_SEND_ECHO 1
118 #ifndef AT_RECV_EOL_1
119 #define AT_RECV_EOL_1 "\r"
125 #ifndef AT_RECV_EOL_2
126 #define AT_RECV_EOL_2 "\n"
132 #ifndef CONFIG_AT_RECV_OK
133 #define CONFIG_AT_RECV_OK "OK"
139 #ifndef CONFIG_AT_RECV_ERROR
140 #define CONFIG_AT_RECV_ERROR "ERROR"
143 #if defined(MODULE_AT_URC) || DOXYGEN
153 #ifndef CONFIG_AT_BUF_SIZE_EXP
154 #define CONFIG_AT_BUF_SIZE_EXP (7U)
162 #define AT_BUF_SIZE (1 << CONFIG_AT_BUF_SIZE_EXP)
186 #define AT_SEND_EOL_LEN (sizeof(CONFIG_AT_SEND_EOL) - 1)
196 #ifdef MODULE_AT_URC_ISR
197 bool awaiting_response;
287 size_t len,
bool keep_eol, uint32_t timeout);
317 char *bytes,
size_t *bytes_len,
365 ssize_t
at_readline(
at_dev_t *dev,
char *resp_buf,
size_t len,
bool keep_eol, uint32_t timeout);
391 #if defined(MODULE_AT_URC) || DOXYGEN
void at_send_bytes(at_dev_t *dev, const char *bytes, size_t len)
Send raw bytes to a device.
clist_node_t list_node
node list
Common macros and compiler attributes/pragmas configuration.
int at_send_cmd_wait_prompt(at_dev_t *dev, const char *command, uint32_t timeout)
Send AT command, wait for a prompt.
Unsolicited result code data structure.
void at_dev_poweroff(at_dev_t *dev)
Power device off.
void * arg
optional argument
ssize_t at_recv_bytes(at_dev_t *dev, char *bytes, size_t len, uint32_t timeout)
Receive raw bytes from a 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.
unsigned int uart_t
Define default UART type identifier.
void at_dev_poweron(at_dev_t *dev)
Power device on.
void at_process_urc(at_dev_t *dev, uint32_t timeout)
Process out-of-band data received from the device.
int at_send_cmd(at_dev_t *dev, const char *command, uint32_t timeout)
Send command to device.
Low-level UART peripheral driver interface definition.
uart_t uart
UART device where the AT device is attached.
const char * code
URC string which must match.
void at_remove_urc(at_dev_t *dev, at_urc_t *urc)
Remove an unsolicited response code from the list.
void(* at_urc_cb_t)(void *arg, const char *code)
Unsolicited result code callback.
void at_drain(at_dev_t *dev)
Drain device input buffer.
isrpipe_t isrpipe
isrpipe used for getting data from uart
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.
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.
int at_expect_bytes(at_dev_t *dev, const char *bytes, uint32_t timeout)
Expect bytes from device.
int at_send_cmd_wait_ok(at_dev_t *dev, const char *command, uint32_t timeout)
Simple command helper.
Context structure for isrpipe.
void at_add_urc(at_dev_t *dev, at_urc_t *urc)
Add a callback for an unsolicited response code.
ssize_t at_send_cmd_get_lines(at_dev_t *dev, const char *command, char *resp_buf, size_t len, bool keep_eol, uint32_t timeout)
Send AT command, wait for multiline response.
int at_dev_init(at_dev_t *dev, uart_t uart, uint32_t baudrate, char *buf, size_t bufsize)
Initialize AT device struct.