Skip to content

Commit 6b3f7e0

Browse files
keever50xiaoxiang781216
authored andcommitted
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 1cd3b3d commit 6b3f7e0

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,48 @@ 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
14+
a common interface across different modulation technologies,
15+
such as LoRa, FSK, and OOK. The result was, driver-specific IOCTL commands
16+
were created even when they could be shared across multiple radios.
17+
This fragmentation made application portability more difficult to maintain.
18+
19+
To solve this issue, groups of commands have been created that are "selected"
20+
by using ``WLIOC_SETMODU``.
21+
See image below for a representation.
22+
23+
.. figure:: wireless_ioctl_white.drawio.png
24+
25+
.. note:: This image does not show all features. This is purely a
26+
representation of command relations under WLIOC_SETMODU.
27+
28+
read()
29+
------
30+
31+
Reading a radio will take a ``wlioc_rx_hdr_s``, where information about the
32+
payload will be read and written to.
33+
34+
- ``FAR uint8_t *payload_buffer`` Pointer to **user buffer**. This is where
35+
the payload will be written to.
36+
- ``size_t payload_length`` **Initially**: User must set this to the size
37+
of ``payload_buffer``. **After reading**: This will become the amount of
38+
bytes written to the ``payload_buffer``.
39+
- ``uint8_t error`` When greater than 0, there are errors detected in the
40+
payload. The payload can still be returned, which allows the user to repair
41+
it if desired.
42+
- ``int32_t rssi_dbm`` The Received Signal Strength Indicator in
43+
1/100 decibel-milliwatts of the received signal.
44+
When unsupported, this returns ``INT32_MIN``.
45+
- ``int32_t snr_db`` The signal to noise ratio in 1/100 decibels of the
46+
received signal. When unsupported, this returns ``INT32_MIN``.
47+
48+
write()
49+
-------
50+
51+
Writing to a radio will attempt to send the given bytes. The radio must be
52+
configured before doing so.
53+
Unlike ``read()``, this will simply take uint8_t bytes as payload.
Loading

0 commit comments

Comments
 (0)