WIFI_MESH_IP_CONFIG_TYPE_STATIC /**< Static IP Config Type */
} wifi_mesh_ip_config_type_e;
+/**
+ * @brief Enumeration for the station type of the Wi-Fi Mesh network.
+ * @since_tizen 5.0
+ */
+typedef enum {
+ MESH_STATION_TYPE_MESH_POINT = 0, /**< Mesh Point Station */
+ MESH_STATION_TYPE_SOFTAP, /**< SoftAP Station */
+} wifi_mesh_station_type_e;
+
/**
* @brief The events for wifi_mesh_event_cb
*
*/
typedef struct {
char bssid[MAX_BSSID_LEN]; /**< The BSSID of the station that generated the event */
+ wifi_mesh_station_type_e station_type; /**< Type of Station */
} wifi_mesh_other_station_event_s;
/**
free(ev.data.connection_state);
} else if (0 == g_strcmp0(signal_name, "sta_joined")) {
char *bssid = NULL;
+ int station_type = -1;
wifi_mesh_event_data_s ev;
ev.data.sta_info = calloc(1, sizeof(wifi_mesh_other_station_event_s));
if (NULL == ev.data.sta_info)
LOGE("Failed to memory allocation !"); // LCOV_EXCL_LINE
- g_variant_get(parameters, "(s)", &bssid);
+ g_variant_get(parameters, "(si)", &bssid, &station_type);
memcpy(ev.data.sta_info->bssid, bssid, MAX_BSSID_LEN);
+ ev.data.sta_info->station_type = station_type;
h->event_handler(WIFI_MESH_EVENT_STATION_JOIN, &ev,
h->event_handler_user_data);
free(ev.data.sta_info);
} else if (0 == g_strcmp0(signal_name, "sta_left")) {
char *bssid = NULL;
+ int station_type = -1;
wifi_mesh_event_data_s ev;
ev.data.sta_info = calloc(1, sizeof(wifi_mesh_other_station_event_s));
if (NULL == ev.data.sta_info)
LOGE("Failed to memory allocation !"); // LCOV_EXCL_LINE
- g_variant_get(parameters, "(s)", &bssid);
+ g_variant_get(parameters, "(si)", &bssid, &station_type);
memcpy(ev.data.sta_info->bssid, bssid, MAX_BSSID_LEN);
+ ev.data.sta_info->station_type = station_type;
h->event_handler(WIFI_MESH_EVENT_STATION_LEFT, &ev,
h->event_handler_user_data);
free(ev.data.sta_info);
}
}
+static const char *wifi_mesh_sta_type_to_string(wifi_mesh_station_type_e e)
+{
+ switch (e) {
+ CASE_TO_STR(MESH_STATION_TYPE_MESH_POINT)
+ CASE_TO_STR(MESH_STATION_TYPE_SOFTAP)
+ default :
+ return "Unknown station type";
+ }
+}
+
void event_cb(wifi_mesh_event_e event_type, wifi_mesh_event_data_s* event,
void *user_data)
{
(MESH_SECURITY_SAE == event->data.connection_state->security) ? "SAE" : "NONE");
} break;
case WIFI_MESH_EVENT_STATION_JOIN: {
- msgp(" New Station Joined = %s", event->data.sta_info->bssid);
+ msgp(" New Station of type %s Joined = %s",
+ wifi_mesh_sta_type_to_string(event->data.sta_info->station_type),
+ event->data.sta_info->bssid);
} break;
case WIFI_MESH_EVENT_STATION_LEFT: {
- msgp(" A Station Left = %s", event->data.sta_info->bssid);
+ msgp(" A Station of type %s Left = %s",
+ wifi_mesh_sta_type_to_string(event->data.sta_info->station_type),
+ event->data.sta_info->bssid);
} break;
default:
msgr(" Unexpected event !");