int wifi_mesh_set_softap(wifi_mesh_h handle, const char* ssid, const char* key,
int channel, bool visibility, int max_stations, int security);
+/**
+ * @brief Gets softap options
+ * @details This function gets softap options.
+ *
+ * @since_tizen 4.0
+ *
+ * @param[in] handle The Wi-Fi mesh handle
+ * @param[out] ssid The SSID
+ * @param[out] channel The operating channel number
+ * @param[out] visibility The broadcast option (1:Broadcast SSID, 2:Hidden)
+ * @param[out] max_stations The maximum allowable number of stations (default:10)
+ * @param[out] security Security option (1:WPA1, 2:WPA2)
+ * @param[out] key The pre-shared key
+ *
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #WIFI_MESH_ERROR_NONE Successful
+ * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIFI_MESH_ERROR_IO_ERROR Unexpected d-bus error
+ *
+ * @see wifi_mesh_set_softap()
+ * @see wifi_mesh_enable_softap()
+ * @see wifi_mesh_disable_softap()
+ *
+ */
+int wifi_mesh_get_softap(wifi_mesh_h handle, char **ssid, int *channel,
+ bool *visibility, int *max_stations,
+ int *security, char **key);
+
/**
* @brief Enables softap
* @details This function enables softap.
int _wifi_mesh_unset_gate(wifi_mesh_h handle);
int _wifi_mesh_set_softap(wifi_mesh_h handle, const char* ssid, const char* key, const char* mode,
int channel, int visibility, int max_stations, int security);
+int _wifi_mesh_get_softap(wifi_mesh_h handle, char **ssid, int *channel,
+ bool *visibility, int *max_stations, int *security, char **key);
int _wifi_mesh_enable_softap(wifi_mesh_h handle);
int _wifi_mesh_disable_softap(wifi_mesh_h handle);
int _mesh_create_network(wifi_mesh_h handle, wifi_mesh_network_h _network);
return result;
}
+int _wifi_mesh_get_softap(wifi_mesh_h handle, char **ssid, int *channel,
+ bool *visibility, int *max_stations, int *security, char **key)
+{
+ GVariant *variant = NULL;
+ int result = WIFI_MESH_ERROR_NONE;
+ GError *error = NULL;
+ struct mesh_handle *h = handle;
+
+ if (NULL == h) {
+ /* LCOV_EXCL_START */
+ LOGE("Invaild parameter");
+ return WIFI_MESH_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+
+ if (NULL == h->dbus_connection || NULL == _gproxy_mesh_service) {
+ /* LCOV_EXCL_START */
+ LOGE("I/O error");
+ return WIFI_MESH_ERROR_IO_ERROR;
+ /* LCOV_EXCL_STOP */
+ }
+
+ variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "get_softap", NULL,
+ G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
+ if (variant) {
+ char *_ssid = NULL, *_mode = NULL, *_key = NULL;
+ int _channel = -1, _visibility = -1, _max_sta = -1, _security = -1;
+ g_variant_get(variant, "(ssiiiisi)", &_ssid, &_mode, &_channel,
+ &_visibility, &_max_sta, &_security, &_key, &result);
+ LOGD("get_softap status 0x%x", result);
+ result = __convert_service_error_type(result);
+
+ if (result == WIFI_MESH_ERROR_NONE) {
+ *ssid = g_strdup(_ssid);
+ *channel = _channel;
+ *visibility = _visibility == 1 ? 1 : 0;
+ *max_stations = _max_sta;
+ *security = _security;
+ if (_security == 1)
+ *key = g_strdup(_key);
+ }
+
+ } else if (error) {
+ /* LCOV_EXCL_START */
+ LOGE("Failed DBus call [%s]", error->message);
+ g_error_free(error);
+ return WIFI_MESH_ERROR_IO_ERROR;
+ /* LCOV_EXCL_STOP */
+ }
+
+ return result;
+}
+
int _wifi_mesh_enable_softap(wifi_mesh_h handle)
{
GVariant *variant = NULL;
return rv;
}
+EXPORT_API int wifi_mesh_get_softap(wifi_mesh_h handle, char **ssid,
+ int *channel, bool *visibility, int *max_stations,
+ int *security, char **key)
+{
+ int rv = 0;
+ CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+ if (NULL == handle || ssid == NULL || channel == NULL ||
+ visibility == NULL || max_stations == NULL ||
+ security == NULL || key == NULL) {
+ /* LCOV_EXCL_START */
+ LOGE("Invalid parameter");
+ return WIFI_MESH_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+
+ rv = _wifi_mesh_get_softap(handle, ssid, channel, visibility, max_stations,
+ security, key);
+
+ return rv;
+}
+
EXPORT_API int wifi_mesh_enable_softap(wifi_mesh_h handle)
{
int rv = 0;
}
msg(" - wifi_mesh_set_softap() ret: [0x%X] [%s]", ret, wifi_mesh_error_to_string(ret));
+ msg("Get SoftAp Option");
+ char *g_ssid, *g_key;
+ int g_channel, g_max_stations, g_security;
+ bool g_visibility;
+ ret = wifi_mesh_get_softap(mesh, &g_ssid, &g_channel, &g_visibility,
+ &g_max_stations, &g_security, &g_key);
+ if (WIFI_MESH_ERROR_NONE != ret) {
+ msgr("Failed to get softap options: [%s(0x%X)]",
+ wifi_mesh_error_to_string(ret), ret);
+ return RET_FAILURE;
+ }
+
+ msg("SSID: %s", g_ssid);
+ msg("Channel: %d", g_channel);
+ msg("Visibility: %d", g_visibility);
+ msg("Max Stations: %d", g_max_stations);
+ msg("Security: %d", g_security);
+ msg("Key: %s", g_security ? g_key : "NULL");
+
+ g_free(g_ssid);
+ g_free(g_key);
+
return RET_SUCCESS;
}