Skip to content

Commit 3d4f8f2

Browse files
committed
Documentation/components/drivers/character/wireless: IOCTL interface initial documentation.
Adds initial documentation to the IOCTL commands of wireless character devices. Signed-off-by: Kevin Witteveen (MartiniMarter) <[email protected]>
1 parent 82960fd commit 3d4f8f2

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Documentation/components/drivers/character/wireless/index.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,34 @@ Wireless character drivers
66
:maxdepth: 1
77

88
lpwan/index.rst
9+
10+
IOCTL Interface
11+
===============
12+
13+
Before this interface, the IOCTL API for character-driven RF devices lacked a common interface across different modulation technologies,
14+
such as LoRa, FSK, and OOK. The result was, driver-specific IOCTL commands were created even when they could be shared across multiple radios.
15+
This fragmentation made application portability more difficult to maintain.
16+
17+
To solve this issue, groups of commands have been created that are "selected" by using ``WLIOC_SETMODU``.
18+
See image below for a representation.
19+
20+
.. figure:: wireless_ioctl_white.drawio.png
21+
22+
.. note:: This image does not show all features. This is purely a representation of command relations under WLIOC_SETMODU.
23+
24+
read()
25+
------
26+
27+
Reading a radio will take a ``wlioc_rx_hdr_s``, where information about the payload will be read and written to.
28+
29+
- ``FAR uint8_t *payload_buffer`` Pointer to **user buffer**. This is where the payload will be written to.
30+
- ``size_t payload_length`` **Initially**: User must set this to the size of ``payload_buffer``. **After reading**: This will become the amount of bytes written to the ``payload_buffer``.
31+
- ``uint8_t error`` When greater than 0, there are errors detected in the payload. The payload can still be returned, which allows the user to repair it if desired.
32+
- ``int32_t rssi_dbm`` The Received Signal Strength Indicator in 1/100 decibel-milliwatts of the received signal. When unsupported, this returns ``INT32_MIN``.
33+
- ``int32_t snr_db`` The signal to noise ratio in 1/100 decibels of the received signal. When unsupported, this returns ``INT32_MIN``.
34+
35+
write()
36+
-------
37+
38+
Writing to a radio will attempt to send the given bytes. The radio must be configured before doing so.
39+
Unlike ``read()``, this will simply take uint8_t bytes as payload.
Loading

0 commit comments

Comments
 (0)