You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Introduces the `at_parser` library for parsing AT command responses,
notifications, or events.
It exports an API that lets the user iterate through an AT command
string and retrieve any of its elements based on their indices,
efficiently and without heap allocations.
Under the hood, this library leverages the power of regular
expressions converted to deterministic finite automata by the free
and open-source lexer generator `re2c`.
* In the `at_cmd_parser` library, renames the function
`at_parser_cmd_type_get` to `at_parser_at_cmd_type_get` to prevent
name collisions with the function `at_parser_cmd_type_get` in the
`at_parser` library.
* Deprecates the `at_cmd_parser` library. It will be removed in a future
version.
Signed-off-by: Mirko Covizzi <[email protected]>
Co-authored-by: Bartosz Gentkowski <[email protected]>
The AT parser is a library that parses AT command responses, notifications, and events.
11
+
12
+
Overview
13
+
========
14
+
15
+
The library exports an API that lets the user iterate through an AT command string and retrieve any of its elements based on their indices, efficiently and without heap allocations.
16
+
Under the hood, this library uses regular expressions converted to deterministic finite automata by the free and open-source lexer generator ``re2c``.
17
+
18
+
Configuration
19
+
=============
20
+
21
+
To begin using the AT parser, you first need to initialize it.
22
+
This is done by invoking the :c:func:`at_parser_init` function, where you provide a pointer to the AT parser and the AT command string that needs to be parsed.
23
+
24
+
The following code snippet shows how to initialize the AT parser for an AT command response:
25
+
26
+
.. code-block:: c
27
+
28
+
int err;
29
+
struct at_parser parser;
30
+
const char *at_response = "+CFUN: 1";
31
+
32
+
err = at_parser_init(&parser, at_response);
33
+
if (err) {
34
+
return err;
35
+
}
36
+
37
+
Usage
38
+
=====
39
+
40
+
Based on the type of the element at a given index, you can obtain its value by calling the type-generic macro :c:macro:`at_parser_num_get` for integer values, or the function :c:func:`at_params_string_get` for string values.
41
+
42
+
The following code snippet shows how to retrieve the prefix, a ``uint16_t`` value, and a string value from an AT command response using the AT parser:
Copy file name to clipboardexpand all lines: doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
+19
Original file line number
Diff line number
Diff line change
@@ -482,6 +482,25 @@ Gazell libraries
482
482
Modem libraries
483
483
---------------
484
484
485
+
* Added:
486
+
487
+
* The :ref:`at_parser_readme` library.
488
+
The :ref:`at_parser_readme` is a library that parses AT command responses, notifications, and events.
489
+
Compared to the deprecated :ref:`at_cmd_parser_readme` library, it does not allocate memory dynamically and has a smaller footprint.
490
+
For more information on how to transition from the :ref:`at_cmd_parser_readme` library to the :ref:`at_parser_readme` library, see the :ref:`migration guide <migration_2.8_recommended>`.
491
+
492
+
* :ref:`at_cmd_parser_readme` library:
493
+
494
+
* Deprecated:
495
+
496
+
* The :ref:`at_cmd_parser_readme` library in favor of the :ref:`at_parser_readme` library.
497
+
The :ref:`at_cmd_parser_readme` library will be removed in a future version.
498
+
For more information on how to transition from the :ref:`at_cmd_parser_readme` library to the :ref:`at_parser_readme` library, see the :ref:`migration guide <migration_2.8_recommended>`.
499
+
* The :kconfig:option:`CONFIG_AT_CMD_PARSER`.
500
+
This option will be removed in a future version.
501
+
502
+
* Renamed the :c:func:`at_parser_cmd_type_get` function to :c:func:`at_parser_at_cmd_type_get` to prevent a name collision.
0 commit comments