nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
at_params.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef AT_PARAMS_H__
8#define AT_PARAMS_H__
9
10#include <zephyr/types.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
48};
49
53 int64_t int_val;
55 char *str_val;
57 uint32_t *array_val;
58};
59
61struct at_param {
63 size_t size;
65};
66
76};
77
92int at_params_list_init(struct at_param_list *list, size_t max_params_count);
93
102
111
125int at_params_int_put(const struct at_param_list *list, size_t index, int64_t value);
126
142int at_params_string_put(const struct at_param_list *list, size_t index,
143 const char *str, size_t str_len);
144
164int at_params_array_put(const struct at_param_list *list, size_t index,
165 const uint32_t *array, size_t array_len);
166
180int at_params_empty_put(const struct at_param_list *list, size_t index);
181
194int at_params_size_get(const struct at_param_list *list, size_t index,
195 size_t *len);
196
207int at_params_short_get(const struct at_param_list *list, size_t index,
208 int16_t *value);
209
220int at_params_unsigned_short_get(const struct at_param_list *list, size_t index,
221 uint16_t *value);
222
233int at_params_int_get(const struct at_param_list *list, size_t index,
234 int32_t *value);
235
246int at_params_unsigned_int_get(const struct at_param_list *list, size_t index, uint32_t *value);
247
258int at_params_int64_get(const struct at_param_list *list, size_t index, int64_t *value);
259
277int at_params_string_get(const struct at_param_list *list, size_t index,
278 char *value, size_t *len);
279
295int at_params_string_ptr_get(const struct at_param_list *list, size_t index, const char **at_param,
296 size_t *len);
297
315int at_params_array_get(const struct at_param_list *list, size_t index,
316 uint32_t *array, size_t *len);
317
325uint32_t at_params_valid_count_get(const struct at_param_list *list);
326
336 size_t index);
337
340#ifdef __cplusplus
341}
342#endif
343
344#endif /* AT_PARAMS_H__ */
int at_params_int64_get(const struct at_param_list *list, size_t index, int64_t *value)
Get a parameter value as a signed 64-bit integer number.
int at_params_array_get(const struct at_param_list *list, size_t index, uint32_t *array, size_t *len)
Get a parameter value as an array.
void at_params_list_clear(struct at_param_list *list)
Clear/reset all parameter types and values.
int at_params_unsigned_short_get(const struct at_param_list *list, size_t index, uint16_t *value)
Get a parameter value as an unsigned short number.
int at_params_list_init(struct at_param_list *list, size_t max_params_count)
Create a list of parameters.
int at_params_string_put(const struct at_param_list *list, size_t index, const char *str, size_t str_len)
Add a parameter in the list at the specified index and assign it a string value.
uint32_t at_params_valid_count_get(const struct at_param_list *list)
Get the number of valid parameters in the list.
int at_params_array_put(const struct at_param_list *list, size_t index, const uint32_t *array, size_t array_len)
Add a parameter in the list at the specified index and assign it an array type value.
at_param_type
Parameter types that can be stored.
Definition: at_params.h:37
@ AT_PARAM_TYPE_ARRAY
Definition: at_params.h:45
@ AT_PARAM_TYPE_STRING
Definition: at_params.h:43
@ AT_PARAM_TYPE_EMPTY
Definition: at_params.h:47
@ AT_PARAM_TYPE_NUM_INT
Definition: at_params.h:41
@ AT_PARAM_TYPE_INVALID
Definition: at_params.h:39
int at_params_empty_put(const struct at_param_list *list, size_t index)
Add a parameter in the list at the specified index and assign it an empty status.
int at_params_unsigned_int_get(const struct at_param_list *list, size_t index, uint32_t *value)
Get a parameter value as an unsigned integer number.
int at_params_int_put(const struct at_param_list *list, size_t index, int64_t value)
Add a parameter in the list at the specified index and assign it an integer value.
int at_params_int_get(const struct at_param_list *list, size_t index, int32_t *value)
Get a parameter value as an integer number.
int at_params_string_ptr_get(const struct at_param_list *list, size_t index, const char **at_param, size_t *len)
Get a pointer to the string parameter value.
int at_params_string_get(const struct at_param_list *list, size_t index, char *value, size_t *len)
Get a parameter value as a string.
void at_params_list_free(struct at_param_list *list)
Free a list of parameters.
int at_params_size_get(const struct at_param_list *list, size_t index, size_t *len)
Get the size of a given parameter (in bytes).
enum at_param_type at_params_type_get(const struct at_param_list *list, size_t index)
Get parameter type for parameter at index.
int at_params_short_get(const struct at_param_list *list, size_t index, int16_t *value)
Get a parameter value as a short number.
size_t param_count
Definition: at_params.h:74
struct at_param * params
Definition: at_params.h:75
List of AT parameters that compose an AT command or response.
Definition: at_params.h:73
size_t size
Definition: at_params.h:63
enum at_param_type type
Definition: at_params.h:62
union at_param_value value
Definition: at_params.h:64
A parameter is defined with a type, length and value.
Definition: at_params.h:61
int64_t int_val
Definition: at_params.h:53
uint32_t * array_val
Definition: at_params.h:57
char * str_val
Definition: at_params.h:55
Parameter value.
Definition: at_params.h:51