xiaoxiang781216 commented on code in PR #16024:
URL: https://github.com/apache/nuttx/pull/16024#discussion_r2004843090


##########
include/nuttx/wireless/ioctl.h:
##########
@@ -48,67 +48,214 @@
  * the open() interface.
  ****************************************************************************/
 
-#define WLIOC_SETRADIOFREQ  _WLCIOC(0x0001)  /* arg: Pointer to uint32_t, */
-                                             /* frequency value (in MHz) */
-#define WLIOC_GETRADIOFREQ  _WLCIOC(0x0002)  /* arg: Pointer to uint32_t, */
-                                             /* frequency value (in MHz) */
-#define WLIOC_SETADDR       _WLCIOC(0x0003)  /* arg: Pointer to address value, 
format
-                                              * of the address is driver 
specific */
-#define WLIOC_GETADDR       _WLCIOC(0x0004)  /* arg: Pointer to address value, 
format
-                                              * of the address is driver 
specific */
-#define WLIOC_SETTXPOWER    _WLCIOC(0x0005)  /* arg: Pointer to int32_t, */
-                                             /* output power (in 0.01 dBm) */
-#define WLIOC_GETTXPOWER    _WLCIOC(0x0006)  /* arg: Pointer to int32_t, */
-                                             /* output power (in 0.01 dBm) */
+/****************************************************************************
+ * RF common IOCTL commands
+ ****************************************************************************/
+
+/* Offsets */
+
+#define _WLIOC_COM_OFFS 1
+#define _WLIOC_COM(x)   _WLCIOC(_WLIOC_COM_OFFS+x)

Review Comment:
   ```suggestion
   #define _WLIOC_COM(x)          _WLCIOC(_WLIOC_COM_OFFS+x)
   ```



##########
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.
+ * Radios will try to catch only packets with the specified syncword.
+ */
+
+struct wlioc_lora_syncword_s
+{
+  size_t syncword_length;
+  uint8_t *syncword;
+};
+
+/* Common RF types **********************************************************/
+
+/* wlioc_rx_hdr_s gets written to by reading the character device.
+ * Contains information about the payload.
+ */
+
+struct wlioc_rx_hdr_s
+{
+  /* Length of payload in bytes.
+   * The amount written to the
+   * payload buffer
+   */
+
+  size_t payload_length;
+
+  /* Pointer to user buffer
+   * This will be filled in with
+   * the payload
+   */
+
+  uint8_t *payload_buffer;

Review Comment:
   ```suggestion
     FAR uint8_t *payload_buffer;
   ```



##########
include/nuttx/wireless/ioctl.h:
##########
@@ -48,67 +48,214 @@
  * the open() interface.
  ****************************************************************************/
 
-#define WLIOC_SETRADIOFREQ  _WLCIOC(0x0001)  /* arg: Pointer to uint32_t, */
-                                             /* frequency value (in MHz) */
-#define WLIOC_GETRADIOFREQ  _WLCIOC(0x0002)  /* arg: Pointer to uint32_t, */
-                                             /* frequency value (in MHz) */
-#define WLIOC_SETADDR       _WLCIOC(0x0003)  /* arg: Pointer to address value, 
format
-                                              * of the address is driver 
specific */
-#define WLIOC_GETADDR       _WLCIOC(0x0004)  /* arg: Pointer to address value, 
format
-                                              * of the address is driver 
specific */
-#define WLIOC_SETTXPOWER    _WLCIOC(0x0005)  /* arg: Pointer to int32_t, */
-                                             /* output power (in 0.01 dBm) */
-#define WLIOC_GETTXPOWER    _WLCIOC(0x0006)  /* arg: Pointer to int32_t, */
-                                             /* output power (in 0.01 dBm) */
+/****************************************************************************
+ * RF common IOCTL commands
+ ****************************************************************************/
+
+/* Offsets */
+
+#define _WLIOC_COM_OFFS 1

Review Comment:
   let's align _WLIOC_XXX_OFFS to the second column of line 62
   ```suggestion
   #define _WLIOC_COM_OFF        S 1
   ```



-- 
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

Reply via email to