From 7a146b4de1c26d8f587de310572e356c670cc687 Mon Sep 17 00:00:00 2001 From: Seungjae Yoo Date: Wed, 25 May 2022 05:42:46 +0000 Subject: Add set position API in wmediumd With set position API in wmediumd, we can connect/disconnect wifi connection with distance between stations like real world. Type command "wmediumd_control set_position" to use it. Bug: 230432123 Test: Creating several cuttlefish instance with "launch_cvd", and change X/Y position of station with "wmediumd_control set_position". Then the result could be seen with "wmediumd_control list_stations" and the cuttlefish screen. Change-Id: I0036878bdcd2174a050ac987b015a410ce54e6c8 --- wmediumd/api.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'wmediumd/api.h') diff --git a/wmediumd/api.h b/wmediumd/api.h index ba507e4..8fa8fe0 100644 --- a/wmediumd/api.h +++ b/wmediumd/api.h @@ -70,6 +70,11 @@ enum wmediumd_message { WMEDIUMD_MSG_STOP_PCAP, WMEDIUMD_MSG_STATIONS_LIST, + + /* + * Set position of station. + */ + WMEDIUMD_MSG_SET_POSITION, }; struct wmediumd_message_header { @@ -109,7 +114,7 @@ struct wmediumd_tx_start { }; #pragma pack(push, 1) - struct wmediumd_set_snr { +struct wmediumd_set_snr { /* MAC address of node 1 */ uint8_t node1_mac[6]; /* MAC address of node 2 */ @@ -143,6 +148,15 @@ struct wmediumd_station_infos { uint32_t count; struct wmediumd_station_info stations[0]; }; + +struct wmediumd_set_position { + /* MAC address */ + uint8_t mac[6]; + /* X position of station */ + double x; + /* Y position of station */ + double y; +}; #pragma pack(pop) #endif /* _WMEDIUMD_API_H */ -- cgit v1.2.3