AuroraRAS opened a new pull request, #18510:
URL: https://github.com/apache/nuttx/pull/18510

   ### Summary
   
   This PR modernizes the CC1101 wireless driver by aligning it with the 
unified `wlioc_rx_hdr_s` interface and exposing advanced hardware diagnostic 
modes to userspace.
   
   **Key Changes:**
   
   * **Standardized RX API**: `read()` now strictly expects a `wlioc_rx_hdr_s` 
struct, physically decoupling payload data from RF metadata (RSSI, LQI, CRC 
status).
   * **Lossless RSSI Scaling**: Replaced the legacy right-shift RSSI 
calculation with a pre-multiplication approach (`(rssi * 50) - 7400`). This 
completely eliminates the previous 0.5 dBm precision loss.
   * **Extended Operation Modes**: Implemented a state machine via 
`CC1101IOC_SETOPMODE` to support:
   * `PROMISCUOUS`: Disables `ADDR_CHK` and `CRC_AUTOFLUSH`, retaining 
corrupted packets for RF sniffing and diagnostic tools.
   * `SYNC_SERIAL` / `ASYNC_SERIAL`: Configures `PKTCTRL0` and `IOCFGx` 
registers to bypass the packet handler entirely, routing the raw demodulated 
bitstream to the GDO pins.
   
   
   * **IOCTL Block Fix**: Corrected a dependency error in `ioctl.h` where 
`GS2200M_FIRST` was incorrectly mapped to `SX127X_FIRST` instead of 
`SX126X_FIRST`.
   
   ### Impact
   
   * **Compatibility (Userspace):** **YES** (Breaks backward compatibility). 
Userspace applications interacting with `/dev/radioX` mapped to CC1101 must be 
updated to pass a `struct wlioc_rx_hdr_s` pointer to `read()` instead of a 
standard `char` buffer.
   * **Compatibility (Architecture):** NO.
   * **Security:** NO.
   * **Size:** Minor increase in `.text` footprint due to the new IOCTL switch 
cases and metadata mapping logic.
   
   ### Testing
   
   Verified using a custom userspace validation suite across two CC1101 nodes.
   
   * **Throughput & Reliability**: 100/100 packet delivery rate at 250kbps GFSK 
settings.
   * **API Conformance**: Successfully extracted accurate payload data, 1/100 
dBm RSSI, and SNR/CRC states using the new `wlioc_rx_hdr_s` layout.
   * **Promiscuous Validation**: Injected invalid payloads to trigger hardware 
CRC errors; confirmed that `PROMISCUOUS` mode successfully surfaces the packet 
with `hdr->error = 1` while `NORMAL` mode drops it silently.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to