diff options
Diffstat (limited to 'tests/unit/stubs')
| -rw-r--r-- | tests/unit/stubs/esp_wifi.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/unit/stubs/esp_wifi.h b/tests/unit/stubs/esp_wifi.h index 6aa5787..5eb14bf 100644 --- a/tests/unit/stubs/esp_wifi.h +++ b/tests/unit/stubs/esp_wifi.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define STUBS_ESP_WIFI_H | 2 | #define STUBS_ESP_WIFI_H |
| 3 | 3 | ||
| 4 | #include <stdint.h> | 4 | #include <stdint.h> |
| 5 | #include <stdbool.h> | ||
| 5 | #include <string.h> | 6 | #include <string.h> |
| 6 | #include "esp_err.h" | 7 | #include "esp_err.h" |
| 7 | 8 | ||
| @@ -37,4 +38,67 @@ static inline esp_err_t esp_wifi_set_config(int ifx, const wifi_config_t *cfg) { | |||
| 37 | static inline esp_err_t esp_wifi_set_mode(uint8_t mode) { (void)mode; return ESP_OK; } | 38 | static inline esp_err_t esp_wifi_set_mode(uint8_t mode) { (void)mode; return ESP_OK; } |
| 38 | static inline esp_err_t esp_wifi_start(void) { return ESP_OK; } | 39 | static inline esp_err_t esp_wifi_start(void) { return ESP_OK; } |
| 39 | 40 | ||
| 41 | #define WIFI_VENDOR_IE_ELEMENT_ID 0xDD | ||
| 42 | |||
| 43 | typedef enum { | ||
| 44 | WIFI_VND_IE_TYPE_BEACON, | ||
| 45 | WIFI_VND_IE_TYPE_PROBE_REQ, | ||
| 46 | WIFI_VND_IE_TYPE_PROBE_RESP, | ||
| 47 | WIFI_VND_IE_TYPE_ASSOC_REQ, | ||
| 48 | WIFI_VND_IE_TYPE_ASSOC_RESP, | ||
| 49 | } wifi_vendor_ie_type_t; | ||
| 50 | |||
| 51 | typedef enum { | ||
| 52 | WIFI_VND_IE_ID_0, | ||
| 53 | WIFI_VND_IE_ID_1, | ||
| 54 | } wifi_vendor_ie_id_t; | ||
| 55 | |||
| 56 | typedef struct { | ||
| 57 | uint8_t element_id; | ||
| 58 | uint8_t length; | ||
| 59 | uint8_t vendor_oui[3]; | ||
| 60 | uint8_t vendor_oui_type; | ||
| 61 | uint8_t payload[0]; | ||
| 62 | } vendor_ie_data_t; | ||
| 63 | |||
| 64 | typedef void (*esp_vendor_ie_cb_t)(void *ctx, wifi_vendor_ie_type_t type, const uint8_t sa[6], const vendor_ie_data_t *vnd_ie, int rssi); | ||
| 65 | |||
| 66 | static inline esp_err_t esp_wifi_set_vendor_ie(bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie) { (void)enable; (void)type; (void)idx; (void)vnd_ie; return ESP_OK; } | ||
| 67 | static inline esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx) { (void)cb; (void)ctx; return ESP_OK; } | ||
| 68 | |||
| 69 | #define WIFI_SCAN_TYPE_PASSIVE 0 | ||
| 70 | |||
| 71 | typedef struct { | ||
| 72 | uint8_t bssid[6]; | ||
| 73 | uint8_t ssid[33]; | ||
| 74 | uint8_t primary; | ||
| 75 | int second; | ||
| 76 | int8_t rssi; | ||
| 77 | int authmode; | ||
| 78 | } wifi_ap_record_t; | ||
| 79 | |||
| 80 | typedef struct { | ||
| 81 | uint8_t *ssid; | ||
| 82 | uint8_t *bssid; | ||
| 83 | uint8_t channel; | ||
| 84 | bool show_hidden; | ||
| 85 | int scan_type; | ||
| 86 | union { | ||
| 87 | struct { int min; int max; } active; | ||
| 88 | int passive; | ||
| 89 | } scan_time; | ||
| 90 | } wifi_scan_config_t; | ||
| 91 | |||
| 92 | static inline esp_err_t esp_wifi_scan_start(const wifi_scan_config_t *cfg, bool block) { (void)cfg; (void)block; return ESP_OK; } | ||
| 93 | static inline esp_err_t esp_wifi_scan_get_ap_num(uint16_t *n) { *n = 0; return ESP_OK; } | ||
| 94 | static inline esp_err_t esp_wifi_scan_get_ap_records(uint16_t *n, wifi_ap_record_t *records) { (void)records; *n = 0; return ESP_OK; } | ||
| 95 | |||
| 96 | #define WIFI_EVENT_SCAN_DONE 3 | ||
| 97 | |||
| 98 | typedef void *esp_event_handler_instance_t; | ||
| 99 | typedef const char *esp_event_base_t; | ||
| 100 | #define WIFI_EVENT "WIFI_EVENT" | ||
| 101 | |||
| 102 | static inline esp_err_t esp_event_handler_instance_register(esp_event_base_t a, int32_t b, void *c, void *d, esp_event_handler_instance_t *e) { (void)a; (void)b; (void)c; (void)d; (void)e; return ESP_OK; } | ||
| 103 | |||
| 40 | #endif | 104 | #endif |