Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf_modem: doc: cleanup function references #42

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

.. _`coex interface of nRF9160`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf9160%2Fip%2Fradio_lte%2Fdoc%2Fmagpio_if.html

.. _`Revision Identification +CGMR`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/general/cgmr.html

.. ### Source: www.nordicsemi.com

.. _`nRF9160 modem firmware zip file`: https://www.nordicsemi.com/Products/Low-power-cellular-IoT/nRF9160/Download#0B34B59935AF4AFCB7AB93E9646C1F53
Expand Down Expand Up @@ -106,3 +108,7 @@
.. _`nRF Connect for Desktop`: https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-Desktop

.. _`nPM1300 Evaluation Kit`: https://infocenter.nordicsemi.com/

.. _`Wireshark`: https://www.wireshark.org/

.. _`3GPP TS 24.301 Technical Specification`: https://www.3gpp.org/DynaReport/24301.htm
20 changes: 20 additions & 0 deletions nrf_modem/doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ Changelog

All notable changes to this project are documented in this file.

nrf_modem 2.6.0
***************

Core library
============

* Added the :c:func:`nrf_modem_os_mutex_init`, :c:func:`nrf_modem_os_mutex_lock` and :c:func:`nrf_modem_os_mutex_unlock` functions to the OS requirements.

AT interface
============

* Added the CFUN handler for getting callbacks on functional mode changes.

sockets
=======

* Deprecated the ``nrf_sec_cipher_t``, ``nrf_sec_peer_verify_t``, ``nrf_sec_role_t``, and ``nrf_sec_session_cache_t`` types. Use ``int`` instead.
* Deprecated the RAI socket options :c:macro:`NRF_SO_RAI_NO_DATA`, :c:macro:`NRF_SO_RAI_LAST`, :c:macro:`NRF_SO_RAI_ONE_RESP`, :c:macro:`NRF_SO_RAI_ONGOING`, and :c:macro:`NRF_SO_RAI_WAIT_MORE`.
* Added the RAI socket option :c:macro:`NRF_SO_RAI` and the values :c:macro:`NRF_RAI_NO_DATA`, :c:macro:`NRF_RAI_LAST`, :c:macro:`NRF_RAI_ONE_RESP`, :c:macro:`NRF_RAI_ONGOING`, and :c:macro:`NRF_RAI_WAIT_MORE`.

nrf_modem 2.5.0
***************

Expand Down
2 changes: 1 addition & 1 deletion nrf_modem/doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Socket polling API
******************

Necessary data types and defines to poll for
events on one or more sockets using nrf_poll().
events on one or more sockets using :c:func:`nrf_poll`.

.. doxygengroup:: nrf_socket_api_poll
:project: nrfxlib
Expand Down
32 changes: 32 additions & 0 deletions nrf_modem/doc/at_interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,38 @@ In this case, the application need not provide any intermediate buffers and can
Conversely, :c:func:`nrf_modem_at_cmd` is the only function in the AT interface that copies the whole response of the modem from the shared memory into the provided input buffer, which is owned by the application.
Therefore, this function can be used when the application needs the whole AT command response, as received from the modem, or in those cases when the stack requirements of :c:func:`nrf_modem_at_scanf` are too high for the calling thread, or when parsing the response using a :c:func:`scanf` format is hard.

CFUN handler
************

The Modem library allows the application to be notified on functional mode changes in the modem by adding a CFUN handler through the :c:func:`nrf_modem_at_cfun_handler_set` function.
The handler is called after an CFUN AT command is successfully processed by the modem.

.. note::
The CFUN handler is not supported with :c:func:`nrf_modem_at_cmd_async`.

.. note::
After the CFUN handler is done processing the event, it must call :c:func:`nrf_modem_at_cfun_handler_completed` to notify the modem library that the event is complete.

The following code snippet shows how to define and set a CFUN handler:

.. code-block:: c

