hartmannathan commented on code in PR #16024: URL: https://github.com/apache/nuttx/pull/16024#discussion_r2006472694
########## Documentation/components/drivers/character/wireless/index.rst: ########## @@ -6,3 +6,34 @@ Wireless character drivers :maxdepth: 1 lpwan/index.rst + +IOCTL Interface +=============== + +Before this interface, the IOCTL API for character-driven RF devices lacked a common interface across different modulation technologies, +such as LoRa, FSK, and OOK. The result was, driver-specific IOCTL commands were created even when they could be shared across multiple radios. +This fragmentation made application portability more difficult to maintain. + +To solve this issue, groups of commands have been created that are "selected" by using ``WLIOC_SETMODU``. +See image below for an representation. Review Comment: ```suggestion See image below for a representation. ``` ########## Documentation/components/drivers/character/wireless/index.rst: ########## @@ -6,3 +6,34 @@ Wireless character drivers :maxdepth: 1 lpwan/index.rst + +IOCTL Interface +=============== + +Before this interface, the IOCTL API for character-driven RF devices lacked a common interface across different modulation technologies, +such as LoRa, FSK, and OOK. The result was, driver-specific IOCTL commands were created even when they could be shared across multiple radios. +This fragmentation made application portability more difficult to maintain. + +To solve this issue, groups of commands have been created that are "selected" by using ``WLIOC_SETMODU``. +See image below for an representation. + +.. figure:: wireless_ioctl_white.drawio.png + +.. note:: This image does not show all features. This is purely a representation of command relations under WLIOC_SETMODU Review Comment: ```suggestion .. note:: This image does not show all features. This is purely a representation of command relations under WLIOC_SETMODU. ``` ########## Documentation/components/drivers/character/wireless/index.rst: ########## @@ -6,3 +6,34 @@ Wireless character drivers :maxdepth: 1 lpwan/index.rst + +IOCTL Interface +=============== + +Before this interface, the IOCTL API for character-driven RF devices lacked a common interface across different modulation technologies, +such as LoRa, FSK, and OOK. The result was, driver-specific IOCTL commands were created even when they could be shared across multiple radios. +This fragmentation made application portability more difficult to maintain. + +To solve this issue, groups of commands have been created that are "selected" by using ``WLIOC_SETMODU``. +See image below for an representation. + +.. figure:: wireless_ioctl_white.drawio.png + +.. note:: This image does not show all features. This is purely a representation of command relations under WLIOC_SETMODU + +read() +------ + +Reading a radio will take a ``wlioc_rx_hdr_s``, where information about the payload will be read and written to. + +- ``FAR uint8_t *payload_buffer`` Pointer to **user buffer**. This is where the payload will be written to. +- ``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``. +- ``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. Review Comment: ```suggestion - ``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. ``` ########## include/nuttx/wireless/ioctl.h: ########## @@ -141,5 +288,78 @@ * Public Types ****************************************************************************/ +/* wlioc_mod_type_e is the RF modualtion technology to be used. */ + +enum wlioc_modulation_e +{ + WLIOC_LORA, + WLIOC_FSK, + WLIOC_GFSK, + WLIOC_OOK +}; + +/* LoRa common types ********************************************************/ + +/* wlioc_lora_cr_e is the coding rate, which is commonly + * supported by LoRa devices to correct errors. + */ + +enum wlioc_lora_cr_e +{ + WLIOC_LORA_CR_4_5 = 0x01, + WLIOC_LORA_CR_4_6 = 0x02, + WLIOC_LORA_CR_4_7 = 0x03, + WLIOC_LORA_CR_4_8 = 0x04 +}; + +/* wlioc_lora_syncword_s is used to seperate lora networks. Review Comment: ```suggestion /* wlioc_lora_syncword_s is used to separate lora networks. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org