void set_autoconnection_mode_handler(GVariant *parameters, void *dest);
void is_autoconnection_mode_handler(GVariant *parameters, void *dest);
void get_operating_channel_handler(GVariant *parameters, void *dest);
+void get_supported_channels_handler(GVariant *parameters, void *dest);
void set_autoconnection_peer_handler(GVariant *parameters, void *dest);
void get_interface_name_handler(GVariant *parameters, void *dest);
void get_subnet_mask_handler(GVariant *parameters, void *dest);
return ops->remove_all_persistent_device();
}
+
+int wfd_oem_get_supported_channels(wfd_oem_ops_s *ops, wfd_oem_supported_channels_s *data)
+{
+ if (!ops || !ops->get_supported_channels)
+ return -1;
+
+ return ops->get_supported_channels(data);
+}
#define OEM_MAX_PEER_NUM 8
+#define P2P_MAX_CHANNELS 50
+
typedef enum {
WFD_OEM_SC_SUCCESS = 0,
WFD_OEM_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
} wfd_oem_persistent_group_s;
typedef struct {
+ int channels[P2P_MAX_CHANNELS];
+ int count;
+} wfd_oem_supported_channels_s;
+
+typedef struct {
void (*deactivated_cb) (wfd_oem_event_s *event);
void (*peer_found_cb) (wfd_oem_event_s *event);
void (*peer_disappeared_cb) (wfd_oem_event_s *event);
int (*remove_persistent_device) (unsigned char *peer_mac_addr);
int (*remove_all_persistent_device) (void);
+ int (*get_supported_channels) (wfd_oem_supported_channels_s *data);
+
void *extra_data;
} wfd_oem_ops_s;
int wfd_oem_remove_persistent_device(wfd_oem_ops_s *ops, unsigned char *peer_mac_address);
int wfd_oem_remove_all_persistent_device(wfd_oem_ops_s *ops);
+int wfd_oem_get_supported_channels(wfd_oem_ops_s *ops, wfd_oem_supported_channels_s *data);
+
#if defined TIZEN_ENABLE_PRD
typedef struct {
void (*prd_example_cb) (wfd_oem_event_s *event);
Name: wifi-direct-manager
Summary: Wi-Fi Direct manger
-Version: 1.2.282
+Version: 1.3.1
Release: 1
Group: Network & Connectivity/Wireless
License: Apache-2.0
int ws_remove_persistent_device(unsigned char *mac_addr);
int ws_remove_all_persistent_device(void);
+int ws_get_supported_channels(wfd_oem_supported_channels_s *data);
+
#ifdef __cplusplus
}
#endif
.remove_persistent_device = ws_remove_persistent_device,
.remove_all_persistent_device = ws_remove_all_persistent_device,
+ .get_supported_channels = ws_get_supported_channels,
+
.extra_data = NULL
};
__WDP_LOG_FUNC_EXIT__;
return res;
}
+
+static void __ws_get_supported_channels_reply(GVariant *reply, void *user_data)
+{
+ __WDP_LOG_FUNC_ENTER__;
+
+ GVariantIter *iter = NULL;
+ wfd_oem_supported_channels_s *data = (wfd_oem_supported_channels_s *)user_data;
+
+ if (reply) {
+ int channel = 0;
+
+ g_variant_get(reply, "(ai)", &iter);
+
+ while (g_variant_iter_loop(iter, "i", &channel))
+ data->channels[data->count++] = channel;
+
+ g_variant_iter_free (iter);
+
+ } else {
+ WDP_LOGE("Reply is NULL");
+ }
+ __WDP_LOG_FUNC_EXIT__;
+}
+
+int ws_get_supported_channels(wfd_oem_supported_channels_s *data)
+{
+ __WDP_LOG_FUNC_ENTER__;
+ int res = 0;
+ dbus_method_param_s params;
+
+ if (!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ __WDP_LOG_FUNC_EXIT__;
+ return -1;
+ }
+
+ memset(¶ms, 0x0, sizeof(dbus_method_param_s));
+ memset(data, 0x0, sizeof(wfd_oem_supported_channels_s));
+
+ dbus_set_method_param(¶ms, "GetSupportedChannels", g_pd->iface_path, g_pd->g_dbus);
+ params.params = NULL;
+
+ res = dbus_method_call(¶ms, SUPPLICANT_P2PDEVICE,
+ __ws_get_supported_channels_reply, data);
+ if (res < 0) {
+ WDP_LOGE("Failed to GetSupportedChannels");
+ } else {
+ WDP_LOGD("Succeeded to GetSupportedChannels");
+ }
+
+ __WDP_LOG_FUNC_EXIT__;
+ return res;
+}
.get_vsie = ws_get_vsie,
.remove_vsie = ws_remove_vsie,
+ .get_supported_channels = ws_get_supported_channels,
+
};
int wfd_plugin_load(wfd_oem_ops_s **ops)
__WDP_LOG_FUNC_EXIT__;
return -1;
}
+
+int ws_get_supported_channels(wfd_oem_supported_channels_s *data)
+{
+ __WDP_LOG_FUNC_ENTER__;
+
+ __WDP_LOG_FUNC_EXIT__;
+ return -1;
+}
"<arg type='i' name='error_code' direction='out'/>"
"<arg type='i' name='operating_channel' direction='out'/>"
"</method>"
+ "<method name='GetSupportedChannels'>"
+ "<arg type='i' name='error_code' direction='out'/>"
+ "<arg type='au' name='supported_channels' direction='out'/>"
+ "</method>"
"<method name='SetAutoConnectionPeer'>"
"<arg type='s' name='peer_mac_address' direction='in'/>"
"<arg type='i' name='error_code' direction='out'/>"
{"SetAutoConnectionMode", set_autoconnection_mode_handler},
{"IsAutoConnectionMode", is_autoconnection_mode_handler},
{"GetOperatingChannel", get_operating_channel_handler},
+ {"GetSupportedChannels", get_supported_channels_handler},
{"SetAutoConnectionPeer", set_autoconnection_peer_handler},
{"GetConnectingPeer", get_connecting_peer_handler},
{"GetInterfaceName", get_interface_name_handler},
return;
}
+void get_supported_channels_handler(GVariant *parameters, void *dest)
+{
+ __WDS_LOG_FUNC_ENTER__;//LCOV_EXCL_LINE
+ wfd_manager_s *manager = wfd_get_manager();
+ GVariant *return_parameters = NULL;
+ GVariantBuilder *builder = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
+ wfd_oem_supported_channels_s channel_data = {0, };
+
+ WIFI_DIRECT_METHOD_RET_IF_NULL(manager);
+
+ ret = wfd_oem_get_supported_channels(manager->oem_ops, &channel_data);
+ if (ret < 0)
+ WIFI_DIRECT_METHOD_RET_ERR(WIFI_DIRECT_ERROR_OPERATION_FAILED, dest);
+
+ WDS_LOGD("Supported channels :-");
+ builder = g_variant_builder_new(G_VARIANT_TYPE("au"));
+ for (int i = 0; i < channel_data.count; i++) {
+ WDS_LOGD("-> [%d]", channel_data.channels[i]);
+ g_variant_builder_add(builder, "u", channel_data.channels[i]);
+ }
+
+ return_parameters = g_variant_new("(iau)", ret, builder);
+ g_variant_builder_unref(builder);
+ wfd_manager_dbus_reply_params((GDBusMethodInvocation *)dest, return_parameters);
+
+ __WDS_LOG_FUNC_EXIT__;//LCOV_EXCL_LINE
+ return;
+}
+
void set_autoconnection_peer_handler(GVariant *parameters, void *dest)
{
__WDS_LOG_FUNC_ENTER__;//LCOV_EXCL_LINE