16#include <zephyr/types.h>
18#include <nrf_modem_at.h>
25#define SLM_UART_RESPONSE_DELAY K_MSEC(50)
27#define SLM_DATAMODE_FLAGS_NONE 0
28#define SLM_DATAMODE_FLAGS_MORE_DATA (1 << 0)
29#define SLM_DATAMODE_FLAGS_EXIT_HANDLER (1 << 1)
53 int (*
send)(
const uint8_t *data,
size_t len);
156 uint32_t param_count);
182#define SLM_AT_CMD_CUSTOM(entry, _filter, _callback) \
183 static int _callback(enum at_parser_cmd_type cmd_type, struct at_parser *parser, \
185 static int _callback##_wrapper_##entry(char *buf, size_t len, char *at_cmd) \
187 return slm_at_cb_wrapper(buf, len, at_cmd, _callback); \
189 AT_CMD_CUSTOM(entry, _filter, _callback##_wrapper_##entry);
at_parser_cmd_type
Identifies the type of a given AT command prefix.
Definition: at_parser.h:26
slm_datamode_operation
Operations in data mode.
Definition: slm_at_host.h:37
@ DATAMODE_SEND
Definition: slm_at_host.h:38
@ DATAMODE_EXIT
Definition: slm_at_host.h:39
int slm_at_callback(enum at_parser_cmd_type cmd_type, struct at_parser *parser, uint32_t param_count)
SLM AT command callback type.
Definition: slm_at_host.h:155
bool in_datamode(void)
Check whether SLM AT host is in data mode.
int slm_at_send_str(const char *str)
Identical to slm_at_send(str, strlen(str)).
int slm_at_host_power_off(void)
Turns the current AT backend and UART power off.
int(* slm_datamode_handler_t)(uint8_t op, const uint8_t *data, int len, uint8_t flags)
Data mode sending handler type.
Definition: slm_at_host.h:48
void rsp_send(const char *fmt,...)
Send AT command response.
int slm_at_set_backend(struct slm_at_backend backend)
void rsp_send_ok(void)
Send AT command response of OK.
int slm_at_host_init(void)
Initialize AT host for serial LTE modem.
int slm_at_host_power_on(void)
Counterpart to slm_at_host_power_off().
uint8_t slm_at_buf[4096+1]
void data_send(const uint8_t *data, size_t len)
Send raw data received in data mode.
void rsp_send_error(void)
Send AT command response of ERROR.
int slm_at_send(const uint8_t *data, size_t len)
Sends the given data via the current AT backend.
bool exit_datamode_handler(int result)
Exit the data mode handler.
int enter_datamode(slm_datamode_handler_t handler)
Request SLM AT host to enter data mode.
void slm_at_host_uninit(void)
Uninitialize AT host for serial LTE modem.
uint16_t slm_datamode_time_limit
uint8_t slm_data_buf[NRF_SOCKET_TLS_MAX_MESSAGE_SIZE]
void slm_at_receive(const uint8_t *data, size_t len)
Processes received AT bytes.
int slm_at_cb_wrapper(char *buf, size_t len, char *at_cmd, slm_at_callback cb)
Generic wrapper for a custom SLM AT command callback.
#define SLM_AT_MAX_CMD_LEN
Definition: slm_defines.h:24
#define SLM_MAX_MESSAGE_SIZE
Definition: slm_defines.h:29
AT parser.
Definition: at_parser.h:45
Set of parser variables needed for parser framework to operate.
Definition: parser.h:55
int(* send)(const uint8_t *data, size_t len)
Definition: slm_at_host.h:53
int(* stop)(void)
Definition: slm_at_host.h:54
int(* start)(void)
Definition: slm_at_host.h:52
Definition: slm_at_host.h:51