static void cfun_callback(int mode)
{
printk("CFUN changed to %d\n", mode);

if (mode == 0) {
/* Resubscribe to network registration status notifications. */
nrf_modem_at_printf("AT+CEREG=1");
}
}

nrf_modem_at_cfun_handler_set(cfun_callback);

.. important::
If you are building an |NCS| application, do not use the :c:func:`nrf_modem_at_cfun_handler_set` function to register your callback.
Instead, use the :c:macro:`NRF_MODEM_LIB_ON_CFUN` macro to register to functional mode changes where you need them in your application, to ensure compatibility with other |NCS| libraries.

Custom AT commands
******************

Expand Down
12 changes: 6 additions & 6 deletions nrf_modem/doc/fault_handling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ The application can reinitialize the modem by reinitializing the Modem library t
.. important::
If modem traces are enabled, the modem continues to output trace data (a coredump) in the event of a fault, even after signaling the fault to the application.
To make sure the application is able to retrieve the coredump correctly, the application must not re-initialize the modem until all the outstanding trace data has been processed.
The :c:func:`nrf_modem_trace_get()` function will return ``-ENODATA`` when all outstanding trace data has been processed by the application.
The :c:func:`nrf_modem_trace_get` function will return negative :c:macro:`NRF_ENODATA` when all outstanding trace data has been processed by the application.

When the Modem library is used in |NCS|, the :ref:`nrf_modem_lib_readme` handles synchronizing modem re-initialization with tracing operations.

Networking sockets
******************

Socket APIs that require communication with the modem, return ``-1`` and set ``errno`` to ``NRF_ESHUTDOWN`` if the modem has crashed or if it is uninitialized.
Socket APIs that require communication with the modem, return ``-1`` and set ``errno`` to :c:macro:`NRF_ESHUTDOWN` if the modem has crashed or if it is uninitialized.

Although the modem has crashed, any data which was stored by the Modem library, including data that was delivered to the Modem library by the modem, remains available until the Modem library is shut down.
This includes incoming network data, which was received before the crash but has not been read by the application.
The application can read that data as normal, using the :c:func:`recv` function.
When no more data is available, the :c:func:`recv` function returns ``-1`` and sets ``errno`` to ``NRF_ESHUTDOWN``.
The application can read that data as normal, using the :c:func:`nrf_recv` and the :c:func:`nrf_recvfrom` functions.
When no more data is available, the :c:func:`nrf_recv` and the :c:func:`nrf_recvfrom` functions return ``-1`` and set ``errno`` to :c:macro:`NRF_ESHUTDOWN`.

Ongoing API calls
*****************
Expand All @@ -57,5 +57,5 @@ When the Modem library detects that a fault has occurred in the modem, it immedi

Following are the two categories of APIs in the Modem library and their behavior after a modem fault:

* Socket APIs - Exit immediately returning ``-1`` and sets errno to ``NRF_ESHUTDOWN``
* Non-Socket APIs - Exit immediately returning ``-NRF_ESHUTDOWN``
* Socket APIs - Exit immediately returning ``-1`` and set ``errno`` to :c:macro:`NRF_ESHUTDOWN`.
* Non-Socket APIs - Exit immediately returning negative :c:macro:`NRF_ESHUTDOWN`.
2 changes: 1 addition & 1 deletion nrf_modem/doc/modem_trace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Tracing and modem faults

When a fault occurs in the modem and traces are enabled, the modem will send a coredump using the trace interface.
The :c:func:`nrf_modem_trace_get` function returns trace fragments until there are no more fragments to process.
In the case where there are no more trace fragments after a modem coredump is complete, the :c:func:`nrf_modem_trace_get` function returns ``-NRF_ENODATA`` as shown in the following figure:
In the case where there are no more trace fragments after a modem coredump is complete, the :c:func:`nrf_modem_trace_get` function returns negative :c:macro:`NRF_ENODATA` as shown in the following figure:

.. figure:: images/nrf_modem_trace_sequence_coredump.svg
:alt: Modem library coredump trace sequence
Expand Down
Loading