From: saerome kim Date: Tue, 22 Aug 2017 10:08:27 +0000 (+0900) Subject: Added new CAPI to get Gate Announcement value X-Git-Tag: submit/tizen/20170828.225740~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4716d46a9e42bb6304f003f383d1b35cfbece1f7;p=platform%2Fcore%2Fapi%2Fwifi-mesh.git Added new CAPI to get Gate Announcement value Change-Id: I696ab6c32ca84f00e24e359305bb5cf7ecd38f1e Signed-off-by: Saurav Babu --- diff --git a/include/wifi-mesh-internal.h b/include/wifi-mesh-internal.h index 48e70c8..b083a35 100644 --- a/include/wifi-mesh-internal.h +++ b/include/wifi-mesh-internal.h @@ -2422,7 +2422,7 @@ int wifi_mesh_destroy_meshconf_info(wifi_mesh_meshconf_info_h meshconf); * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_retry_timeout(wifi_mesh_meshconf_info_h meshconf, @@ -2442,7 +2442,7 @@ int wifi_mesh_get_meshconf_retry_timeout(wifi_mesh_meshconf_info_h meshconf, * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ @@ -2464,7 +2464,7 @@ int wifi_mesh_get_meshconf_hwmp_max_preq_retries( * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_confirm_timeout(wifi_mesh_meshconf_info_h meshconf, @@ -2484,7 +2484,7 @@ int wifi_mesh_get_meshconf_confirm_timeout(wifi_mesh_meshconf_info_h meshconf, * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_path_refresh_time(wifi_mesh_meshconf_info_h meshconf, @@ -2504,7 +2504,7 @@ int wifi_mesh_get_meshconf_path_refresh_time(wifi_mesh_meshconf_info_h meshconf, * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_holding_timeout(wifi_mesh_meshconf_info_h meshconf, @@ -2524,7 +2524,7 @@ int wifi_mesh_get_meshconf_holding_timeout(wifi_mesh_meshconf_info_h meshconf, * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_min_disc_timeout(wifi_mesh_meshconf_info_h meshconf, @@ -2544,7 +2544,7 @@ int wifi_mesh_get_meshconf_min_disc_timeout(wifi_mesh_meshconf_info_h meshconf, * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_max_peer_links(wifi_mesh_meshconf_info_h meshconf, @@ -2564,7 +2564,7 @@ int wifi_mesh_get_meshconf_max_peer_links(wifi_mesh_meshconf_info_h meshconf, * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_hwmp_preq_min_interval( @@ -2585,7 +2585,7 @@ int wifi_mesh_get_meshconf_hwmp_preq_min_interval( * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_ttl( @@ -2605,7 +2605,7 @@ int wifi_mesh_get_meshconf_ttl( * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_hwmp_active_path_timeout( @@ -2626,7 +2626,7 @@ int wifi_mesh_get_meshconf_hwmp_active_path_timeout( * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_element_ttl(wifi_mesh_meshconf_info_h meshconf, @@ -2646,13 +2646,34 @@ int wifi_mesh_get_meshconf_element_ttl(wifi_mesh_meshconf_info_h meshconf, * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter * * @see wifi_mesh_get_meshconf_info() - * @see mesh_meshconf_cb() + * @see wifi_mesh_destroy_meshconf_info() * */ int wifi_mesh_get_meshconf_hwmp_rann_interval( wifi_mesh_meshconf_info_h meshconf, gushort *hwmp_rann_interval); +/* + * @brief Gets the Gate Announcement value. + * + * @since_tizen 4.0 + * + * @param[in] meshconf The Wi-Fi mesh conf handle + * @param[out] gate_announcements Gate Announcement + * + * + * @return 0 on success, otherwise a negative error value. + * @retval #WIFI_MESH_ERROR_NONE Successful + * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see wifi_mesh_get_meshconf_info() + * @see wifi_mesh_destroy_meshconf_info() + * + */ +int wifi_mesh_get_meshconf_gate_announcements( + wifi_mesh_meshconf_info_h meshconf, + guchar *gate_announcements); + #ifdef __cplusplus } #endif diff --git a/include/wifi-mesh_private.h b/include/wifi-mesh_private.h index 15ebee5..049ebfc 100644 --- a/include/wifi-mesh_private.h +++ b/include/wifi-mesh_private.h @@ -146,6 +146,7 @@ struct mesh_meshconf_dump_s { guint hwmp_active_path_timeout; /**< HWMP Active Path Timeout */ guchar element_ttl; /**< Element TTL */ gushort hwmp_rann_interval; /**< HWMP RANN Interval */ + guchar gate_announcements; /**< Gate Announcements */ }; #define NOTUSED(var) (var = var) diff --git a/src/wifi-mesh-dbus.c b/src/wifi-mesh-dbus.c index 22ecb02..fcf74d9 100644 --- a/src/wifi-mesh-dbus.c +++ b/src/wifi-mesh-dbus.c @@ -1851,6 +1851,9 @@ int _wifi_mesh_get_meshconf_info(wifi_mesh_h handle, } else if (strcasecmp(key, "HWMP_RANN_INTERVAL") == 0) { meshparam->hwmp_rann_interval = g_variant_get_uint16(val); LOGE("HWMP_RANN_INTERVAL=%u", meshparam->hwmp_rann_interval); + } else if (strcasecmp(key, "GATE_ANNOUNCEMENTS") == 0) { + meshparam->gate_announcements = g_variant_get_byte(val); + LOGE("GATE_ANNOUNCEMENTS=%u", meshparam->gate_announcements); } } /* LCOV_EXCL_STOP */ diff --git a/src/wifi-mesh-internal.c b/src/wifi-mesh-internal.c index e9319c5..be8cf24 100644 --- a/src/wifi-mesh-internal.c +++ b/src/wifi-mesh-internal.c @@ -1273,3 +1273,23 @@ EXPORT_API int wifi_mesh_get_meshconf_hwmp_rann_interval( return rv; } + +EXPORT_API int wifi_mesh_get_meshconf_gate_announcements( + wifi_mesh_meshconf_info_h meshconf, guchar *gate_announcements) +{ + int rv = WIFI_MESH_ERROR_NONE; + struct mesh_meshconf_dump_s *pdump = meshconf; + + CHECK_FEATURE_SUPPORTED(MESH_FEATURE); + + if (NULL == meshconf || NULL == gate_announcements) { + /* LCOV_EXCL_START */ + LOGE("Invalid parameter"); + return WIFI_MESH_ERROR_INVALID_PARAMETER; + /* LCOV_EXCL_STOP */ + } + + *gate_announcements = pdump->gate_announcements; + + return rv; +} diff --git a/test/wifi-mesh-network.c b/test/wifi-mesh-network.c index 6d1c33d..e5945a9 100644 --- a/test/wifi-mesh-network.c +++ b/test/wifi-mesh-network.c @@ -819,6 +819,7 @@ static int run_get_meshconf_information(MManager *mm, struct menu_data *menu) guint hwmp_active_path_timeout; /**< HWMP Active Path Timeout */ guchar element_ttl; /**< Element TTL */ gushort hwmp_rann_interval; /**< HWMP RANN Interval */ + guchar gate_announcements; /**< Gate Announcements */ msg("Get Mesh Conf Information"); g_idx = 1; @@ -873,6 +874,10 @@ static int run_get_meshconf_information(MManager *mm, struct menu_data *menu) &hwmp_rann_interval); if (WIFI_MESH_ERROR_NONE == ret) msg("hwmp_rann_interval = %u", hwmp_rann_interval); + ret = wifi_mesh_get_meshconf_gate_announcements(meshconf, + &gate_announcements); + if (WIFI_MESH_ERROR_NONE == ret) + msg("gate_announcements = %u", gate_announcements); ret = wifi_mesh_destroy_meshconf_info(meshconf); if (WIFI_MESH_ERROR_NONE != ret) {