WE310F5  39.00.000
m2mb_profile.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
25 #include "m2mb_ble_driver.h"
26 
27 #ifndef _M2MB_PROFILE_H_
28 #define _M2MB_PROFILE_H_
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #define M2M_PROFILE_DBG_PRINT(...)
35 
81 /*-----------------------------------------------------------------------------------------------*/
82 
87 /*-----------------------------------------------------------------------------------------------*/
88 
89 
90 /* Global declarations ==========================================================================*/
91 #define DEFAULT_TCP_SERVER 1
92 #define DEFAULT_TCP_CLIENT 2
93 #define DEFAULT_UDP_SOCKET 3
94 
95 #define M2M_HTTPD_PROFILE_ENABLE
96 
97 /* Global typedefs ==============================================================================*/
98 
106 typedef enum M2MB_PROFILE_EVENT
107 {
159 
161 
162 extern UINT8* m2mb_profile_event_str[];
163 
165 {
166  return m2mb_profile_event_str[event];
167 }
168 
169 
216  UINT8 device_id,
217  M2MB_PROFILE_EVENT_T event,
218  M2MB_STATUS_T status,
219  VOID *pData
223  );
224 
233 typedef struct M2MB_WLAN_STA_CFG_S
234 {
237  UINT8 ssid[33];
239  UINT8 pwd[65];
251 
260 {
266 
274 typedef struct M2M_IP_CFG_S
275 {
284 
292 typedef struct M2MB_STA_SCAN_CFG_S
293 {
316 
324 typedef struct M2MB_ROAMING_CFG_S
325 {
337 
338 typedef struct M2MB_POWER_SAVE_CFG_S
339 {
346 
347 typedef struct M2MB_EAP_CONF_S
348 {
353  UINT8 id[33];
355 
363 typedef struct M2MB_STA_CFG_S
364 {
372 
383 {
384  UINT8 IP[16];
385  UINT8 DNS[16];
389 
390 
398 typedef struct M2MB_AP_WLAN_CFG_S
399 {
402  UINT8 ssid[33];
404  UINT8 pwd[65];
419 
427 typedef struct M2MB_DHCP_SRV_CFG_S
428 {
433 
441 typedef struct M2MB_AP_CFG_S
442 {
447 
458 {
459  UINT8 ssid[32];
460  UINT8 IP[16];
462 
471 typedef struct M2MB_DNS_HOST_CFG_S
472 {
474  UINT8 name[129];
475  UINT8 ip[24];
478 
487 {
491 
499 typedef struct M2MB_MDNS_HOST_CFG_S
500 {
503 // UINT32 ttl; /**< TTL for mDNS host */
505 
506 
515 {
519 // UINT8 service_subtype[33];
520 // UINT8 protocol[17];
521 // UINT8 domain[65];
524 // UINT32 ttl;
526 
528 {
532 
540 typedef struct M2MB_MDNS_CFG_S
541 {
553 typedef struct M2MB_UDP_CFG_S
554 {
564 
572 typedef struct M2MB_UDP_CFG_ARRAY_S
573 {
577 
587 {
592  UINT16 port; // not valid for other connection: DEFAULT_TCP_CLIENT and DEFAULT_UDP_SOCKET
593  M2MB_IP46_ADDR_T addr; // not valid for other connection: DEFAULT_TCP_CLIENT and DEFAULT_UDP_SOCKET
596 
604 typedef struct M2MB_T_CFG_S
605 {
615 }M2MB_T_CFG_T;
616 
624 typedef struct M2MB_T_CFG_ARRAY_S
625 {
629 
637 typedef struct M2MB_PROFILE_UART_CFG
638 {
648 
658 {
662 
671 typedef struct M2MB_PROFILE_UART_CB
672 {
676 
685 {
689 
698 {
702 
710 typedef struct M2MB_HTTPC_CGF_S
711 {
718 
727 {
750 
759 {
761  CHAR name[129];
763 
772 {
776 
784 typedef struct M2MB_HTTPD_PROFILE_S
785 {
790 
798 typedef struct M2MB_SNTP_CFG_S
799 {
805 
806 typedef struct M2MB_RETRY_CFG_S
807 {
815 
816 
818 {
826 
835 {
846 typedef struct M2MB_SYSTEM_CFG_S
847 {
862 #ifdef M2M_HTTPD_PROFILE_ENABLE
864 #endif
868 
870 
871 /*---------------------------------------------------------------------------*/
933 /*---------------------------------------------------------------------------*/
935 
936 /*---------------------------------------------------------------------------*/
970 /*---------------------------------------------------------------------------*/
972 
973 /*---------------------------------------------------------------------------*/
1008 /*---------------------------------------------------------------------------*/
1010 
1014 /*-----------------------------------------------------------------------------------------------*/
1015 
1016 #ifdef __cplusplus
1017 }
1018 #endif
1019 #endif /* _M2MB_PROFILE_H_ */
M2MB_POWER_SAVE_CFG_T power_save
Definition: m2mb_profile.h:369
UINT16 httpc_max_body_len
Definition: m2mb_profile.h:715
Socket IPv4/IPv6 Internet address union.
Definition: m2mb_socket.h:386
UINT16 l3_retry_time_delay
Definition: m2mb_profile.h:811
struct M2MB_RETRY_CFG_S M2MB_RETRY_CFG_T
M2MB_IP46_ADDR_T addr
Definition: m2mb_profile.h:593
Debug module configuration context.
Definition: m2mb_dbg.h:214
AP cfg structure.
Definition: m2mb_profile.h:441
struct M2MB_HTTPC_CGF_S M2MB_HTTPC_CFG_ARRAY_T
HTTP client cfg structure.
struct M2MB_UDP_CFG_S M2MB_UDP_CFG_T
UDP cfg structure.
struct M2MB_SYSTEM_CFG_S M2MB_SYSTEM_CFG_T
System cfg structure.
M2MB_STATUS_T(* M2MB_PROFILE_APPLY_CB_T)(UINT8 device_id, M2MB_PROFILE_EVENT_T event, M2MB_STATUS_T status, VOID *pData)
Profile apply callback prototype.
Definition: m2mb_profile.h:215
M2MB_DNS_HOST_CFG_T cfg[]
Definition: m2mb_profile.h:489
unsigned char UINT8
Definition: m2mb_types.h:86
M2MB_DNS_HOST_CFG_ARRAY_T * pDNSHost
Definition: m2mb_profile.h:853
UINT32 inactivity_ap_period
Definition: m2mb_profile.h:416
M2MB_DBG_CFG_T d_cfg
Definition: m2mb_profile.h:687
struct M2MB_PROFILE_GPIO_CFG_S M2MB_PROFILE_GPIO_CFG_T
UINT32 force_scan_interval
Definition: m2mb_profile.h:332
struct M2MB_HTTPD_PROFILE_S M2MB_HTTPD_PROFILE_T
HTTP Server Profile cfg structure.
M2MB_RETRY_CFG_T ncm_retry_cfg
Definition: m2mb_profile.h:861
M2MB_PROFILE_GPIO_CFG_T gpio_cfg[]
Definition: m2mb_profile.h:837
M2MB_STA_CFG_T sta
Definition: m2mb_profile.h:851
struct M2MB_PROFILE_DBG_CFG_S M2MB_PROFILE_DBG_CFG_T
Debug configuration structure.
M2MB_PROFILE_XFP_CFG_T xfp_cfg
Definition: m2mb_profile.h:859
System cfg structure.
Definition: m2mb_profile.h:846
struct M2MB_WLAN_STA_CFG_ARRAY_S M2MB_WLAN_STA_CFG_ARRAY_T
Array of WLAN STATION configuration structure.
DNS host cfg structure.
Definition: m2mb_profile.h:471
UINT8 * m2mb_profile_event_str[]
M2MB_PROFILE_DBG_CFG_T dbg_cfg
Definition: m2mb_profile.h:858
struct M2MB_AP_CFG_S M2MB_AP_CFG_T
AP cfg structure.
M2MB_SNTP_CFG_T sntp_cfg
Definition: m2mb_profile.h:860
M2MB_PROFILE_UART_CFG_T * pCfg
Definition: m2mb_profile.h:659
M2MB_STA_SCAN_CFG_T scan
Definition: m2mb_profile.h:367
UINT16 httpc_max_header_len
Definition: m2mb_profile.h:716
struct M2MB_PROFILE_GPIO_CFG_ARRAY_S M2MB_PROFILE_GPIO_CFG_ARRAY_T
GPIO cfg structure for the system.
UINT8 password[33]
Definition: m2mb_profile.h:352
MDNS cfg structure.
Definition: m2mb_profile.h:540
M2MB_PROFILE_EVENT_T event
Definition: m2mb_profile.h:850
INT32 M2MB_STATUS_T
Definition: m2mb_status.h:97
INT32 m2mb_profile_tcp_soc_init(M2MB_T_CFG_T *t_cfg)
m2mb_profile_tcp_soc_init is called to apply the profile related to TCP.
M2MB_PROFILE_UART_CFG_T uart[2]
Definition: m2mb_profile.h:857
struct M2MB_SNTP_CFG_S M2MB_SNTP_CFG_T
SNTP client cfg structure.
struct M2MB_POWER_SAVE_CFG_S M2MB_POWER_SAVE_CFG_T
UINT8 username[33]
Definition: m2mb_profile.h:351
M2MB_IP_CFG_T ip
Definition: m2mb_profile.h:444
M2MB_HTTPD_PROFILE_URI_CFG_ARRAY_T * pURI
Definition: m2mb_profile.h:788
struct M2MB_T_CFG_S M2MB_T_CFG_T
TCP cfg structure.
unsigned short UINT16
Definition: m2mb_types.h:87
struct M2MB_PROFILE_XFP_CFG_S M2MB_PROFILE_XFP_CFG_T
XFP configuration structure.
struct M2MB_HTTPD_PROFILE_URI_CFG_ARRAY_S M2MB_HTTPD_PROFILE_URI_CFG_ARRAY_T
HTTP Server URI config structure.
TCP cfg structure for the system.
Definition: m2mb_profile.h:624
UINT8 channel_list[10]
Definition: m2mb_profile.h:335
struct M2MB_STA_CFG_S M2MB_STA_CFG_T
STA cfg structure.
M2MB_MDNS_HOST_CFG_T host
Definition: m2mb_profile.h:543
INT32 m2mb_profile_apply(const M2MB_SYSTEM_CFG_T *pCfg, M2MB_PROFILE_APPLY_CB_T cb)
m2mb_profile_apply is called to apply the profile.
struct M2MB_DHCP_SRV_CFG_S M2MB_DHCP_SRV_CFG_T
DHCP server cfg structure.
M2MB_DHCP_SRV_CFG_T dhcp
Definition: m2mb_profile.h:445
struct M2MB_MDNS_SERVICE_CFG_S M2MB_MDNS_SERVICE_CFG_T
MDNS service cfg structure.
UINT32 ip_dns2
Definition: m2mb_profile.h:281
M2MB_WLAN_STA_CFG_T wlan[1]
Definition: m2mb_profile.h:264
MDNS host cfg structure.
Definition: m2mb_profile.h:499
XFP configuration structure.
Definition: m2mb_profile.h:697
STA scan cfg structure.
Definition: m2mb_profile.h:292
char CHAR
Definition: m2mb_types.h:76
M2MB_PROFILE_GPIO_CFG_ARRAY_T * gpio
Definition: m2mb_profile.h:866
struct M2MB_HTTPD_PROFILE_CFG_S M2MB_HTTPD_PROFILE_CFG_T
HTTP Server cfg structure.
M2MB_PROFILE_EVENT
Profile event enumeration.
Definition: m2mb_profile.h:106
UINT32 ip_dns1
Definition: m2mb_profile.h:280
struct M2MB_PROFILE_UART_CB M2MB_PROFILE_UART_CB_T
UART read and write callback data structure.
UINT16 l4_retry_time_delay
Definition: m2mb_profile.h:813
struct M2M_PROFILE_STA_SET_RESULT_S M2M_PROFILE_STA_SET_RESULT_T
STA structure used in user callback to update the status of STA initialization.
struct M2MB_EAP_CONF_S M2MB_EAP_CONF_T
UDP cfg structure for the system.
Definition: m2mb_profile.h:572
struct M2MB_PROFILE_SOC_RESULT M2MB_PROFILE_SOC_RESULT_T
Socket for UDP & TCP initialization result.
HTTP Server Profile cfg structure.
Definition: m2mb_profile.h:784
STA structure used in user callback to update the status of STA initialization.
Definition: m2mb_profile.h:382
M2MB_AP_CFG_T ap
Definition: m2mb_profile.h:852
struct M2MB_DNS_HOST_CFG_S M2MB_DNS_HOST_CFG_T
DNS host cfg structure.
UINT16 l2_retry_time_delay
Definition: m2mb_profile.h:809
UINT8 serverName[33]
Definition: m2mb_profile.h:802
Array of DNS host cfg structure.
Definition: m2mb_profile.h:486
void VOID
Definition: m2mb_types.h:74
struct M2MB_DNS_HOST_CFG_ARRAY_S M2MB_DNS_HOST_CFG_ARRAY_T
Array of DNS host cfg structure.
M2MB_AP_WLAN_CFG_T wlan
Definition: m2mb_profile.h:443
UINT16 rssi_high_threshold
Definition: m2mb_profile.h:328
UART initialization result.
Definition: m2mb_profile.h:657
WLAN sta structure.
Definition: m2mb_profile.h:233
BLE driver functionality.
TCP cfg structure.
Definition: m2mb_profile.h:604
M2MB_MDNS_CFG_T mdns
Definition: m2mb_profile.h:854
struct M2MB_HTTPD_PROFILE_URI_INFO_S M2MB_HTTPD_PROFILE_URI_INFO_T
HTTP Server URI info structure.
UDP cfg structure.
Definition: m2mb_profile.h:553
MDNS service cfg structure.
Definition: m2mb_profile.h:514
M2MB_WLAN_STA_CFG_ARRAY_T * pWlan
Definition: m2mb_profile.h:365
struct M2MB_PROFILE_UART_OPEN_CB M2MB_PROFILE_UART_OPEN_CB_T
UART initialization result.
struct M2MB_T_CFG_ARRAY_S M2MB_TCP_CFG_ARRAY_T
TCP cfg structure for the system.
M2MB_HTTPD_PROFILE_CFG_T cfg
Definition: m2mb_profile.h:787
M2MB_ROAMING_CFG_T roaming
Definition: m2mb_profile.h:368
M2MB_TCP_CFG_ARRAY_T * pTcp
Definition: m2mb_profile.h:856
HTTP Server cfg structure.
Definition: m2mb_profile.h:726
unsigned long int UINT32
Definition: m2mb_types.h:88
M2MB_HTTPD_PROFILE_URI_INFO_T info[]
Definition: m2mb_profile.h:774
Debug configuration structure.
Definition: m2mb_profile.h:684
IP cfg structure.
Definition: m2mb_profile.h:274
struct M2MB_PROFILE_SOC_RESULT * next
Definition: m2mb_profile.h:594
M2MB_HTTPD_PROFILE_T httpd
Definition: m2mb_profile.h:863
signed int INT32
Definition: m2mb_types.h:82
UART configuration structure.
Definition: m2mb_profile.h:637
M2MB_MDNS_SERVICE_CFG_ARRAY_T * pService
Definition: m2mb_profile.h:544
Json complex object structure.
Definition: m2mb_json.h:244
Structure for all BLE configuration parameters.
UINT32 poll_interval
Definition: m2mb_profile.h:803
Socket for UDP & TCP initialization result.
Definition: m2mb_profile.h:586
struct M2MB_STA_SCAN_CFG_S M2MB_STA_SCAN_CFG_T
STA scan cfg structure.
enum M2MB_PROFILE_EVENT M2MB_PROFILE_EVENT_T
Profile event enumeration.
M2MB_UDP_CFG_ARRAY_T * pUdp
Definition: m2mb_profile.h:855
void * HANDLE
Definition: m2mb_types.h:98
struct M2M_PROFILE_AP_SET_RESULT_S M2M_PROFILE_AP_SET_RESULT_T
AP structure used in user callback to update the status of AP initialization.
DHCP server cfg structure.
Definition: m2mb_profile.h:427
struct M2MB_MDNS_SERVICE_CFG_ARRAY_S M2MB_MDNS_SERVICE_CFG_ARRAY_T
unsigned long long UINT64
Definition: m2mb_types.h:90
HTTP Server URI config structure.
Definition: m2mb_profile.h:771
STA cfg structure.
Definition: m2mb_profile.h:363
char * m2mb_get_profile_event_string(M2MB_PROFILE_EVENT_T event)
Definition: m2mb_profile.h:164
struct M2MB_UDP_CFG_ARRAY_S M2MB_UDP_CFG_ARRAY_T
UDP cfg structure for the system.
M2MB_IP_CFG_T ip
Definition: m2mb_profile.h:366
M2MB_T_CFG_T t_cfg[]
Definition: m2mb_profile.h:627
struct M2MB_MDNS_HOST_CFG_S M2MB_MDNS_HOST_CFG_T
MDNS host cfg structure.
HTTP client cfg structure.
Definition: m2mb_profile.h:710
Roaming cfg structure.
Definition: m2mb_profile.h:324
UART read and write callback data structure.
Definition: m2mb_profile.h:671
Array of WLAN STATION configuration structure.
Definition: m2mb_profile.h:259
struct M2M_IP_CFG_S M2MB_IP_CFG_T
IP cfg structure.
struct M2MB_ROAMING_CFG_S M2MB_ROAMING_CFG_T
Roaming cfg structure.
INT32 m2mb_profile_udp_soc_init(M2MB_UDP_CFG_T *udp_cfg)
m2mb_profile_udp_soc_init is called to apply the profile related to UDP.
struct M2MB_MDNS_CFG_S M2MB_MDNS_CFG_T
MDNS cfg structure.
GPIO cfg structure for the system.
Definition: m2mb_profile.h:834
AP structure used in user callback to update the status of AP initialization.
Definition: m2mb_profile.h:457
M2MB_EAP_CONF_T eap_conf
Definition: m2mb_profile.h:370
struct M2MB_PROFILE_UART_CFG M2MB_PROFILE_UART_CFG_T
UART configuration structure.
const M2MB_JSON_COMPLEX_OBJ_T system_schema
struct M2MB_WLAN_STA_CFG_S M2MB_WLAN_STA_CFG_T
WLAN sta structure.
SNTP client cfg structure.
Definition: m2mb_profile.h:798
struct M2MB_AP_WLAN_CFG_S M2MB_AP_WLAN_CFG_T
AP WLAN cfg structure.
AP WLAN cfg structure.
Definition: m2mb_profile.h:398
M2MB_UDP_CFG_T udp_cfg[]
Definition: m2mb_profile.h:575
M2MB_MDNS_SERVICE_CFG_T cfg[]
Definition: m2mb_profile.h:530
UINT32 ip_subnet
Definition: m2mb_profile.h:278
HTTP Server URI info structure.
Definition: m2mb_profile.h:758
M2MB_BLE_CGF_T ble
Definition: m2mb_profile.h:865