@@ -6,3 +6,48 @@ Wireless character drivers
6
6
:maxdepth: 1
7
7
8
8
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.
0 commit comments