33
33
* Various events fielded by the wfx_rsi task
34
34
* Make sure that we only use 8 bits (otherwise freeRTOS - may need some changes)
35
35
*/
36
- #define WFX_EVT_STA_CONN (0x01)
37
- #define WFX_EVT_STA_DISCONN (0x02)
38
- #define WFX_EVT_AP_START (0x04)
39
- #define WFX_EVT_AP_STOP (0x08)
40
- #define WFX_EVT_SCAN (0x10) /* This is used as scan result and start */
41
- #define WFX_EVT_STA_START_JOIN (0x20)
42
- #define WFX_EVT_STA_DO_DHCP (0x40)
43
- #define WFX_EVT_STA_DHCP_DONE (0x80)
36
+ typedef enum
37
+ {
38
+ WFX_EVT_STA_CONN = (1 << 0 ),
39
+ WFX_EVT_STA_DISCONN = (1 << 1 ),
40
+ WFX_EVT_AP_START = (1 << 2 ),
41
+ WFX_EVT_AP_STOP = (1 << 3 ),
42
+ WFX_EVT_SCAN = (1 << 4 ), /* This is used as scan result and start */
43
+ WFX_EVT_STA_START_JOIN = (1 << 5 ),
44
+ WFX_EVT_STA_DO_DHCP = (1 << 6 ),
45
+ WFX_EVT_STA_DHCP_DONE = (1 << 7 )
46
+ } WfxEventType_e ;
44
47
45
- #define WFX_RSI_ST_DEV_READY (0x01)
46
- #define WFX_RSI_ST_AP_READY (0x02)
47
- #define WFX_RSI_ST_STA_PROVISIONED (0x04)
48
- #define WFX_RSI_ST_STA_CONNECTING (0x08)
49
- #define WFX_RSI_ST_STA_CONNECTED (0x10)
50
- #define WFX_RSI_ST_STA_DHCP_DONE (0x40) /* Requested to do DHCP after conn */
51
- #define WFX_RSI_ST_STA_MODE (0x80) /* Enable Station Mode */
52
- #define WFX_RSI_ST_AP_MODE (0x100) /* Enable AP Mode */
53
- #define WFX_RSI_ST_STA_READY (WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE)
54
- #define WFX_RSI_ST_STARTED (0x200) /* RSI task started */
55
- #define WFX_RSI_ST_SCANSTARTED (0x400) /* Scan Started */
56
- #define WFX_RSI_ST_SLEEP_READY (0x800) /* Notify the M4 to go to sleep*/
48
+ typedef enum
49
+ {
50
+ WFX_RSI_ST_DEV_READY = (1 << 0 ),
51
+ WFX_RSI_ST_AP_READY = (1 << 1 ),
52
+ WFX_RSI_ST_STA_PROVISIONED = (1 << 2 ),
53
+ WFX_RSI_ST_STA_CONNECTING = (1 << 3 ),
54
+ WFX_RSI_ST_STA_CONNECTED = (1 << 4 ),
55
+ WFX_RSI_ST_STA_DHCP_DONE = (1 << 6 ), /* Requested to do DHCP after conn */
56
+ WFX_RSI_ST_STA_MODE = (1 << 7 ), /* Enable Station Mode */
57
+ WFX_RSI_ST_AP_MODE = (1 << 8 ), /* Enable AP Mode */
58
+ WFX_RSI_ST_STA_READY = (WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE ),
59
+ WFX_RSI_ST_STARTED = (1 << 9 ), /* RSI task started */
60
+ WFX_RSI_ST_SCANSTARTED = (1 << 10 ), /* Scan Started */
61
+ WFX_RSI_ST_SLEEP_READY = (1 << 11 ) /* Notify the M4 to go to sleep*/
62
+ } WfxStateType_e ;
57
63
58
- struct wfx_rsi
64
+ typedef struct wfx_rsi_s
59
65
{
66
+ // TODO: Change tp WfxEventType_e once the event queue is implemented
60
67
EventGroupHandle_t events ;
61
68
TaskHandle_t drv_task ;
62
69
TaskHandle_t wlan_task ;
@@ -77,9 +84,9 @@ struct wfx_rsi
77
84
sl_wfx_mac_address_t ap_bssid ; /* To which our STA is connected */
78
85
uint16_t join_retries ;
79
86
uint8_t ip4_addr [4 ]; /* Not sure if this is enough */
80
- };
87
+ } WfxRsi_t ;
81
88
82
- extern struct wfx_rsi wfx_rsi ;
89
+ extern WfxRsi_t wfx_rsi ;
83
90
#ifdef __cplusplus
84
91
extern "C" {
85
92
#endif
0 commit comments