} mesh_event_e;
/**
- * @brief The HWMP type for mesh_hwmp_root_mode_e
- *
- * @since_tizen 4.0
- */
-typedef enum {
- MESH_HWMP_ROOT_REACTIVE_MODE = 0, /**< Disable Proative Mode */
- MESH_HWMP_ROOT_SIMPLE_PROACTIVE_MODE = 2, /**< Enable the Proactive PREQ with no PREP */
- MESH_HWMP_ROOT_FORCED_PROACTIVE_MODE = 3, /**< Enable the Proactive PREQ with PREP.
- Once you do this, all the nodes in your mesh will proactively create paths to your gate.
- Mesh nodes will send to gate(s) all traffic to those destinations that could not be resolved in the mesh. */
- MESH_HWMP_ROOT_PROACTIVE_WITH_RANN_MODE = 4, /**< If we use HWMP_ROOTMODE as 4, every 5 sec,
- our DUT sends action_frame with root announce. */
-} mesh_hwmp_root_mode_e;
-
-/**
* @brief The structure type for the MESH_EVENT_ENABLED callback data.
* @details The result of creating or joining mesh network.
*
* @param[in] bssid The Basic Service Set ID
* @param[in] channel The operating channel number
* @param[in] rssi The Received Signal Strength Indicator
- * @param[in] data_rate The maximum data rate
* @param[in] security The security type for network
* @param[in] passphrase The passphrase for network connection
*
*
*/
int mesh_network_new_with(mesh_network_h* network, const char *meshid,
- const char *bssid, int channel, int rssi, int data_rate,
- mesh_security_type_e security, const char *passphrase);
+ const char *bssid, int channel, int rssi, mesh_security_type_e security,
+ const char *passphrase);
/**
* @brief Destroys network handle for network information.
int mesh_network_set_rssi(mesh_network_h network, int rssi);
/**
- * @brief Gets the maximum data rate.
- * @details This function is to get the maximum data rate
- *
- * @since_tizen 4.0
- *
- * @param[in] network The mesh network information handle.
- * @param[out] data_rate The maximum data rate.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see mesh_network_set_data_rate()
- *
- */
-int mesh_network_get_data_rate(mesh_network_h network, int *data_rate);
-
-/**
- * @brief Sets the maximum data rate.
- * @details This function is to set the maximum data rate
- *
- * @since_tizen 4.0
- *
- * @param[in] network The mesh network information handle.
- * @param[in] data_rate The maximum data rate.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see mesh_network_get_data_rate()
- *
- */
-int mesh_network_set_data_rate(mesh_network_h network, int data_rate);
-
-/**
* @brief Gets the security type.
* @details This function is to get the security type.
*
int mesh_specific_scan(mesh_h handle, const char* ssid, int channel);
/**
- * @brief Cancel scanning for the mesh network.
- * @details Stop scanning process of mesh network.
- *
- * @since_tizen 4.0
- *
- * @param[in] handle The mesh handle
- *
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MESH_ERROR_IO_ERROR Unexpected d-bus error
- *
- * @see mesh_scan()
- * @see mesh_specific_scan()
- * @see mesh_scan()
- *
- */
-int mesh_cancel_scan(mesh_h handle);
-
-/**
* @brief Called after mesh_foreach_found_mesh_network()
* @details This function can receive scan results from mesh network.
*
int mesh_get_joined_network(mesh_h handle, mesh_network_h* network);
/**
- * @brief Sets gate options
- * @details This function sets mesh gate options.
- *
- * @since_tizen 4.0
- *
- * @param[in] handle The mesh handle
- * @param[in] gate_announce Enable / Disable Gate Announce to peers
- * @param[in] hwmp_root_mode HWMP (Hybrid Wireless Mesh Protocol) Root Mode \n
- * #MESH_HWMP_ROOT_REACTIVE_MODE \n
- * #MESH_HWMP_ROOT_SIMPLE_PROACTIVE_MODE \n
- * #MESH_HWMP_ROOT_FORCED_PROACTIVE_MODE \n
- * #MESH_HWMP_ROOT_PROACTIVE_WITH_RANN_MODE \n
- * @param[in] stp Enable / Disable Gate Announce to peers
- *
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MESH_ERROR_IO_ERROR Unexpected d-bus error
- *
- * @see mesh_unset_gate()
- *
- */
-int mesh_set_gate(mesh_h handle, int gate_announce, int hwmp_root_mode, bool stp);
-
-/**
- * @brief Unsets gate options
- * @details This function unsets mesh gate options.
- *
- * @since_tizen 4.0
- *
- * @param[in] handle The mesh handle
- *
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MESH_ERROR_IO_ERROR Unexpected d-bus error
- *
- * @see mesh_set_gate()
- *
- */
-int mesh_unset_gate(mesh_h handle);
-
-/**
* @brief Sets softap options
* @details This function sets softap options.
*
*/
int mesh_forget_mesh_network(mesh_h handle, mesh_network_h network);
-/**
- * @brief Called after mesh_get_stations_info()
- * @details This function can receive joined station information from mesh network.
- *
- * @since_tizen 4.0
- *
- * @param[out] station mesh station information handle
- * @param[out] user_data user data pointer
- *
- * @pre The callback must be registered with mesh_foreach_found_mesh_network()
- *
- * @see mesh_foreach_found_mesh_network()
- */
-typedef void (*mesh_found_station_cb)(mesh_station_info_h station, void* user_data);
-
-/**
- * @brief Get information of all connected stations.
- * @details Get information about all stations present in the currently connected mesh network.
- *
- * @since_tizen 4.0
- *
- * @param[in] handle The mesh handle
- * @param[in] cb The callback function to receive station information
- * @param[in] user_data User data
- *
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MESH_ERROR_IO_ERROR Unexpected d-bus error
- *
- * @see mesh_get_path_info()
- *
- */
-int mesh_get_stations_info(mesh_h handle, mesh_found_station_cb cb, void *user_data);
-
-/**
- * @brief Called after mesh_get_stations_info()
- * @details This function can receive joined station information from mesh network.
- *
- * @since_tizen 4.0
- *
- * @param[out] path mesh path information handle
- * @param[out] user_data user data pointer
- *
- * @pre The callback must be registered with mesh_foreach_found_mesh_network()
- *
- * @see mesh_foreach_found_mesh_network()
- */
-typedef void (*mesh_found_mpath_cb)(mesh_mpath_info_h path, void* user_data);
-
-/**
- * @brief Get information of all mesh paths.
- * @details Get information about all mesh paths present in the currently connected mesh network.
- *
- * @since_tizen 4.0
- *
- * @param[in] handle The mesh handle
- * @param[in] cb The callback function to receive mesh path information
- * @param[in] user_data User data
- *
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MESH_ERROR_IO_ERROR Unexpected d-bus error
- *
- * @see mesh_get_stations_info()
- *
- */
-int mesh_get_mpath_info(mesh_h handle, mesh_found_mpath_cb cb, void *user_data);
/**
- * @brief Sets network device interface name.
- * @details This function provides the ability to manually select interfaces for advanced users.
- *
- * @since_tizen 4.0
- *
- * @param[in] handle The mesh handle
- * @param[in] mesh An interface name for mesh network
- * @param[in] gate An interface name for external network
- * @param[in] softap An interface name for internal softap
- *
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MESH_ERROR_IO_ERROR Unexpected d-bus error
- *
- */
-int mesh_set_interfaces(mesh_h handle,
- const char *mesh, const char* gate, const char *softap);
-/**
* @}
*/
mesh_network_h net = NULL;
char *meshid = NULL;
char *bssid = NULL;
+ int rssi;
+ int data_rate;
mesh_security_type_e security;
int channel;
mesh_network_get_meshid(net, &meshid);
mesh_network_get_bssid(net, &bssid);
mesh_network_get_channel(net, &channel);
+ mesh_network_get_rssi(net, &rssi);
+ mesh_network_get_data_rate(net, &data_rate);
mesh_network_get_security(net, &security);
- msgb(" [%02d] Mesh ID[%-10s] BSSID[%s] Channel[%d] Security[%4s]",
- g_scan_net_idx, meshid, bssid, channel,
+ msgb(" [%02d] Mesh ID[%-10s] BSSID[%s] Channel[%d] RSSI[%ddBm] Date Rate[%dMbps] Security[%4s]",
+ g_scan_net_idx, meshid, bssid, channel, rssi == 0 ? 0 : rssi-120, data_rate,
(MESH_SECURITY_SAE == security) ? "SAE" : "NONE");
g_scan_net_idx++;
security = ((1 == ret) ? MESH_SECURITY_SAE : MESH_SECURITY_NONE);
}
- mesh_network_new_with(&net, meshid, NULL, _mesh_channel, 0, 0,
+ mesh_network_new_with(&net, meshid, NULL, _mesh_channel, 0,
security, security == MESH_SECURITY_SAE ? mesh_passphrase : NULL);
ret = mesh_create_mesh_network(mesh, net);
mesh_network_destroy(net);