nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
slm_util.h File Reference

Utility functions for serial LTE modem. More...

#include "slm_trap_macros.h"
#include <modem/at_parser.h>
#include <modem/lte_lc.h>
#include <zephyr/logging/log.h>
#include <zephyr/net/socket.h>
#include <stdbool.h>
#include <hal/nrf_gpio.h>

Go to the source code of this file.

struct k_work_q slm_work_q
 
bool slm_is_modem_functional_mode (enum lte_lc_func_mode mode)
 
int slm_power_off_modem (void)
 Puts the modem in minimal function mode.
 
FUNC_NORETURN void slm_reset (void)
 Performs a reset of the SiP.
 
void slm_enter_idle (void)
 
void slm_enter_sleep (void)
 
void slm_enter_shutdown (void)
 
int slm_indicate (void)
 Temporarily sets the indicate pin high.
 
int slm_util_at_printf (const char *fmt,...)
 
int slm_util_at_scanf (const char *cmd, const char *fmt,...)
 
int slm_util_at_cmd_no_intercept (char *buf, size_t len, const char *at_cmd)
 
bool slm_util_casecmp (const char *str1, const char *str2)
 Compare string ignoring case.
 
bool slm_util_hexstr_check (const uint8_t *data, uint16_t data_len)
 Detect hexdecimal string data type.
 
int slm_util_htoa (const uint8_t *hex, uint16_t hex_len, char *ascii, uint16_t ascii_len)
 Encode hex array to hexdecimal string (ASCII text)
 
int slm_util_atoh (const char *ascii, uint16_t ascii_len, uint8_t *hex, uint16_t hex_len)
 Decode hexdecimal string (ASCII text) to hex array.
 
int util_string_get (struct at_parser *parser, size_t index, char *value, size_t *len)
 Get string value from AT command with length check.
 
int util_string_to_float_get (struct at_parser *parser, size_t index, float *value)
 Get float value from string value input in AT command.
 
int util_string_to_double_get (struct at_parser *parser, size_t index, double *value)
 Get double value from string value input in AT command.
 
void util_get_ip_addr (int cid, char addr4[INET_ADDRSTRLEN], char addr6[INET6_ADDRSTRLEN])
 use AT command to get IPv4 and IPv6 addresses for specified PDN
 
int util_str_to_int (const char *str, int base, int *output)
 convert string to integer
 
int util_resolve_host (int cid, const char *host, uint16_t port, int family, struct sockaddr *sa)
 Resolve remote host by host name or IP address.
 
int util_get_peer_addr (struct sockaddr *peer, char addr[static INET6_ADDRSTRLEN], uint16_t *port)
 Get peer IP address and port in printable format.
 

Detailed Description

Utility functions for serial LTE modem.