*
* @see wifi_mesh_set_softap()
* @see wifi_mesh_enable_softap()
+ * @see wifi_mesh_is_softap_started()
*
*/
int wifi_mesh_disable_softap(wifi_mesh_h handle);
+/**
+ * @brief Check softap status
+ * @details This function checks softap status
+ *
+ * @since_tizen 4.0
+ *
+ * @param[in] handle The Wi-Fi mesh handle
+ * @param[out] status Status of SoftAP
+ *
+ *
+ * @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()
+ *
+ */
+int wifi_mesh_is_softap_started(wifi_mesh_h handle, bool *status);
+
/**
* @brief Creates new Wi-Fi mesh network configuration
* @details This function creates new mesh network.
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 _wifi_mesh_is_softap_started(wifi_mesh_h handle, bool *result);
int _mesh_create_network(wifi_mesh_h handle, wifi_mesh_network_h _network);
int _mesh_connect_network(wifi_mesh_h handle, wifi_mesh_network_h _network);
int _mesh_disconnect_network(wifi_mesh_h handle, wifi_mesh_network_h _network);
return result;
}
+int _wifi_mesh_is_softap_started(wifi_mesh_h handle, bool *result)
+{
+ GVariant *variant = NULL;
+ 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,
+ "is_softap_enabled", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL,
+ &error);
+ if (variant) {
+ g_variant_get(variant, "(b)", result);
+ LOGD("check_softap_status status %d", *result);
+ } 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 WIFI_MESH_ERROR_NONE;
+}
+
int _mesh_create_network(wifi_mesh_h handle, wifi_mesh_network_h _network)
{
GVariant *variant = NULL;
return rv;
}
+EXPORT_API int wifi_mesh_is_softap_started(wifi_mesh_h handle, bool *status)
+{
+ int rv = 0;
+ CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+ if (NULL == handle || NULL == status) {
+ /* LCOV_EXCL_START */
+ LOGE("Invalid parameter");
+ return WIFI_MESH_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+
+ rv = _wifi_mesh_is_softap_started(handle, status);
+ return rv;
+}
+
EXPORT_API int wifi_mesh_create_network(wifi_mesh_h handle, wifi_mesh_network_h network)
{
int rv = 0;
static int run_disable_softap(MManager *mm, struct menu_data *menu)
{
int ret;
+ bool status;
+ msg("Check SoftAp status");
+
+ ret = wifi_mesh_is_softap_started(mesh, &status);
+ if (WIFI_MESH_ERROR_NONE != ret) {
+ msgr("Failed to check soft ap status: [%s(0x%X)]",
+ wifi_mesh_error_to_string(ret), ret);
+ return RET_FAILURE;
+ }
+
+ if (status == false) {
+ msg("SoftAP is already disabled");
+ return RET_SUCCESS;
+ }
+
msg("Disable SoftAp");
ret = wifi_mesh_disable_softap(mesh);