ubus: introduce enum for beacon measurement mode
authorDavid Bauer <mail@david-bauer.net>
Mon, 18 Oct 2021 11:21:39 +0000 (13:21 +0200)
committerDavid Bauer <mail@david-bauer.net>
Fri, 29 Oct 2021 17:28:08 +0000 (19:28 +0200)
This improves code readability.

Signed-off-by: David Bauer <mail@david-bauer.net>
ubus.c
usteer.h

diff --git a/ubus.c b/ubus.c
index c2e32fd0f1884f78d0f976e4cc21d8908744f8ad..eca728449c6ec7ac6f7837c051002f96daa6c463 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -524,7 +524,7 @@ int usteer_ubus_trigger_client_scan(struct sta_info *si)
 
        blob_buf_init(&b, 0);
        blobmsg_printf(&b, "addr", MAC_ADDR_FMT, MAC_ADDR_DATA(si->sta->addr));
-       blobmsg_add_u32(&b, "mode", 1);
+       blobmsg_add_u32(&b, "mode", BEACON_MEASUREMENT_ACTIVE);
        blobmsg_add_u32(&b, "duration", 65535);
        blobmsg_add_u32(&b, "channel", 255);
        blobmsg_add_u32(&b, "op_class", si->scan_band ? 1 : 12);
index 87ee1f3f4a25d5e29d9173291ecea9d81c394a66..5afc5947065e33aa74a498e4e4c57e7b9925de12 100644 (file)
--- a/usteer.h
+++ b/usteer.h
@@ -60,6 +60,12 @@ enum usteer_sta_connection_state {
        STA_DISCONNECTED = 2,
 };
 
+enum usteer_beacon_measurement_mode {
+       BEACON_MEASUREMENT_PASSIVE = 0,
+       BEACON_MEASUREMENT_ACTIVE = 1,
+       BEACON_MEASUREMENT_TABLE = 2,
+};
+
 struct sta_info;
 struct usteer_local_node;
 struct usteer_remote_host;