From 746e831c19772072a3772706754e843efb07b31a Mon Sep 17 00:00:00 2001 From: XiaXiaotian Date: Thu, 27 Dec 2018 21:06:58 +0800 Subject: [PATCH] esp32: fix invalid channel state information(CSI) data index Due to a hardware limitation in ESP32, the first four bytes of some CSI data is invalid, not the last four bytes. Correct a mistake of CSI sub-carrier index in documentation. --- components/esp32/include/esp_wifi_types.h | 2 +- components/esp32/lib | 2 +- docs/en/api-guides/wifi.rst | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/esp32/include/esp_wifi_types.h b/components/esp32/include/esp_wifi_types.h index 2a4d2beb7..e16ca19bd 100644 --- a/components/esp32/include/esp_wifi_types.h +++ b/components/esp32/include/esp_wifi_types.h @@ -405,7 +405,7 @@ typedef struct { typedef struct { wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */ uint8_t mac[6]; /**< source MAC address of the CSI data */ - bool last_word_invalid; /**< last four bytes of the CSI data is invalid or not */ + bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not */ int8_t *buf; /**< buffer of CSI data */ uint16_t len; /**< length of CSI data */ } wifi_csi_info_t; diff --git a/components/esp32/lib b/components/esp32/lib index 8bbce98da..f2f850e50 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 8bbce98da549392214eb852210b50087bb272cc3 +Subproject commit f2f850e5006f4780e5d8b9e1860539b4749d0593 diff --git a/docs/en/api-guides/wifi.rst b/docs/en/api-guides/wifi.rst index 9139e44ce..780e2371f 100644 --- a/docs/en/api-guides/wifi.rst +++ b/docs/en/api-guides/wifi.rst @@ -1458,11 +1458,11 @@ Channel state information (CSI) refers to the channel information of a Wi-Fi con + +--------------------+-------------+-------------+-------------+----------+----------+------+-------------+-------------+----------+----------+--------+-------------+-------------+ | | STBC | non STBC | non STBC | STBC | non STBC | non STBC | STBC | non STBC | STBC | non STBC | non STBC | STBC | non STBC | STBC | +-------------+--------------------+-------------+-------------+-------------+----------+----------+------+-------------+-------------+----------+----------+--------+-------------+-------------+ -| sub-carrier | LLTF | 0~31,-31~-1 | 0~31,-31~-1 | 0~31,-31~-1 | 0~63 | 0~63 | 0~63 | 0~63 | 0~63 | -64~-1 | -64~-1 | -64~-1 | -64~-1 | -64~-1 | +| sub-carrier | LLTF | 0~31,-32~-1 | 0~31,-32~-1 | 0~31,-32~-1 | 0~63 | 0~63 | 0~63 | 0~63 | 0~63 | -64~-1 | -64~-1 | -64~-1 | -64~-1 | -64~-1 | + +--------------------+-------------+-------------+-------------+----------+----------+------+-------------+-------------+----------+----------+--------+-------------+-------------+ -| index | HT-LTF | - | 0~31,-31~-1 | 0~31,-31~-1 | - | 0~63 | 0~62 | 0~63,-64~-1 | 0~60,-60~-1 | - | -64~-1 | -62~-1 | 0~63,-64~-1 | 0~60,-60~-1 | +| index | HT-LTF | - | 0~31,-32~-1 | 0~31,-32~-1 | - | 0~63 | 0~62 | 0~63,-64~-1 | 0~60,-60~-1 | - | -64~-1 | -62~-1 | 0~63,-64~-1 | 0~60,-60~-1 | + +--------------------+-------------+-------------+-------------+----------+----------+------+-------------+-------------+----------+----------+--------+-------------+-------------+ -| | STBC-HT-LTF | - | - | 0~31,-31~-1 | - | - | 0~62 | - | 0~60,-60~-1 | - | - | -62~-1 | - | 0~60,-60~-1 | +| | STBC-HT-LTF | - | - | 0~31,-32~-1 | - | - | 0~62 | - | 0~60,-60~-1 | - | - | -62~-1 | - | 0~60,-60~-1 | +-------------+--------------------+-------------+-------------+-------------+----------+----------+------+-------------+-------------+----------+----------+--------+-------------+-------------+ | total bytes | 128 | 256 | 384 | 128 | 256 | 380 | 384 | 612 | 128 | 256 | 376 | 384 | 612 | +----------------------------------+-------------+-------------+-------------+----------+----------+------+-------------+-------------+----------+----------+--------+-------------+-------------+ @@ -1474,8 +1474,8 @@ All of the information in the table can be found in the structure wifi_csi_info_ - Channel bandwidth refers to cwb field of rx_ctrl field. - STBC refers to stbc field of rx_ctrl field. - Total bytes refers to len field. - - The CSI data corresponding to each Long Training Field type is stored in a buffer starting from the buf field. Each item is stored as two bytes: imaginary part followed by real part. The order is: LLTF, HT-LTF, STBC-HT-LTF. However all 3 items may not be present, depending on the packet type (see above). - - If last_word_invalid field of wifi_csi_info_t is true, it means that the last four bytes of CSI data is invalid due to a hardware limitation in ESP32. + - The CSI data corresponding to each Long Training Field(LTF) type is stored in a buffer starting from the buf field. Each item is stored as two bytes: imaginary part followed by real part. The order of each item is the same as the sub-carrier in the table. The order of LTF is: LLTF, HT-LTF, STBC-HT-LTF. However all 3 LTFs may not be present, depending on the channel and packet information (see above). + - If first_word_invalid field of wifi_csi_info_t is true, it means that the first four bytes of CSI data is invalid due to a hardware limitation in ESP32. - More information like RSSI, noise floor of RF, receiving time and antenna is in the rx_ctrl field. .. note::