40#define MM_PACKED __attribute__((packed))
53 MMAGIC_SECURITY_TYPE_SAE = 0,
55 MMAGIC_SECURITY_TYPE_OWE = 1,
57 MMAGIC_SECURITY_TYPE_OPEN = 2,
64 MMAGIC_PMF_MODE_REQUIRED = 0,
66 MMAGIC_PMF_MODE_DISABLED = 1,
73 MMAGIC_POWER_SAVE_MODE_DISABLED = 0,
75 MMAGIC_POWER_SAVE_MODE_ENABLED = 1,
82 MMAGIC_MCS10_MODE_DISABLED = 0,
84 MMAGIC_MCS10_MODE_FORCED = 1,
86 MMAGIC_MCS10_MODE_AUTO = 2,
93 MMAGIC_DUTY_CYCLE_MODE_SPREAD = 0,
95 MMAGIC_DUTY_CYCLE_MODE_BURST = 1,
102 MMAGIC_STATION_TYPE_SENSOR = 0,
104 MMAGIC_STATION_TYPE_NON_SENSOR = 1,
111 MMAGIC_STATUS_OK = 0,
113 MMAGIC_STATUS_ERROR = 1,
115 MMAGIC_STATUS_INVALID_ARG = 2,
117 MMAGIC_STATUS_UNAVAILABLE = 3,
119 MMAGIC_STATUS_TIMEOUT = 4,
121 MMAGIC_STATUS_INVALID_STREAM = 5,
123 MMAGIC_STATUS_NOT_FOUND = 6,
125 MMAGIC_STATUS_NOT_SUPPORTED = 7,
127 MMAGIC_STATUS_TX_ERROR = 8,
129 MMAGIC_STATUS_NO_MEM = 9,
131 MMAGIC_STATUS_CLOSED = 10,
133 MMAGIC_STATUS_CHANNEL_LIST_NOT_SET = 11,
135 MMAGIC_STATUS_SHUTDOWN_BLOCKED = 12,
137 MMAGIC_STATUS_CHANNEL_INVALID = 13,
139 MMAGIC_STATUS_NOT_RUNNING = 14,
141 MMAGIC_STATUS_NO_LINK = 15,
143 MMAGIC_STATUS_UNKNOWN_HOST = 16,
145 MMAGIC_STATUS_SOCKET_FAILED = 17,
147 MMAGIC_STATUS_SOCKET_CONNECT_FAILED = 18,
149 MMAGIC_STATUS_SOCKET_BIND_FAILED = 19,
151 MMAGIC_STATUS_SOCKET_LISTEN_FAILED = 20,
153 MMAGIC_STATUS_NTP_KOD_RECEIVED = 21,
155 MMAGIC_STATUS_NTP_KOD_BACKOFF_RECEIVED = 22,
157 MMAGIC_STATUS_SOCKET_SEND_FAILED = 23,
160 MMAGIC_STATUS_INVALID_CREDENTIALS = 24,
162 MMAGIC_STATUS_HANDSHAKE_FAILED = 25,
164 MMAGIC_STATUS_AUTHENTICATION_FAILED = 26,
167 MMAGIC_STATUS_MISSING_CREDENTIALS = 27,
170 MMAGIC_STATUS_TIME_NOT_SYNCHRONIZED = 28,
172 MMAGIC_STATUS_MQTT_REFUSED = 29,
174 MMAGIC_STATUS_MQTT_KEEPALIVE_TIMEOUT = 30,
176 MMAGIC_STATUS_NOT_INITIALIZED = 31,
178 MMAGIC_STATUS_BAD_VERSION = 32,
180 MMAGIC_STATUS_DPP_PB_ERROR = 33,
182 MMAGIC_STATUS_DPP_PB_SESSION_OVERLAP = 34,
189 MMAGIC_IPERF_MODE_UDP_SERVER = 0,
191 MMAGIC_IPERF_MODE_TCP_SERVER = 1,
193 MMAGIC_IPERF_MODE_UDP_CLIENT = 2,
195 MMAGIC_IPERF_MODE_TCP_CLIENT = 3,
202 MMAGIC_IPERF_STATE_NOT_STARTED = 0,
204 MMAGIC_IPERF_STATE_RUNNING = 1,
206 MMAGIC_IPERF_STATE_FINISHED = 2,
208 MMAGIC_IPERF_STATE_ABORTED = 3,
215 MMAGIC_IP_LINK_STATE_DOWN = 0,
217 MMAGIC_IP_LINK_STATE_UP = 1,
224 MMAGIC_DEEP_SLEEP_MODE_DISABLED = 0,
226 MMAGIC_DEEP_SLEEP_MODE_ONE_SHOT = 1,
228 MMAGIC_DEEP_SLEEP_MODE_HARDWARE = 2,
235 MMAGIC_STA_STATE_DISCONNECTED = 1,
237 MMAGIC_STA_STATE_CONNECTING = 2,
239 MMAGIC_STA_STATE_CONNECTED = 3,
246 MMAGIC_STA_EVENT_SCAN_REQUEST = 0,
248 MMAGIC_STA_EVENT_SCAN_COMPLETE = 1,
250 MMAGIC_STA_EVENT_SCAN_ABORT = 2,
252 MMAGIC_STA_EVENT_AUTH_REQUEST = 3,
254 MMAGIC_STA_EVENT_ASSOC_REQUEST = 4,
256 MMAGIC_STA_EVENT_DEAUTH_TX = 5,
258 MMAGIC_STA_EVENT_CTRL_PORT_OPEN = 6,
260 MMAGIC_STA_EVENT_CTRL_PORT_CLOSED = 7,
267 MMAGIC_SOCKET_PROTO_TCP = 0,
269 MMAGIC_SOCKET_PROTO_UDP = 1,
276 MMAGIC_SUBSYSTEM_ID_HOST = 0,
278 MMAGIC_SUBSYSTEM_ID_MAC = 1,
280 MMAGIC_SUBSYSTEM_ID_PHY = 2,
282 MMAGIC_SUBSYSTEM_ID_UMAC = 3,
357 char country_code[3];
543struct mmagic_controller;
570#define MMAGIC_CONTROLLER_ARGS_INIT { 0 }
600#define CONTROL_STREAM 0
603#define MMAGIC_CONTROLLER_DEFAULT_RESPONSE_TIMEOUT_MS 1000
607#define MMAGIC_CONTROLLER_DEFAULT_COMMIT_RESPONSE_TIMEOUT_MS 12000
625 uint8_t submodule_id,
627 uint8_t subcommand_id,
628 const uint8_t *buffer,
629 size_t buffer_length);
649 uint8_t submodule_id,
651 uint8_t subcommand_id,
653 size_t buffer_length,
654 uint32_t timeout_ms);
668 uint32_t timeout_ms);
1090 struct mmagic_controller *controller,
1101 if (status != MMAGIC_STATUS_OK)
1127 struct mmagic_controller *controller,
1138 if (status != MMAGIC_STATUS_OK)
1164 struct mmagic_controller *controller,
1175 if (status != MMAGIC_STATUS_OK)
1201 struct mmagic_controller *controller,
1206 var_val.
len = strlen(var);
1207 if (var_val.
len >
sizeof(var_val.
data) - 1)
1209 return MMAGIC_STATUS_INVALID_ARG;
1211 memcpy(var_val.
data, (
const uint8_t *)var, var_val.
len);
1212 memset(var_val.
data + var_val.
len, 0,
sizeof(var_val.
data) - var_val.
len);
1218 (uint8_t *)&var_val,
1220 if (status != MMAGIC_STATUS_OK)
1246 struct mmagic_controller *controller,
1257 if (status != MMAGIC_STATUS_OK)
1283 struct mmagic_controller *controller,
1288 var_val.
len = strlen(var);
1289 if (var_val.
len >
sizeof(var_val.
data) - 1)
1291 return MMAGIC_STATUS_INVALID_ARG;
1293 memcpy(var_val.
data, (
const uint8_t *)var, var_val.
len);
1294 memset(var_val.
data + var_val.
len, 0,
sizeof(var_val.
data) - var_val.
len);
1300 (uint8_t *)&var_val,
1302 if (status != MMAGIC_STATUS_OK)
1328 struct mmagic_controller *controller,
1339 if (status != MMAGIC_STATUS_OK)
1365 struct mmagic_controller *controller,
1376 if (status != MMAGIC_STATUS_OK)
1402 struct mmagic_controller *controller,
1413 if (status != MMAGIC_STATUS_OK)
1439 struct mmagic_controller *controller,
1450 if (status != MMAGIC_STATUS_OK)
1476 struct mmagic_controller *controller,
1487 if (status != MMAGIC_STATUS_OK)
1513 struct mmagic_controller *controller,
1524 if (status != MMAGIC_STATUS_OK)
1550 struct mmagic_controller *controller,
1561 if (status != MMAGIC_STATUS_OK)
1587 struct mmagic_controller *controller,
1598 if (status != MMAGIC_STATUS_OK)
1624 struct mmagic_controller *controller,
1635 if (status != MMAGIC_STATUS_OK)
1661 struct mmagic_controller *controller,
1672 if (status != MMAGIC_STATUS_OK)
1698 struct mmagic_controller *controller,
1709 if (status != MMAGIC_STATUS_OK)
1735 struct mmagic_controller *controller,
1746 if (status != MMAGIC_STATUS_OK)
1772 struct mmagic_controller *controller,
1783 if (status != MMAGIC_STATUS_OK)
1809 struct mmagic_controller *controller,
1820 if (status != MMAGIC_STATUS_OK)
1846 struct mmagic_controller *controller,
1857 if (status != MMAGIC_STATUS_OK)
1883 struct mmagic_controller *controller,
1894 if (status != MMAGIC_STATUS_OK)
1920 struct mmagic_controller *controller,
1931 if (status != MMAGIC_STATUS_OK)
1957 struct mmagic_controller *controller,
1968 if (status != MMAGIC_STATUS_OK)
1994 struct mmagic_controller *controller,
2005 if (status != MMAGIC_STATUS_OK)
2031 struct mmagic_controller *controller,
2042 if (status != MMAGIC_STATUS_OK)
2069 struct mmagic_controller *controller,
2080 if (status != MMAGIC_STATUS_OK)
2107 struct mmagic_controller *controller,
2118 if (status != MMAGIC_STATUS_OK)
2144 struct mmagic_controller *controller,
2155 if (status != MMAGIC_STATUS_OK)
2181 struct mmagic_controller *controller,
2192 if (status != MMAGIC_STATUS_OK)
2222 struct mmagic_controller *controller,
2233 if (status != MMAGIC_STATUS_OK)
2263 struct mmagic_controller *controller,
2274 if (status != MMAGIC_STATUS_OK)
2303 struct mmagic_controller *controller,
2314 if (status != MMAGIC_STATUS_OK)
2343 struct mmagic_controller *controller,
2354 if (status != MMAGIC_STATUS_OK)
2381 struct mmagic_controller *controller,
2392 if (status != MMAGIC_STATUS_OK)
2419 struct mmagic_controller *controller,
2430 if (status != MMAGIC_STATUS_OK)
2458 struct mmagic_controller *controller,
2469 if (status != MMAGIC_STATUS_OK)
2497 struct mmagic_controller *controller,
2508 if (status != MMAGIC_STATUS_OK)
2536 struct mmagic_controller *controller,
2547 if (status != MMAGIC_STATUS_OK)
2575 struct mmagic_controller *controller,
2586 if (status != MMAGIC_STATUS_OK)
2616 struct mmagic_controller *controller,
2627 if (status != MMAGIC_STATUS_OK)
2657 struct mmagic_controller *controller,
2662 var_val.
len = strlen(var);
2663 if (var_val.
len >
sizeof(var_val.
data) - 1)
2665 return MMAGIC_STATUS_INVALID_ARG;
2667 memcpy(var_val.
data, (
const uint8_t *)var, var_val.
len);
2668 memset(var_val.
data + var_val.
len, 0,
sizeof(var_val.
data) - var_val.
len);
2674 (uint8_t *)&var_val,
2676 if (status != MMAGIC_STATUS_OK)
2706 struct mmagic_controller *controller,
2717 if (status != MMAGIC_STATUS_OK)
2747 struct mmagic_controller *controller,
2752 var_val.
len = strlen(var);
2753 if (var_val.
len >
sizeof(var_val.
data) - 1)
2755 return MMAGIC_STATUS_INVALID_ARG;
2757 memcpy(var_val.
data, (
const uint8_t *)var, var_val.
len);
2758 memset(var_val.
data + var_val.
len, 0,
sizeof(var_val.
data) - var_val.
len);
2764 (uint8_t *)&var_val,
2766 if (status != MMAGIC_STATUS_OK)
2796 struct mmagic_controller *controller,
2807 if (status != MMAGIC_STATUS_OK)
2837 struct mmagic_controller *controller,
2842 var_val.
len = strlen(var);
2843 if (var_val.
len >
sizeof(var_val.
data) - 1)
2845 return MMAGIC_STATUS_INVALID_ARG;
2847 memcpy(var_val.
data, (
const uint8_t *)var, var_val.
len);
2848 memset(var_val.
data + var_val.
len, 0,
sizeof(var_val.
data) - var_val.
len);
2854 (uint8_t *)&var_val,
2856 if (status != MMAGIC_STATUS_OK)
2886 struct mmagic_controller *controller,
2897 if (status != MMAGIC_STATUS_OK)
2927 struct mmagic_controller *controller,
2932 var_val.
len = strlen(var);
2933 if (var_val.
len >
sizeof(var_val.
data) - 1)
2935 return MMAGIC_STATUS_INVALID_ARG;
2937 memcpy(var_val.
data, (
const uint8_t *)var, var_val.
len);
2938 memset(var_val.
data + var_val.
len, 0,
sizeof(var_val.
data) - var_val.
len);
2944 (uint8_t *)&var_val,
2946 if (status != MMAGIC_STATUS_OK)
2975 struct mmagic_controller *controller,
2986 if (status != MMAGIC_STATUS_OK)
3015 struct mmagic_controller *controller,
3026 if (status != MMAGIC_STATUS_OK)
3053 struct mmagic_controller *controller,
3064 if (status != MMAGIC_STATUS_OK)
3091 struct mmagic_controller *controller,
3102 if (status != MMAGIC_STATUS_OK)
3130 struct mmagic_controller *controller,
3141 if (status != MMAGIC_STATUS_OK)
3169 struct mmagic_controller *controller,
3180 if (status != MMAGIC_STATUS_OK)
3207 struct mmagic_controller *controller,
3218 if (status != MMAGIC_STATUS_OK)
3245 struct mmagic_controller *controller,
3256 if (status != MMAGIC_STATUS_OK)
3279 struct mmagic_controller *controller)
3289 if (status != MMAGIC_STATUS_OK)
3323 struct mmagic_controller *controller,
3331 if (UINT32_MAX - response_timeout_ms >= cmd_args->
timeout)
3333 response_timeout_ms += cmd_args->
timeout;
3337 response_timeout_ms = UINT32_MAX;
3345 (uint8_t *)cmd_args,
3347 if (status != MMAGIC_STATUS_OK)
3358 response_timeout_ms);
3370 struct mmagic_controller *controller)
3383 if (status != MMAGIC_STATUS_OK)
3394 response_timeout_ms);
3427 struct mmagic_controller *controller,
3436 if (UINT32_MAX - response_timeout_ms >= cmd_args->
timeout)
3438 response_timeout_ms += cmd_args->
timeout;
3442 response_timeout_ms = UINT32_MAX;
3450 (uint8_t *)cmd_args,
3452 if (status != MMAGIC_STATUS_OK)
3461 (uint8_t *)rsp_args,
3463 response_timeout_ms);
3485 struct mmagic_controller *controller,
3499 if (status != MMAGIC_STATUS_OK)
3508 (uint8_t *)rsp_args,
3510 response_timeout_ms);
3532 struct mmagic_controller *controller,
3546 if (status != MMAGIC_STATUS_OK)
3555 (uint8_t *)rsp_args,
3557 response_timeout_ms);
3577 struct mmagic_controller *controller,
3589 (uint8_t *)cmd_args,
3591 if (status != MMAGIC_STATUS_OK)
3602 response_timeout_ms);
3623 struct mmagic_controller *controller,
3635 (uint8_t *)cmd_args,
3637 if (status != MMAGIC_STATUS_OK)
3648 response_timeout_ms);
3660 struct mmagic_controller *controller)
3673 if (status != MMAGIC_STATUS_OK)
3684 response_timeout_ms);
3706 struct mmagic_controller *controller,
3711 uint32_t response_timeout_ms = 3000;
3720 if (status != MMAGIC_STATUS_OK)
3729 (uint8_t *)rsp_args,
3731 response_timeout_ms);
3745 struct mmagic_controller *controller)
3758 if (status != MMAGIC_STATUS_OK)
3769 response_timeout_ms);
3781 struct mmagic_controller *controller)
3794 if (status != MMAGIC_STATUS_OK)
3805 response_timeout_ms);
3852 struct mmagic_controller *controller,
3895 struct mmagic_controller *controller,
3923 struct mmagic_controller *controller,
3934 if (status != MMAGIC_STATUS_OK)
3961 struct mmagic_controller *controller,
3972 if (status != MMAGIC_STATUS_OK)
3999 struct mmagic_controller *controller,
4010 if (status != MMAGIC_STATUS_OK)
4037 struct mmagic_controller *controller,
4048 if (status != MMAGIC_STATUS_OK)
4075 struct mmagic_controller *controller,
4086 if (status != MMAGIC_STATUS_OK)
4113 struct mmagic_controller *controller,
4124 if (status != MMAGIC_STATUS_OK)
4152 struct mmagic_controller *controller,
4163 if (status != MMAGIC_STATUS_OK)
4191 struct mmagic_controller *controller,
4202 if (status != MMAGIC_STATUS_OK)
4230 struct mmagic_controller *controller,
4241 if (status != MMAGIC_STATUS_OK)
4269 struct mmagic_controller *controller,
4280 if (status != MMAGIC_STATUS_OK)
4308 struct mmagic_controller *controller,
4319 if (status != MMAGIC_STATUS_OK)
4347 struct mmagic_controller *controller,
4358 if (status != MMAGIC_STATUS_OK)
4385 struct mmagic_controller *controller,
4396 if (status != MMAGIC_STATUS_OK)
4423 struct mmagic_controller *controller,
4434 if (status != MMAGIC_STATUS_OK)
4457 struct mmagic_controller *controller)
4467 if (status != MMAGIC_STATUS_OK)
4502 struct mmagic_controller *controller,
4511 if (status != MMAGIC_STATUS_OK)
4520 (uint8_t *)rsp_args,
4522 response_timeout_ms);
4541 if (status != MMAGIC_STATUS_OK)
4552 response_timeout_ms);
4596 struct mmagic_controller *controller,
4623 struct mmagic_controller *controller,
4634 if (status != MMAGIC_STATUS_OK)
4660 struct mmagic_controller *controller,
4671 if (status != MMAGIC_STATUS_OK)
4697 struct mmagic_controller *controller,
4708 if (status != MMAGIC_STATUS_OK)
4734 struct mmagic_controller *controller,
4745 if (status != MMAGIC_STATUS_OK)
4772 struct mmagic_controller *controller,
4783 if (status != MMAGIC_STATUS_OK)
4810 struct mmagic_controller *controller,
4821 if (status != MMAGIC_STATUS_OK)
4844 struct mmagic_controller *controller)
4854 if (status != MMAGIC_STATUS_OK)
4889 struct mmagic_controller *controller,
4894 uint32_t response_timeout_ms = -1;
4898 if (status != MMAGIC_STATUS_OK)
4907 (uint8_t *)rsp_args,
4909 response_timeout_ms);
4937 struct mmagic_controller *controller,
4948 if (status != MMAGIC_STATUS_OK)
4975 struct mmagic_controller *controller,
4986 if (status != MMAGIC_STATUS_OK)
5012 struct mmagic_controller *controller,
5023 if (status != MMAGIC_STATUS_OK)
5049 struct mmagic_controller *controller,
5060 if (status != MMAGIC_STATUS_OK)
5087 struct mmagic_controller *controller,
5098 if (status != MMAGIC_STATUS_OK)
5125 struct mmagic_controller *controller,
5136 if (status != MMAGIC_STATUS_OK)
5164 struct mmagic_controller *controller,
5175 if (status != MMAGIC_STATUS_OK)
5203 struct mmagic_controller *controller,
5214 if (status != MMAGIC_STATUS_OK)
5237 struct mmagic_controller *controller)
5247 if (status != MMAGIC_STATUS_OK)
5282 struct mmagic_controller *controller,
5287 uint32_t response_timeout_ms = -1;
5291 if (status != MMAGIC_STATUS_OK)
5300 (uint8_t *)rsp_args,
5302 response_timeout_ms);
5345 struct mmagic_controller *controller,
5357 (uint8_t *)cmd_args,
5359 if (status != MMAGIC_STATUS_OK)
5370 response_timeout_ms);
5392 struct mmagic_controller *controller,
5406 if (status != MMAGIC_STATUS_OK)
5415 (uint8_t *)rsp_args,
5417 response_timeout_ms);
5449 struct mmagic_controller *controller,
5462 (uint8_t *)cmd_args,
5464 if (status != MMAGIC_STATUS_OK)
5473 (uint8_t *)rsp_args,
5475 response_timeout_ms);
5519 struct mmagic_controller *controller,
5525 uint32_t response_timeout_ms = 15000;
5532 (uint8_t *)cmd_args,
5534 if (status != MMAGIC_STATUS_OK)
5543 (uint8_t *)rsp_args,
5545 response_timeout_ms);
5577 struct mmagic_controller *controller,
5590 (uint8_t *)cmd_args,
5592 if (status != MMAGIC_STATUS_OK)
5601 (uint8_t *)rsp_args,
5603 response_timeout_ms);
5637 struct mmagic_controller *controller,
5642 const uint8_t stream_id = cmd_args->
stream_id;
5646 if (UINT32_MAX - response_timeout_ms >= cmd_args->
timeout)
5648 response_timeout_ms += cmd_args->
timeout;
5652 response_timeout_ms = UINT32_MAX;
5660 (uint8_t *)cmd_args,
5662 if (status != MMAGIC_STATUS_OK)
5671 (uint8_t *)rsp_args,
5673 response_timeout_ms);
5695 struct mmagic_controller *controller,
5699 const uint8_t stream_id = cmd_args->
stream_id;
5707 (uint8_t *)cmd_args,
5709 if (status != MMAGIC_STATUS_OK)
5720 response_timeout_ms);
5742 struct mmagic_controller *controller,
5746 const uint8_t stream_id = cmd_args->
stream_id;
5750 if (UINT32_MAX - response_timeout_ms >= cmd_args->
timeout)
5752 response_timeout_ms += cmd_args->
timeout;
5756 response_timeout_ms = UINT32_MAX;
5764 (uint8_t *)cmd_args,
5766 if (status != MMAGIC_STATUS_OK)
5777 response_timeout_ms);
5799 struct mmagic_controller *controller,
5803 const uint8_t stream_id = cmd_args->
stream_id;
5807 if (UINT32_MAX - response_timeout_ms >= cmd_args->
timeout)
5809 response_timeout_ms += cmd_args->
timeout;
5813 response_timeout_ms = UINT32_MAX;
5821 (uint8_t *)cmd_args,
5823 if (status != MMAGIC_STATUS_OK)
5834 response_timeout_ms);
5864 struct mmagic_controller *controller,
5869 const uint8_t stream_id = cmd_args->
stream_id;
5870 uint32_t response_timeout_ms = -1;
5877 (uint8_t *)cmd_args,
5879 if (status != MMAGIC_STATUS_OK)
5888 (uint8_t *)rsp_args,
5890 response_timeout_ms);
5910 struct mmagic_controller *controller,
5922 (uint8_t *)cmd_args,
5924 if (status != MMAGIC_STATUS_OK)
5935 response_timeout_ms);
5958 struct mmagic_controller *controller,
5970 (uint8_t *)cmd_args,
5972 if (status != MMAGIC_STATUS_OK)
5983 response_timeout_ms);
6026 struct mmagic_controller *controller,
6054 struct mmagic_controller *controller,
6065 if (status != MMAGIC_STATUS_OK)
6092 struct mmagic_controller *controller,
6103 if (status != MMAGIC_STATUS_OK)
6130 struct mmagic_controller *controller,
6141 if (status != MMAGIC_STATUS_OK)
6168 struct mmagic_controller *controller,
6179 if (status != MMAGIC_STATUS_OK)
6205 struct mmagic_controller *controller,
6216 if (status != MMAGIC_STATUS_OK)
6242 struct mmagic_controller *controller,
6253 if (status != MMAGIC_STATUS_OK)
6276 struct mmagic_controller *controller)
6286 if (status != MMAGIC_STATUS_OK)
6326 struct mmagic_controller *controller,
6337 if (status != MMAGIC_STATUS_OK)
6363 struct mmagic_controller *controller,
6368 var_val.
len = strlen(var);
6369 if (var_val.
len >
sizeof(var_val.
data) - 1)
6371 return MMAGIC_STATUS_INVALID_ARG;
6373 memcpy(var_val.
data, (
const uint8_t *)var, var_val.
len);
6374 memset(var_val.
data + var_val.
len, 0,
sizeof(var_val.
data) - var_val.
len);
6380 (uint8_t *)&var_val,
6382 if (status != MMAGIC_STATUS_OK)
6405 struct mmagic_controller *controller)
6415 if (status != MMAGIC_STATUS_OK)
6447 if (status != MMAGIC_STATUS_OK)
6458 response_timeout_ms);
6480 struct mmagic_controller *controller,
6494 if (status != MMAGIC_STATUS_OK)
6503 (uint8_t *)rsp_args,
6505 response_timeout_ms);
6532 struct mmagic_controller *controller,
6543 if (status != MMAGIC_STATUS_OK)
6569 struct mmagic_controller *controller,
6580 if (status != MMAGIC_STATUS_OK)
6603 struct mmagic_controller *controller)
6613 if (status != MMAGIC_STATUS_OK)
6666 struct mmagic_controller *controller,
6679 (uint8_t *)cmd_args,
6681 if (status != MMAGIC_STATUS_OK)
6690 (uint8_t *)rsp_args,
6692 response_timeout_ms);
6718 struct mmagic_controller *controller,
6730 (uint8_t *)cmd_args,
6732 if (status != MMAGIC_STATUS_OK)
6743 response_timeout_ms);
6767 struct mmagic_controller *controller,
6779 (uint8_t *)cmd_args,
6781 if (status != MMAGIC_STATUS_OK)
6792 response_timeout_ms);
6812 struct mmagic_controller *controller,
6817 uint32_t response_timeout_ms = 5000;
6824 (uint8_t *)cmd_args,
6826 if (status != MMAGIC_STATUS_OK)
6837 response_timeout_ms);
6884 struct mmagic_controller *controller,
6929 struct mmagic_controller *controller,
enum MM_PACKED mmagic_pmf_mode
Protected management frame mode.
enum MM_PACKED mmagic_sta_state
Station states.
enum MM_PACKED mmagic_socket_proto
Enumeration of socket protocols.
enum MM_PACKED mmagic_iperf_mode
Mode to use when running the iperf.
enum MM_PACKED mmagic_status
Enumeration of return status codes.
enum MM_PACKED mmagic_subsystem_id
Morse subsystem identifiers.
enum MM_PACKED mmagic_power_save_mode
Enumeration of supported 802.11 power save modes.
enum MM_PACKED mmagic_deep_sleep_mode
Deep sleep modes for the agent MCU.
enum MM_PACKED mmagic_iperf_state
Current state of iperf session.
enum MM_PACKED mmagic_duty_cycle_mode
Enumeration of duty cycle modes.
enum MM_PACKED mmagic_security_type
Connection security type.
enum MM_PACKED mmagic_station_type
Enumeration of S1G non-AP STA types.
enum MM_PACKED mmagic_ip_link_state
Status of the IP link.
enum MM_PACKED mmagic_sta_event
Station connection events.
mmagic_subsystem
Subsytem IDs.
enum MM_PACKED mmagic_mcs10_mode
Enumeration of MCS10 modes.
@ MMAGIC_TLS
Subsystem ID for Module tls: TLS support..
@ MMAGIC_WLAN
Subsystem ID for Module wlan: Wireless LAN management..
@ MMAGIC_IP
Subsystem ID for Module ip: IP Stack Management.
@ MMAGIC_SOCKET
Subsystem ID for Module socket: Socket IO, supports secure connections using.
@ MMAGIC_IPERF
Subsystem ID for Module iperf: Iperf application..
@ MMAGIC_SYS
Subsystem ID for Module sys: System management..
@ MMAGIC_PING
Subsystem ID for Module ping: Ping application..
@ MMAGIC_NTP
Subsystem ID for Module ntp: Network Time Protocol..
@ MMAGIC_MQTT
Subsystem ID for Module mqtt: MQTT agent..
struct mmagic_controller * mmagic_controller_init(const struct mmagic_controller_init_args *args)
Initialize the Controller.
void mmagic_controller_deinit(struct mmagic_controller *controller)
Deinitialize the Controller.
void(* mmagic_controller_agent_start_cb_t)(struct mmagic_controller *controller, void *arg)
Prototype for callback function invoked whenever any time a event that the agent has started is recei...
mmagic_mqtt_var
mqtt configuration variable IDs
#define CONTROL_STREAM
The stream ID of the control stream.
enum mmagic_status mmagic_controller_rx(struct mmagic_controller *controller, uint8_t stream_id, uint8_t submodule_id, uint8_t command_id, uint8_t subcommand_id, uint8_t *buffer, size_t buffer_length, uint32_t timeout_ms)
Waits for a response from the agent.
mmagic_mqtt_cmd
mqtt configuration command IDs
mmagic_ip_var
ip configuration variable IDs
mmagic_ping_cmd
ping configuration command IDs
#define MMAGIC_CONTROLLER_DEFAULT_COMMIT_RESPONSE_TIMEOUT_MS
The default timeout when waiting for a response from a commit command sent to the agent in ms.
mmagic_wlan_var
wlan configuration variable IDs
mmagic_iperf_cmd
iperf configuration command IDs
mmagic_ntp_cmd
ntp configuration command IDs
mmagic_ping_var
ping configuration variable IDs
mmagic_iperf_var
iperf configuration variable IDs
mmagic_wlan_cmd
wlan configuration command IDs
enum mmagic_status mmagic_controller_agent_sync(struct mmagic_controller *controller, uint32_t timeout_ms)
Sends a sync request to the agent and waits for a sync response.
mmagic_tls_var
tls configuration variable IDs
enum mmagic_status mmagic_controller_request_agent_reset(struct mmagic_controller *controller)
Sends a reset request to the agent.
mmagic_ntp_var
ntp configuration variable IDs
enum mmagic_status mmagic_controller_tx(struct mmagic_controller *controller, uint8_t stream_id, uint8_t submodule_id, uint8_t command_id, uint8_t subcommand_id, const uint8_t *buffer, size_t buffer_length)
Sends a command to the agent.
mmagic_sys_cmd
sys configuration command IDs
mmagic_socket_cmd
socket configuration command IDs
#define MMAGIC_CONTROLLER_DEFAULT_RESPONSE_TIMEOUT_MS
The default timeout when waiting for a response from a command sent to the agent in ms.
mmagic_tls_cmd
tls configuration command IDs
mmagic_ip_cmd
ip configuration command IDs
@ MMAGIC_MQTT_VAR_KEEPALIVE_S
The period at which keep-alive messages are sent by the client.
@ MMAGIC_MQTT_CMD_PUBLISH
Publishes a message on a topic.
@ MMAGIC_MQTT_CMD_COMMIT
Commit the current configuration to flash.
@ MMAGIC_MQTT_CMD_START_AGENT
Starts the MQTT agent.
@ MMAGIC_MQTT_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_MQTT_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_MQTT_CMD_SUBSCRIBE
Subscribes to a topic.
@ MMAGIC_MQTT_CMD_STOP_AGENT
Stops the MQTT agent.
@ MMAGIC_MQTT_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_IP_VAR_NETMASK
Netmask to use for a static network connection.
@ MMAGIC_IP_VAR_DNS_SERVER0
Primary DNS server IP address.
@ MMAGIC_IP_VAR_IP_ADDR
IP address to use for a static network connection.
@ MMAGIC_IP_VAR_GATEWAY
Gateway to use for a static network connection.
@ MMAGIC_IP_VAR_DHCP_ENABLED
True to enable DHCP for IP address configuration, or false to use the static configuration given by i...
@ MMAGIC_IP_VAR_LINK_STATUS_EVT_EN
When set to true, IP link status notifications will be provided.
@ MMAGIC_IP_VAR_DNS_SERVER1
Secondary DNS server IP address.
@ MMAGIC_PING_CMD_RUN
Commences a ping session using the current values in the subsystem config.
@ MMAGIC_PING_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_PING_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_PING_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_PING_CMD_COMMIT
Commit the current configuration to flash.
@ MMAGIC_WLAN_VAR_BSSID
BSSID of the ap to associate to, all 0x00 for any.
@ MMAGIC_WLAN_VAR_QOS_2_PARAMS
The default QoS queue configuration for Access Category 2 (AC_VI) that is active while the station is...
@ MMAGIC_WLAN_VAR_COUNTRY_CODE
Two character country code used to identify the regulatory domain.
@ MMAGIC_WLAN_VAR_SECURITY
Security type to used when associating.
@ MMAGIC_WLAN_VAR_PASSWORD
Password used when associating, 1-100 characters long.
@ MMAGIC_WLAN_VAR_QOS_1_PARAMS
The default QoS queue configuration for Access Category 1 (AC_BK) that is active while the station is...
@ MMAGIC_WLAN_VAR_PMF_MODE
Protected Management Frame mode to use (802.11w).
@ MMAGIC_WLAN_VAR_MAX_HEALTH_CHECK_INTVL_MS
The maximum interval to wait after the last health check before triggering another.
@ MMAGIC_WLAN_VAR_SGI_ENABLED
Boolean value indicating whether SGI support should be enabled.
@ MMAGIC_WLAN_VAR_CONNECT_ON_BOOT
On boot attempt to connect immediately to the AP with the current parameters rather than waiting for ...
@ MMAGIC_WLAN_VAR_SUBBANDS_ENABLED
Boolean value indicating whether sub-band support should be enabled.
@ MMAGIC_WLAN_VAR_RAW_PRIORITY
Priority to request if raw is supported by the AP.
@ MMAGIC_WLAN_VAR_STATION_TYPE
S1G non-AP STA type.
@ MMAGIC_WLAN_VAR_MCS10_MODE
The currently configured MCS10 behavior.
@ MMAGIC_WLAN_VAR_FRAGMENT_THRESHOLD
Sets the 802.11 fragmentation threshold.
@ MMAGIC_WLAN_VAR_SSID
SSID of the AP to connect to, can be 1-32 characters long.
@ MMAGIC_WLAN_VAR_RTS_THRESHOLD
The RTS threshold (in octets) to set, or 0 to disable.
@ MMAGIC_WLAN_VAR_STA_SCAN_INTERVAL_LIMIT_S
The maximum interval between scan attempts when (re)connecting.
@ MMAGIC_WLAN_VAR_NDP_PROBE_ENABLED
Boolean value indicating whether NDP probe support should be enabled.
@ MMAGIC_WLAN_VAR_QOS_0_PARAMS
The default QoS queue configuration for Access Category 0 (AC_BE) that is active while the station is...
@ MMAGIC_WLAN_VAR_DUTY_CYCLE_MODE
The duty cycle air time distribution mode.
@ MMAGIC_WLAN_VAR_MIN_HEALTH_CHECK_INTVL_MS
The minimum interval to wait after the last health check before triggering another.
@ MMAGIC_WLAN_VAR_STA_SCAN_INTERVAL_BASE_S
The base scan interval (in seconds) to use when (re)connecting.
@ MMAGIC_WLAN_VAR_STA_EVT_EN
When set to true, STA event notifications will be provided.
@ MMAGIC_WLAN_VAR_CAC_ENABLED
Whether Centralized Authentication Controlled is enabled on the STA.
@ MMAGIC_WLAN_VAR_QOS_3_PARAMS
The default QoS queue configuration for Access Category 3 (AC_VO) that is active while the station is...
@ MMAGIC_WLAN_VAR_POWER_SAVE_MODE
Sets the 802.11 power save mode.
@ MMAGIC_WLAN_VAR_AMPDU_ENABLED
Boolean value indicating whether AMPDU support should be enabled.
@ MMAGIC_IPERF_CMD_COMMIT
Commit the current configuration to flash.
@ MMAGIC_IPERF_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_IPERF_CMD_RUN
Starts an iperf session using the current values in the subsystem config.
@ MMAGIC_IPERF_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_IPERF_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_NTP_CMD_COMMIT
Commit the current configuration to flash.
@ MMAGIC_NTP_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_NTP_CMD_SYNC
Synchronizes internal time using the NTP server.
@ MMAGIC_NTP_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_NTP_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_NTP_CMD_GET_TIME
Reads current internal time.
@ MMAGIC_PING_VAR_COUNT
This specifies the number of ping requests to send before terminating the session.
@ MMAGIC_PING_VAR_TARGET
The IP address of the ping target.
@ MMAGIC_PING_VAR_INTERVAL
The time interval between ping requests (in milliseconds).
@ MMAGIC_IPERF_VAR_SERVER
IP address of server to connect to when in client mode.
@ MMAGIC_IPERF_VAR_PORT
Specifies the local port to listen on when in server mode or the server port to send data to when in ...
@ MMAGIC_IPERF_VAR_MODE
The iperf mode to use.
@ MMAGIC_IPERF_VAR_AMOUNT
This specifies the duration for client transfers specified either in seconds or bytes.
@ MMAGIC_WLAN_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_WLAN_CMD_GET_MAC_ADDR
Retrieves the MAC address if the WLAN interface is up.
@ MMAGIC_WLAN_CMD_DPP_STOP
Instructs the WLAN device to abort the ongoing DPP session.
@ MMAGIC_WLAN_CMD_GET_STA_STATUS
Retrieves the STA status of the WLAN interface.
@ MMAGIC_WLAN_CMD_BEACON_MONITOR_ENABLE
Enable beacon monitoring with the given filter settings.
@ MMAGIC_WLAN_CMD_BEACON_MONITOR_DISABLE
Disable beacon monitoring.
@ MMAGIC_WLAN_CMD_GET_RSSI
Retrieves the RSSI if the WLAN interface is up, else 0.
@ MMAGIC_WLAN_CMD_WNM_SLEEP
Requests entry or exit from extended sleep (wnm sleep) if the WLAN interface is up.
@ MMAGIC_WLAN_CMD_COMMIT
Commit the current configuration to flash.
@ MMAGIC_WLAN_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_WLAN_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_WLAN_CMD_DISCONNECT
Disconnects and brings down the WLAN interface.
@ MMAGIC_WLAN_CMD_SCAN
Starts an undirected scan for available networks.
@ MMAGIC_WLAN_CMD_DPP_PUSH_BUTTON_START
Instructs the WLAN device to start the Device Provisioning Protocol (DPP) Push Button (PB) provisioni...
@ MMAGIC_WLAN_CMD_CONNECT
Brings up the WLAN interface and connects to the AP with configured parameters.
@ MMAGIC_TLS_VAR_ROOT_CA_CERTIFICATE
Root certificate authority certificate.
@ MMAGIC_TLS_VAR_CLIENT_CERTIFICATE
Certificate to identify the client.
@ MMAGIC_TLS_VAR_CLIENT_PRIVATE_KEY
Client private key.
@ MMAGIC_NTP_VAR_SERVER
The hostname or IP of the NTP server.
@ MMAGIC_SYS_CMD_DEEP_SLEEP
Enters deep sleep mode.
@ MMAGIC_SYS_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_SYS_CMD_RESET
Performs a soft reset.
@ MMAGIC_SYS_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_SYS_CMD_GET_VERSION
Gets the device firmware and hardware versions.
@ MMAGIC_SYS_CMD_COMMIT
Commit the current configuration to flash.
@ MMAGIC_SYS_CMD_GET_STATS
Retrieve subsystem statistics.
@ MMAGIC_SYS_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_SOCKET_CMD_CLOSE
Closes and frees the socket.
@ MMAGIC_SOCKET_CMD_BIND
Opens a server socket and returns its stream ID.
@ MMAGIC_SOCKET_CMD_WRITE_POLL
Polls the socket till it is ready for writing.
@ MMAGIC_SOCKET_CMD_CONNECT
Opens a client socket and returns its stream ID.
@ MMAGIC_SOCKET_CMD_ACCEPT
Waits for an incoming socket connection and returns a new stream ID.
@ MMAGIC_SOCKET_CMD_READ_POLL
Polls the socket till it is ready for reading.
@ MMAGIC_SOCKET_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_SOCKET_CMD_SEND
Writes to a socket.
@ MMAGIC_SOCKET_CMD_SET_RX_READY_EVT_ENABLED
Sets whether the RX ready event should be enabled for the given socket.
@ MMAGIC_SOCKET_CMD_RECV
Reads from a socket.
@ MMAGIC_SOCKET_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_SOCKET_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_SOCKET_CMD_COMMIT
Commit the current configuration to flash.
@ MMAGIC_TLS_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_TLS_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_TLS_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_TLS_CMD_COMMIT
Commit the current configuration to flash.
@ MMAGIC_IP_CMD_SET
Set the value of a configuration variable.
@ MMAGIC_IP_CMD_STATUS
Gets the status of the IP stack.
@ MMAGIC_IP_CMD_LOAD
Load the current configuration from flash (NB will automatically load on boot)
@ MMAGIC_IP_CMD_GET
Retrieve the value of a configuration variable.
@ MMAGIC_IP_CMD_RELOAD
Reloads the IP stack network configuration based on the current values in the subsystem config.
@ MMAGIC_IP_CMD_COMMIT
Commit the current configuration to flash.
static enum mmagic_status mmagic_controller_set_iperf_amount(struct mmagic_controller *controller, int32_t var)
Sets amount setting for module iperf.
static enum mmagic_status mmagic_controller_set_iperf_server(struct mmagic_controller *controller, struct struct_ip_addr *var)
Sets server setting for module iperf.
static enum mmagic_status mmagic_controller_get_iperf_server(struct mmagic_controller *controller, struct struct_ip_addr *var)
Gets server setting for module iperf.
static enum mmagic_status mmagic_controller_set_iperf_mode(struct mmagic_controller *controller, enum mmagic_iperf_mode var)
Sets mode setting for module iperf.
static enum mmagic_status mmagic_controller_get_iperf_port(struct mmagic_controller *controller, uint16_t *var)
Gets port setting for module iperf.
static enum mmagic_status mmagic_controller_set_iperf_port(struct mmagic_controller *controller, uint16_t var)
Sets port setting for module iperf.
static enum mmagic_status mmagic_controller_iperf_commit_all(struct mmagic_controller *controller)
Saves all settings from persistent store.
static enum mmagic_status mmagic_controller_get_iperf_mode(struct mmagic_controller *controller, enum mmagic_iperf_mode *var)
Gets mode setting for module iperf.
static enum mmagic_status mmagic_controller_get_iperf_amount(struct mmagic_controller *controller, int32_t *var)
Gets amount setting for module iperf.
static enum mmagic_status mmagic_controller_iperf_run(struct mmagic_controller *controller, struct mmagic_core_iperf_run_rsp_args *rsp_args)
Starts an iperf session using the current values in the subsystem config.
static enum mmagic_status mmagic_controller_get_ip_ip_addr(struct mmagic_controller *controller, struct struct_ip_addr *var)
Gets ip_addr setting for module ip.
static enum mmagic_status mmagic_controller_get_ip_dhcp_enabled(struct mmagic_controller *controller, bool *var)
Gets dhcp_enabled setting for module ip.
static enum mmagic_status mmagic_controller_set_ip_dns_server1(struct mmagic_controller *controller, struct struct_ip_addr *var)
Sets dns_server1 setting for module ip.
static enum mmagic_status mmagic_controller_get_ip_netmask(struct mmagic_controller *controller, struct struct_ip_addr *var)
Gets netmask setting for module ip.
static enum mmagic_status mmagic_controller_set_ip_link_status_evt_en(struct mmagic_controller *controller, bool var)
Sets link_status_evt_en setting for module ip.
static enum mmagic_status mmagic_controller_ip_commit_all(struct mmagic_controller *controller)
Saves all settings from persistent store.
static enum mmagic_status mmagic_controller_get_ip_gateway(struct mmagic_controller *controller, struct struct_ip_addr *var)
Gets gateway setting for module ip.
static enum mmagic_status mmagic_controller_get_ip_link_status_evt_en(struct mmagic_controller *controller, bool *var)
Gets link_status_evt_en setting for module ip.
static enum mmagic_status mmagic_controller_set_ip_netmask(struct mmagic_controller *controller, struct struct_ip_addr *var)
Sets netmask setting for module ip.
static enum mmagic_status mmagic_controller_set_ip_dhcp_enabled(struct mmagic_controller *controller, bool var)
Sets dhcp_enabled setting for module ip.
static enum mmagic_status mmagic_controller_set_ip_ip_addr(struct mmagic_controller *controller, struct struct_ip_addr *var)
Sets ip_addr setting for module ip.
static enum mmagic_status mmagic_controller_get_ip_dns_server1(struct mmagic_controller *controller, struct struct_ip_addr *var)
Gets dns_server1 setting for module ip.
static enum mmagic_status mmagic_controller_set_ip_gateway(struct mmagic_controller *controller, struct struct_ip_addr *var)
Sets gateway setting for module ip.
static enum mmagic_status mmagic_controller_set_ip_dns_server0(struct mmagic_controller *controller, struct struct_ip_addr *var)
Sets dns_server0 setting for module ip.
static enum mmagic_status mmagic_controller_get_ip_dns_server0(struct mmagic_controller *controller, struct struct_ip_addr *var)
Gets dns_server0 setting for module ip.
void mmagic_controller_register_ip_link_status_handler(struct mmagic_controller *controller, mmagic_ip_link_status_event_handler_t handler, void *arg)
Register a handler for the ip-link_status event.
static enum mmagic_status mmagic_controller_ip_reload(struct mmagic_controller *controller)
Reloads the IP stack network configuration based on the current values in the subsystem config.
void(* mmagic_ip_link_status_event_handler_t)(const struct mmagic_ip_link_status_event_args *event_args, void *arg)
Handler for the ip-link_status event.
static enum mmagic_status mmagic_controller_ip_status(struct mmagic_controller *controller, struct mmagic_core_ip_status_rsp_args *rsp_args)
Gets the status of the IP stack.
static enum mmagic_status mmagic_controller_mqtt_commit_all(struct mmagic_controller *controller)
Saves all settings from persistent store.
static enum mmagic_status mmagic_controller_set_mqtt_keepalive_s(struct mmagic_controller *controller, uint16_t var)
Sets keepalive_s setting for module mqtt.
static enum mmagic_status mmagic_controller_get_mqtt_keepalive_s(struct mmagic_controller *controller, uint16_t *var)
Gets keepalive_s setting for module mqtt.
void(* mmagic_mqtt_broker_connection_event_handler_t)(const struct mmagic_mqtt_broker_connection_event_args *event_args, void *arg)
Handler for the mqtt-broker_connection event.
void mmagic_controller_register_mqtt_broker_connection_handler(struct mmagic_controller *controller, mmagic_mqtt_broker_connection_event_handler_t handler, void *arg)
Register a handler for the mqtt-broker_connection event.
void mmagic_controller_register_mqtt_message_received_handler(struct mmagic_controller *controller, mmagic_mqtt_message_received_event_handler_t handler, void *arg)
Register a handler for the mqtt-message_received event.
static enum mmagic_status mmagic_controller_mqtt_stop_agent(struct mmagic_controller *controller, struct mmagic_core_mqtt_stop_agent_cmd_args *cmd_args)
Stops the MQTT agent.
void(* mmagic_mqtt_message_received_event_handler_t)(const struct mmagic_mqtt_message_received_event_args *event_args, void *arg)
Handler for the mqtt-message_received event.
static enum mmagic_status mmagic_controller_mqtt_publish(struct mmagic_controller *controller, struct mmagic_core_mqtt_publish_cmd_args *cmd_args)
Publishes a message on a topic.
static enum mmagic_status mmagic_controller_mqtt_subscribe(struct mmagic_controller *controller, struct mmagic_core_mqtt_subscribe_cmd_args *cmd_args)
Subscribes to a topic.
static enum mmagic_status mmagic_controller_mqtt_start_agent(struct mmagic_controller *controller, struct mmagic_core_mqtt_start_agent_cmd_args *cmd_args, struct mmagic_core_mqtt_start_agent_rsp_args *rsp_args)
Starts the MQTT agent.
static enum mmagic_status mmagic_controller_ntp_commit_all(struct mmagic_controller *controller)
Saves all settings from persistent store.
static enum mmagic_status mmagic_controller_get_ntp_server(struct mmagic_controller *controller, struct string254 *var)
Gets server setting for module ntp.
static enum mmagic_status mmagic_controller_set_ntp_server(struct mmagic_controller *controller, const char *var)
Sets server setting for module ntp.
static enum mmagic_status mmagic_controller_ntp_sync(struct mmagic_controller *controller)
Synchronizes internal time using the NTP server.
static enum mmagic_status mmagic_controller_ntp_get_time(struct mmagic_controller *controller, struct mmagic_core_ntp_get_time_rsp_args *rsp_args)
Reads current internal time.
static enum mmagic_status mmagic_controller_get_ping_target(struct mmagic_controller *controller, struct struct_ip_addr *var)
Gets target setting for module ping.
static enum mmagic_status mmagic_controller_get_ping_count(struct mmagic_controller *controller, uint32_t *var)
Gets count setting for module ping.
static enum mmagic_status mmagic_controller_set_ping_count(struct mmagic_controller *controller, uint32_t var)
Sets count setting for module ping.
static enum mmagic_status mmagic_controller_ping_commit_all(struct mmagic_controller *controller)
Saves all settings from persistent store.
static enum mmagic_status mmagic_controller_set_ping_interval(struct mmagic_controller *controller, uint32_t var)
Sets interval setting for module ping.
static enum mmagic_status mmagic_controller_get_ping_interval(struct mmagic_controller *controller, uint32_t *var)
Gets interval setting for module ping.
static enum mmagic_status mmagic_controller_set_ping_target(struct mmagic_controller *controller, struct struct_ip_addr *var)
Sets target setting for module ping.
static enum mmagic_status mmagic_controller_ping_run(struct mmagic_controller *controller, struct mmagic_core_ping_run_rsp_args *rsp_args)
Commences a ping session using the current values in the subsystem config.
static enum mmagic_status mmagic_controller_socket_connect(struct mmagic_controller *controller, struct mmagic_core_socket_connect_cmd_args *cmd_args, struct mmagic_core_socket_connect_rsp_args *rsp_args)
Opens a client socket and returns its stream ID.
void(* mmagic_socket_rx_ready_event_handler_t)(const struct mmagic_socket_rx_ready_event_args *event_args, void *arg)
Handler for the socket-rx_ready event.
static enum mmagic_status mmagic_controller_socket_write_poll(struct mmagic_controller *controller, struct mmagic_core_socket_write_poll_cmd_args *cmd_args)
Polls the socket till it is ready for writing.
static enum mmagic_status mmagic_controller_socket_recv(struct mmagic_controller *controller, struct mmagic_core_socket_recv_cmd_args *cmd_args, struct mmagic_core_socket_recv_rsp_args *rsp_args)
Reads from a socket.
void mmagic_controller_register_socket_rx_ready_handler(struct mmagic_controller *controller, mmagic_socket_rx_ready_event_handler_t handler, void *arg)
Register a handler for the socket-rx_ready event.
static enum mmagic_status mmagic_controller_socket_close(struct mmagic_controller *controller, struct mmagic_core_socket_close_cmd_args *cmd_args)
Closes and frees the socket.
static enum mmagic_status mmagic_controller_socket_read_poll(struct mmagic_controller *controller, struct mmagic_core_socket_read_poll_cmd_args *cmd_args)
Polls the socket till it is ready for reading.
static enum mmagic_status mmagic_controller_socket_set_rx_ready_evt_enabled(struct mmagic_controller *controller, struct mmagic_core_socket_set_rx_ready_evt_enabled_cmd_args *cmd_args)
Sets whether the RX ready event should be enabled for the given socket.
static enum mmagic_status mmagic_controller_socket_accept(struct mmagic_controller *controller, struct mmagic_core_socket_accept_cmd_args *cmd_args, struct mmagic_core_socket_accept_rsp_args *rsp_args)
Waits for an incoming socket connection and returns a new stream ID.
static enum mmagic_status mmagic_controller_socket_send(struct mmagic_controller *controller, struct mmagic_core_socket_send_cmd_args *cmd_args)
Writes to a socket.
static enum mmagic_status mmagic_controller_socket_bind(struct mmagic_controller *controller, struct mmagic_core_socket_bind_cmd_args *cmd_args, struct mmagic_core_socket_bind_rsp_args *rsp_args)
Opens a server socket and returns its stream ID.
static enum mmagic_status mmagic_controller_sys_deep_sleep(struct mmagic_controller *controller, struct mmagic_core_sys_deep_sleep_cmd_args *cmd_args)
Enters deep sleep mode.
static enum mmagic_status mmagic_controller_sys_reset(struct mmagic_controller *controller)
Performs a soft reset.
static enum mmagic_status mmagic_controller_sys_get_version(struct mmagic_controller *controller, struct mmagic_core_sys_get_version_rsp_args *rsp_args)
Gets the device firmware and hardware versions.
static enum mmagic_status mmagic_controller_sys_get_stats(struct mmagic_controller *controller, struct mmagic_core_sys_get_stats_cmd_args *cmd_args, struct mmagic_core_sys_get_stats_rsp_args *rsp_args)
Retrieve subsystem statistics.
static enum mmagic_status mmagic_controller_set_tls_client_private_key(struct mmagic_controller *controller, struct raw1536 *var)
Sets client_private_key setting for module tls.
static enum mmagic_status mmagic_controller_tls_commit_all(struct mmagic_controller *controller)
Saves all settings from persistent store.
static enum mmagic_status mmagic_controller_get_tls_client_certificate(struct mmagic_controller *controller, struct raw1536 *var)
Gets client_certificate setting for module tls.
static enum mmagic_status mmagic_controller_set_tls_root_ca_certificate(struct mmagic_controller *controller, struct raw1536 *var)
Sets root_ca_certificate setting for module tls.
static enum mmagic_status mmagic_controller_set_tls_client_certificate(struct mmagic_controller *controller, struct raw1536 *var)
Sets client_certificate setting for module tls.
static enum mmagic_status mmagic_controller_get_tls_root_ca_certificate(struct mmagic_controller *controller, struct raw1536 *var)
Gets root_ca_certificate setting for module tls.
static enum mmagic_status mmagic_controller_get_tls_client_private_key(struct mmagic_controller *controller, struct raw1536 *var)
Gets client_private_key setting for module tls.
static enum mmagic_status mmagic_controller_set_wlan_ampdu_enabled(struct mmagic_controller *controller, bool var)
Sets ampdu_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_qos_1_params(struct mmagic_controller *controller, const char *var)
Sets qos_1_params setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_sta_scan_interval_limit_s(struct mmagic_controller *controller, uint16_t *var)
Gets sta_scan_interval_limit_s setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_ampdu_enabled(struct mmagic_controller *controller, bool *var)
Gets ampdu_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_max_health_check_intvl_ms(struct mmagic_controller *controller, uint32_t var)
Sets max_health_check_intvl_ms setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_ssid(struct mmagic_controller *controller, const char *var)
Sets ssid setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_connect_on_boot(struct mmagic_controller *controller, bool var)
Sets connect_on_boot setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_power_save_mode(struct mmagic_controller *controller, enum mmagic_power_save_mode *var)
Gets power_save_mode setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_pmf_mode(struct mmagic_controller *controller, enum mmagic_pmf_mode *var)
Gets pmf_mode setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_cac_enabled(struct mmagic_controller *controller, bool *var)
Gets cac_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_password(struct mmagic_controller *controller, const char *var)
Sets password setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_qos_2_params(struct mmagic_controller *controller, struct string32 *var)
Gets qos_2_params setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_min_health_check_intvl_ms(struct mmagic_controller *controller, uint32_t var)
Sets min_health_check_intvl_ms setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_sta_scan_interval_base_s(struct mmagic_controller *controller, uint16_t var)
Sets sta_scan_interval_base_s setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_bssid(struct mmagic_controller *controller, struct struct_mac_addr *var)
Sets bssid setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_security(struct mmagic_controller *controller, enum mmagic_security_type *var)
Gets security setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_qos_2_params(struct mmagic_controller *controller, const char *var)
Sets qos_2_params setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_mcs10_mode(struct mmagic_controller *controller, enum mmagic_mcs10_mode *var)
Gets mcs10_mode setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_duty_cycle_mode(struct mmagic_controller *controller, enum mmagic_duty_cycle_mode *var)
Gets duty_cycle_mode setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_max_health_check_intvl_ms(struct mmagic_controller *controller, uint32_t *var)
Gets max_health_check_intvl_ms setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_sta_scan_interval_base_s(struct mmagic_controller *controller, uint16_t *var)
Gets sta_scan_interval_base_s setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_sta_evt_en(struct mmagic_controller *controller, bool *var)
Gets sta_evt_en setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_subbands_enabled(struct mmagic_controller *controller, bool var)
Sets subbands_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_pmf_mode(struct mmagic_controller *controller, enum mmagic_pmf_mode var)
Sets pmf_mode setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_qos_3_params(struct mmagic_controller *controller, struct string32 *var)
Gets qos_3_params setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_qos_1_params(struct mmagic_controller *controller, struct string32 *var)
Gets qos_1_params setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_raw_priority(struct mmagic_controller *controller, int16_t var)
Sets raw_priority setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_station_type(struct mmagic_controller *controller, enum mmagic_station_type *var)
Gets station_type setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_ssid(struct mmagic_controller *controller, struct string32 *var)
Gets ssid setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_fragment_threshold(struct mmagic_controller *controller, uint32_t *var)
Gets fragment_threshold setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_qos_0_params(struct mmagic_controller *controller, const char *var)
Sets qos_0_params setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_ndp_probe_enabled(struct mmagic_controller *controller, bool *var)
Gets ndp_probe_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_sgi_enabled(struct mmagic_controller *controller, bool var)
Sets sgi_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_rts_threshold(struct mmagic_controller *controller, uint32_t var)
Sets rts_threshold setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_sta_scan_interval_limit_s(struct mmagic_controller *controller, uint16_t var)
Sets sta_scan_interval_limit_s setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_duty_cycle_mode(struct mmagic_controller *controller, enum mmagic_duty_cycle_mode var)
Sets duty_cycle_mode setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_power_save_mode(struct mmagic_controller *controller, enum mmagic_power_save_mode var)
Sets power_save_mode setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_ndp_probe_enabled(struct mmagic_controller *controller, bool var)
Sets ndp_probe_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_raw_priority(struct mmagic_controller *controller, int16_t *var)
Gets raw_priority setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_cac_enabled(struct mmagic_controller *controller, bool var)
Sets cac_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_qos_0_params(struct mmagic_controller *controller, struct string32 *var)
Gets qos_0_params setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_fragment_threshold(struct mmagic_controller *controller, uint32_t var)
Sets fragment_threshold setting for module wlan.
static enum mmagic_status mmagic_controller_wlan_commit_all(struct mmagic_controller *controller)
Saves all settings from persistent store.
static enum mmagic_status mmagic_controller_get_wlan_password(struct mmagic_controller *controller, struct string100 *var)
Gets password setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_mcs10_mode(struct mmagic_controller *controller, enum mmagic_mcs10_mode var)
Sets mcs10_mode setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_sta_evt_en(struct mmagic_controller *controller, bool var)
Sets sta_evt_en setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_rts_threshold(struct mmagic_controller *controller, uint32_t *var)
Gets rts_threshold setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_country_code(struct mmagic_controller *controller, struct struct_country_code *var)
Gets country_code setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_sgi_enabled(struct mmagic_controller *controller, bool *var)
Gets sgi_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_bssid(struct mmagic_controller *controller, struct struct_mac_addr *var)
Gets bssid setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_min_health_check_intvl_ms(struct mmagic_controller *controller, uint32_t *var)
Gets min_health_check_intvl_ms setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_subbands_enabled(struct mmagic_controller *controller, bool *var)
Gets subbands_enabled setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_station_type(struct mmagic_controller *controller, enum mmagic_station_type var)
Sets station_type setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_country_code(struct mmagic_controller *controller, struct struct_country_code *var)
Sets country_code setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_security(struct mmagic_controller *controller, enum mmagic_security_type var)
Sets security setting for module wlan.
static enum mmagic_status mmagic_controller_set_wlan_qos_3_params(struct mmagic_controller *controller, const char *var)
Sets qos_3_params setting for module wlan.
static enum mmagic_status mmagic_controller_get_wlan_connect_on_boot(struct mmagic_controller *controller, bool *var)
Gets connect_on_boot setting for module wlan.
static enum mmagic_status mmagic_controller_wlan_beacon_monitor_enable(struct mmagic_controller *controller, struct mmagic_core_wlan_beacon_monitor_enable_cmd_args *cmd_args)
Enable beacon monitoring with the given filter settings.
static enum mmagic_status mmagic_controller_wlan_dpp_push_button_start(struct mmagic_controller *controller)
Instructs the WLAN device to start the Device Provisioning Protocol (DPP) Push Button (PB) provisioni...
static enum mmagic_status mmagic_controller_wlan_get_rssi(struct mmagic_controller *controller, struct mmagic_core_wlan_get_rssi_rsp_args *rsp_args)
Retrieves the RSSI if the WLAN interface is up, else 0.
static enum mmagic_status mmagic_controller_wlan_disconnect(struct mmagic_controller *controller)
Disconnects and brings down the WLAN interface.
static enum mmagic_status mmagic_controller_wlan_get_sta_status(struct mmagic_controller *controller, struct mmagic_core_wlan_get_sta_status_rsp_args *rsp_args)
Retrieves the STA status of the WLAN interface.
static enum mmagic_status mmagic_controller_wlan_wnm_sleep(struct mmagic_controller *controller, struct mmagic_core_wlan_wnm_sleep_cmd_args *cmd_args)
Requests entry or exit from extended sleep (wnm sleep) if the WLAN interface is up.
void mmagic_controller_register_wlan_beacon_rx_handler(struct mmagic_controller *controller, mmagic_wlan_beacon_rx_event_handler_t handler, void *arg)
Register a handler for the wlan-beacon_rx event.
static enum mmagic_status mmagic_controller_wlan_get_mac_addr(struct mmagic_controller *controller, struct mmagic_core_wlan_get_mac_addr_rsp_args *rsp_args)
Retrieves the MAC address if the WLAN interface is up.
void mmagic_controller_register_wlan_sta_event_handler(struct mmagic_controller *controller, mmagic_wlan_sta_event_event_handler_t handler, void *arg)
Register a handler for the wlan-sta_event event.
static enum mmagic_status mmagic_controller_wlan_beacon_monitor_disable(struct mmagic_controller *controller)
Disable beacon monitoring.
static enum mmagic_status mmagic_controller_wlan_connect(struct mmagic_controller *controller, struct mmagic_core_wlan_connect_cmd_args *cmd_args)
Brings up the WLAN interface and connects to the AP with configured parameters.
static enum mmagic_status mmagic_controller_wlan_scan(struct mmagic_controller *controller, struct mmagic_core_wlan_scan_cmd_args *cmd_args, struct mmagic_core_wlan_scan_rsp_args *rsp_args)
Starts an undirected scan for available networks.
static enum mmagic_status mmagic_controller_wlan_dpp_stop(struct mmagic_controller *controller)
Instructs the WLAN device to abort the ongoing DPP session.
void(* mmagic_wlan_sta_event_event_handler_t)(const struct mmagic_wlan_sta_event_event_args *event_args, void *arg)
Handler for the wlan-sta_event event.
void(* mmagic_wlan_beacon_rx_event_handler_t)(const struct mmagic_wlan_beacon_rx_event_args *event_args, void *arg)
Handler for the wlan-beacon_rx event.
#define MM_PACKED
Macro for packed structs.
Initialization structure for mmagic_controller.
mmagic_controller_agent_start_cb_t agent_start_cb
Callback function to executed any time a event that the agent has started is received.
void * agent_start_arg
User argument that will be passed when the agent_start_cb is executed.
Response arguments structure for ip_status.
Response arguments structure for iperf_run.
Command arguments structure for mqtt_publish.
uint8_t stream_id
Stream ID of the MQTT connection.
uint8_t qos
MQTT quality of service (0-2).
Command arguments structure for mqtt_start_agent.
bool secure
Enables TLS for brokers that require it.
uint16_t port
Port of the broker to connect to.
Response arguments structure for mqtt_start_agent.
uint8_t stream_id
Stream ID of the opened socket.
Command arguments structure for mqtt_stop_agent.
uint8_t stream_id
Stream ID of the MQTT connection.
Command arguments structure for mqtt_subscribe.
uint8_t qos
MQTT quality of service (0-2).
uint8_t stream_id
Stream ID of the MQTT connection.
Response arguments structure for ntp_get_time.
uint64_t timestamp
Current internal time (Seconds since epoch, UTC).
Response arguments structure for ping_run.
Command arguments structure for socket_accept.
uint8_t stream_id
Stream ID of the bound socket.
Response arguments structure for socket_accept.
uint8_t stream_id
Stream ID of the new incoming connection.
Command arguments structure for socket_bind.
uint16_t port
Port to listen on.
enum mmagic_socket_proto protocol
Underlying protocol to be used.
Response arguments structure for socket_bind.
uint8_t stream_id
Stream ID of the opened socket.
Command arguments structure for socket_close.
uint8_t stream_id
Stream ID of the socket to close.
Command arguments structure for socket_connect.
bool enable_tls
Enables TLS.
enum mmagic_socket_proto protocol
Underlying protocol to be used.
uint16_t port
Port to connect to.
Response arguments structure for socket_connect.
uint8_t stream_id
Stream ID of the opened socket.
Command arguments structure for socket_read_poll.
uint8_t stream_id
Stream ID of the socket to wait on.
uint32_t timeout
Timeout in ms.
Command arguments structure for socket_recv.
uint16_t len
Maximum length of data.
uint8_t stream_id
Stream ID of the socket to receive from.
uint32_t timeout
Timeout in ms.
Response arguments structure for socket_recv.
Command arguments structure for socket_send.
uint8_t stream_id
Stream ID of the socket to send on.
Command arguments structure for socket_set_rx_ready_evt_enabled.
uint8_t stream_id
Stream ID of the socket to close.
bool enabled
Whether the RX ready event should be enabled.
Command arguments structure for socket_write_poll.
uint8_t stream_id
Stream ID of the socket to wait on.
uint32_t timeout
Timeout in ms.
Command arguments structure for sys_deep_sleep.
enum mmagic_deep_sleep_mode mode
Deep sleep mode to enter.
Command arguments structure for sys_get_stats.
bool reset
Reset the statistics after retrieving them where applicable.
enum mmagic_subsystem_id subsystem
Subsystem from which to retrieve statistics.
Response arguments structure for sys_get_stats.
Response arguments structure for sys_get_version.
Command arguments structure for wlan_beacon_monitor_enable.
Command arguments structure for wlan_connect.
uint32_t timeout
Duration in milliseconds to wait for connection establish, if connection does not get established an ...
Response arguments structure for wlan_get_mac_addr.
Response arguments structure for wlan_get_sta_status.
enum mmagic_sta_state sta_status
The current STA status.
Command arguments structure for wlan_scan.
uint32_t timeout
Optional duration in milliseconds to wait for scan to complete, if scan does not complete by the time...
Response arguments structure for wlan_scan.
Command arguments structure for wlan_wnm_sleep.
bool wnm_sleep_enabled
Boolean indicating whether WNM sleep is enabled.
Event arguments structure for ip_link_status.
Event arguments structure for mqtt_broker_connection.
enum mmagic_status connection_state
Current state of the connection to the broker.
uint8_t stream_id
Stream ID of the MQTT connection.
Event arguments structure for mqtt_message_received.
uint8_t stream_id
Stream ID of the MQTT connection.
Event arguments structure for socket_rx_ready.
uint8_t stream_id
Stream ID of the socket this applies to.
Event arguments structure for wlan_beacon_rx.
Event arguments structure for wlan_sta_event.
enum mmagic_sta_event event
The reported WLAN STA evt.
Raw octet string type with maximum length of 1536.
uint16_t len
Length of data.
Raw octet string type with maximum length of 1600.
uint16_t len
Length of data.
Raw octet string type with maximum length of 255.
uint8_t len
Length of data.
String type with maximum length of 100 (excluding null terminator).
uint8_t len
Length of string contents (excluding null terminator).
char data[100+1]
The string contents.
String type with maximum length of 254 (excluding null terminator).
uint8_t len
Length of string contents (excluding null terminator).
char data[254+1]
The string contents.
String type with maximum length of 32 (excluding null terminator).
uint8_t len
Length of string contents (excluding null terminator).
char data[32+1]
The string contents.
uint8_t len
Length of data in the buffer.
Data type to contain Two character country code (null-terminated) used to identify the regulatory dom...
Data type for a string representation of an IP address.
Structure to contain the current IP status.
bool dhcp_enabled
Whether or not dhcp is enabled.
enum mmagic_ip_link_state link_state
Current link state.
Data structure to store iperf results.
uint16_t local_port
Port number of the local device.
uint64_t bytes_transferred
The number of bytes of data transferred during the iperf test.
uint32_t bandwidth_kbitpsec
The average throughput in kbps.
uint16_t remote_port
Port number of the remote device.
uint32_t duration_ms
The duration of the iperf test in milliseconds.
Data type to contain mac address byte array.
Data type to contain a list of three octet OUIs.
uint8_t count
The number of OUIs in the list.
Data type to contain a three octet OUI.
Data structure to store ping results.
uint32_t min_time_ms
The minimum latency in ms between request sent and response received.
uint32_t total_count
Total number of requests sent.
uint16_t session_id
Stores non-zero session ID whilst ping session is running.
uint32_t avg_time_ms
The average latency in ms between request sent and response received.
uint32_t recv_count
The number of ping responses received.
uint32_t max_time_ms
The maximum latency in ms between request sent and response received.
Structure for holding a scan result.
uint16_t received_ies_len
Length of the ies field in the received frame.
uint8_t op_bw_mhz
Operating bandwidth, in MHz, of the access point.
uint16_t capability_info
Value of the Capability Information field.
uint32_t channel_freq_hz
Center frequency in Hz of the channel where the frame was received.
uint8_t bw_mhz
Bandwidth, in MHz, where the frame was received.
int32_t rssi
RSSI of the AP in dBm.
uint16_t beacon_interval
Value of the Beacon Interval field.
int16_t noise_dbm
Background noise measured by the chip on the channel at the time the probe response was received.
uint64_t tsf
TSF timestamp in the Probe Response frame.
Structure for returning the scan status.
uint8_t num
Number of results retrieved.
struct struct_scan_result results[10]
Array of scan results.
Structure for devise firmware and hardware versions.