11/*
2- * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -799,7 +799,32 @@ typedef struct {
799799#define ESP_WIFI_MAX_SVC_NAME_LEN 256 /**< Maximum length of NAN service name */
800800#define ESP_WIFI_MAX_FILTER_LEN 256 /**< Maximum length of NAN service filter */
801801#define ESP_WIFI_MAX_SVC_INFO_LEN 64 /**< Maximum length of NAN service info */
802+ #define ESP_WIFI_MAX_FUP_SSI_LEN 2048 /**< Maximum length of NAN Service Specific Info in a Follow-up frame */
803+ #define ESP_WIFI_MAX_SVC_SSI_LEN 512 /**< Maximum length of NAN Service Specific Info in Publish/Subscribe SDF's */
802804#define ESP_WIFI_MAX_NEIGHBOR_REP_LEN 64 /**< Maximum length of NAN Neighbor Report */
805+ #define WIFI_OUI_LEN 3 /**< Length of OUI bytes in IE or attributes */
806+
807+ /**
808+ * @brief Protocol types in NAN service specific info attribute
809+ *
810+ */
811+ typedef enum {
812+ WIFI_SVC_PROTO_RESERVED = 0 , /**< Value 0 Reserved */
813+ WIFI_SVC_PROTO_BONJOUR = 1 , /**< Bonjour Protocol */
814+ WIFI_SVC_PROTO_GENERIC = 2 , /**< Generic Service Protocol */
815+ WIFI_SVC_PROTO_CSA_MATTER = 3 , /**< CSA Matter specific protocol */
816+ WIFI_SVC_PROTO_MAX , /**< Values 4-255 Reserved */
817+ } wifi_nan_svc_proto_t ;
818+
819+ /**
820+ * @brief WFA defined Protocol types in NAN service specific info attribute
821+ *
822+ */
823+ typedef struct {
824+ uint8_t wfa_oui [WIFI_OUI_LEN ]; /**< WFA OUI - 0x50, 0x6F, 0x9A */
825+ wifi_nan_svc_proto_t proto ; /**< WFA defined protocol types */
826+ uint8_t payload [0 ]; /**< Service Info payload */
827+ } wifi_nan_wfa_ssi_t ;
803828
804829/**
805830 * @brief NAN Services types
@@ -820,10 +845,14 @@ typedef struct {
820845 char service_name [ESP_WIFI_MAX_SVC_NAME_LEN ]; /**< Service name identifier */
821846 wifi_nan_service_type_t type ; /**< Service type */
822847 char matching_filter [ESP_WIFI_MAX_FILTER_LEN ]; /**< Comma separated filters for filtering services */
823- char svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ]; /**< Service info shared in Publish frame */
848+ char svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ]; /**< To be deprecated in next major release, use ssi instead */
824849 uint8_t single_replied_event : 1 ; /**< Give single Replied event or every time */
825850 uint8_t datapath_reqd : 1 ; /**< NAN Datapath required for the service */
826- uint8_t reserved : 6 ; /**< Reserved */
851+ uint8_t fsd_reqd : 1 ; /**< Further Service Discovery(FSD) required */
852+ uint8_t fsd_gas : 1 ; /**< 0 - Follow-up used for FSD, 1 - GAS used for FSD */
853+ uint8_t reserved : 4 ; /**< Reserved */
854+ uint16_t ssi_len ; /**< Length of service specific info, maximum allowed length - ESP_WIFI_MAX_SVC_SSI_LEN */
855+ uint8_t * ssi ; /**< Service Specific Info of type wifi_nan_wfa_ssi_t for WFA defined protocols, otherwise proprietary and defined by Applications */
827856} wifi_nan_publish_cfg_t ;
828857
829858/**
@@ -834,20 +863,27 @@ typedef struct {
834863 char service_name [ESP_WIFI_MAX_SVC_NAME_LEN ]; /**< Service name identifier */
835864 wifi_nan_service_type_t type ; /**< Service type */
836865 char matching_filter [ESP_WIFI_MAX_FILTER_LEN ]; /**< Comma separated filters for filtering services */
837- char svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ]; /**< Service info shared in Subscribe frame */
838- uint8_t single_match_event : 1 ; /**< Give single Match event or every time */
839- uint8_t reserved : 7 ; /**< Reserved */
866+ char svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ]; /**< To be deprecated in next major release, use ssi instead */
867+ uint8_t single_match_event : 1 ; /**< Give single Match event(per SSI update) or every time */
868+ uint8_t datapath_reqd : 1 ; /**< NAN Datapath required for the service */
869+ uint8_t fsd_reqd : 1 ; /**< Further Service Discovery(FSD) required */
870+ uint8_t fsd_gas : 1 ; /**< 0 - Follow-up used for FSD, 1 - GAS used for FSD */
871+ uint8_t reserved : 4 ; /**< Reserved */
872+ uint16_t ssi_len ; /**< Length of service specific info, maximum allowed length - ESP_WIFI_MAX_SVC_SSI_LEN */
873+ uint8_t * ssi ; /**< Service Specific Info of type wifi_nan_wfa_ssi_t for WFA defined protocols, otherwise proprietary and defined by Applications */
840874} wifi_nan_subscribe_cfg_t ;
841875
842876/**
843877 * @brief NAN Follow-up parameters
844878 *
845879 */
846880typedef struct {
847- uint8_t inst_id ; /**< Own service instance id */
848- uint8_t peer_inst_id ; /**< Peer's service instance id */
849- uint8_t peer_mac [6 ]; /**< Peer's MAC address */
850- char svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ];/**< Service info(or message) to be shared */
881+ uint8_t inst_id ; /**< Own service instance id */
882+ uint8_t peer_inst_id ; /**< Peer's service instance id */
883+ uint8_t peer_mac [6 ]; /**< Peer's MAC address */
884+ char svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ]; /**< To be deprecated in next major release, use ssi instead */
885+ uint16_t ssi_len ; /**< Length of service specific info, maximum allowed length - ESP_WIFI_MAX_FUP_SSI_LEN */
886+ uint8_t * ssi ; /**< Service Specific Info of type wifi_nan_wfa_ssi_t for WFA defined protocols, otherwise proprietary and defined by Applications */
851887} wifi_nan_followup_params_t ;
852888
853889/**
@@ -1255,6 +1291,15 @@ typedef struct {
12551291 uint8_t publish_id ; /**< Publish Service Identifier */
12561292 uint8_t pub_if_mac [6 ]; /**< NAN Interface MAC of the Publisher */
12571293 bool update_pub_id ; /**< Indicates whether publisher's service ID needs to be updated */
1294+ uint8_t datapath_reqd : 1 ; /**< NAN Datapath required for the service */
1295+ uint8_t fsd_reqd : 1 ; /**< Further Service Discovery(FSD) required */
1296+ uint8_t fsd_gas : 1 ; /**< 0 - Follow-up used for FSD, 1 - GAS used for FSD */
1297+ uint8_t reserved : 5 ; /**< Reserved */
1298+ uint32_t reserved_1 ; /**< Reserved */
1299+ uint32_t reserved_2 ; /**< Reserved */
1300+ uint8_t ssi_version ; /**< Indicates version of SSI in Publish instance, 0 if not available */
1301+ uint16_t ssi_len ; /**< Length of service specific info */
1302+ uint8_t ssi []; /**< Service specific info of Publisher */
12581303} wifi_event_nan_svc_match_t ;
12591304
12601305/**
@@ -1264,6 +1309,10 @@ typedef struct {
12641309 uint8_t publish_id ; /**< Publish Service Identifier */
12651310 uint8_t subscribe_id ; /**< Subscribe Service Identifier */
12661311 uint8_t sub_if_mac [6 ]; /**< NAN Interface MAC of the Subscriber */
1312+ uint32_t reserved_1 ; /**< Reserved */
1313+ uint32_t reserved_2 ; /**< Reserved */
1314+ uint16_t ssi_len ; /**< Length of service specific info */
1315+ uint8_t ssi []; /**< Service specific info of Subscriber */
12671316} wifi_event_nan_replied_t ;
12681317
12691318/**
@@ -1273,7 +1322,11 @@ typedef struct {
12731322 uint8_t inst_id ; /**< Our Service Identifier */
12741323 uint8_t peer_inst_id ; /**< Peer's Service Identifier */
12751324 uint8_t peer_if_mac [6 ]; /**< Peer's NAN Interface MAC */
1276- uint8_t peer_svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ];/**< Peer Service Info */
1325+ uint8_t peer_svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ];/**< To be deprecated in next major release, use ssi instead */
1326+ uint32_t reserved_1 ; /**< Reserved */
1327+ uint32_t reserved_2 ; /**< Reserved */
1328+ uint16_t ssi_len ; /**< Length of service specific info */
1329+ uint8_t ssi []; /**< Service specific info from Follow-up */
12771330} wifi_event_nan_receive_t ;
12781331
12791332/**
@@ -1284,7 +1337,11 @@ typedef struct {
12841337 uint8_t ndp_id ; /**< NDP instance id */
12851338 uint8_t peer_nmi [6 ]; /**< Peer's NAN Management Interface MAC */
12861339 uint8_t peer_ndi [6 ]; /**< Peer's NAN Data Interface MAC */
1287- uint8_t svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ];/**< Service Specific Info */
1340+ uint8_t svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ];/**< To be deprecated in next major release, use ssi instead */
1341+ uint32_t reserved_1 ; /**< Reserved */
1342+ uint32_t reserved_2 ; /**< Reserved */
1343+ uint16_t ssi_len ; /**< Length of service specific info */
1344+ uint8_t ssi []; /**< Service specific info from NDP/NDPE Attribute */
12881345} wifi_event_ndp_indication_t ;
12891346
12901347/**
@@ -1296,7 +1353,11 @@ typedef struct {
12961353 uint8_t peer_nmi [6 ]; /**< Peer's NAN Management Interface MAC */
12971354 uint8_t peer_ndi [6 ]; /**< Peer's NAN Data Interface MAC */
12981355 uint8_t own_ndi [6 ]; /**< Own NAN Data Interface MAC */
1299- uint8_t svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ];/**< Service Specific Info */
1356+ uint8_t svc_info [ESP_WIFI_MAX_SVC_INFO_LEN ];/**< To be deprecated in next major release, use ssi instead */
1357+ uint32_t reserved_1 ; /**< Reserved */
1358+ uint32_t reserved_2 ; /**< Reserved */
1359+ uint16_t ssi_len ; /**< Length of Service Specific Info */
1360+ uint8_t ssi []; /**< Service specific info from NDP/NDPE Attribute */
13001361} wifi_event_ndp_confirm_t ;
13011362
13021363/**
0 commit comments