MESH_STATION_LEFT_EVENT = 0x04, /**< This event takes place when existing station left */
} mesh_event_e;
+
+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_MESH_ENABLED_EVENT callback data.
* @details The result of creating or joining mesh network.
* @since_tizen 4.0
*
* @param[in] handle The mesh handle
- * @param[in] stp Eanble / Disable STP (Spanning Tree Protocol)
* @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.
* @see mesh_unset_gate()
*
*/
-int mesh_set_gate(mesh_h handle, bool stp, bool gate_announce);
+int mesh_set_gate(mesh_h handle, int gate_announce, int hwmp_root_mode, bool stp);
/**
* @brief Unsets gate options
int _mesh_disable_mesh(mesh_h handle);
int _mesh_is_joined(mesh_h handle, bool* is_joined);
int _mesh_get_joined_mesh_network(mesh_h handle, mesh_network_h* _network);
-int _mesh_set_gate(mesh_h handle, bool stp, bool gate_announce);
+int _mesh_set_gate(mesh_h handle, bool gate_announce, int hwmp_root_mode, bool stp);
int _mesh_unset_gate(mesh_h handle);
int _mesh_set_softap(mesh_h handle, const char* ssid, const char* key, const char* mode,
int channel, int visibility, int max_stations, int security);
return rv;
}
-EXPORT_API int mesh_set_gate(mesh_h handle, bool stp, bool gate_announce)
+EXPORT_API int mesh_set_gate(mesh_h handle, int gate_announce, int hwmp_root_mode, bool stp)
{
int rv = 0;
+ int _stp = stp ? 1 : 0;
CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
RETV_IF(NULL == handle, MESH_ERROR_INVALID_PARAMETER);
- rv = _mesh_set_gate(handle, stp, gate_announce);
+ rv = _mesh_set_gate(handle, gate_announce, hwmp_root_mode, _stp);
return rv;
}
return result;
}
-int _mesh_set_gate(mesh_h handle, bool stp, bool gate_announce)
+int _mesh_set_gate(mesh_h handle, bool gate_announce, int hwmp_root_mode, bool stp)
{
GVariant *variant = NULL;
int result = MESH_ERROR_NONE;
RETV_IF(NULL == _gproxy_mesh_service, MESH_ERROR_IO_ERROR);
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "set_gate",
- g_variant_new("(bb)", stp, gate_announce),
+ g_variant_new("(bqq)", gate_announce, hwmp_root_mode, stp),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL, &error);
extern mesh_h mesh;
-static char stp[MENU_DATA_SIZE + 1] = "1";
static char gate_announce[MENU_DATA_SIZE + 1] = "1";
+static char hwmp_root_mode[MENU_DATA_SIZE + 1] = "4";
+static char stp[MENU_DATA_SIZE + 1] = "1";
static char ssid[MENU_DATA_SIZE + 1] = "meshnet";
static char passphrase[MENU_DATA_SIZE + 1] = "11223344";
static int run_set_gate(MManager *mm, struct menu_data *menu)
{
int ret;
- bool _stp = true;
bool _gate_announce = true;
+ int _hwmp_root_mode = 4;
+ bool _stp = true;
msg("Set Gate Option");
- if (strlen(stp))
- _stp = (unsigned short)strtol(stp, NULL, 16);
if (strlen(gate_announce))
- _gate_announce = (unsigned short)strtol(gate_announce, NULL, 10);
+ _gate_announce = (unsigned short)strtol(gate_announce, NULL, 16);
+ if (strlen(hwmp_root_mode))
+ _hwmp_root_mode = (unsigned short)strtol(hwmp_root_mode, NULL, 10);
+ if (strlen(stp))
+ _stp = (unsigned short)strtol(stp, NULL, 10);
- ret = mesh_set_gate(mesh, _stp, _gate_announce);
+ ret = mesh_set_gate(mesh, _gate_announce, _hwmp_root_mode, _stp);
if (MESH_ERROR_NONE != ret) {
msgr("Failed to set gate options: [%s(0x%X)]",
mesh_error_to_string(ret), ret);
};
static struct menu_data menu_gate_option[] = {
- { "1", "STP", NULL, NULL, stp },
- { "2", "Gate Announcement", NULL, NULL, gate_announce },
- { "3", "Run", NULL, run_set_gate, NULL },
+ { "1", "Gate Announcement", NULL, NULL, gate_announce },
+ { "2", "HWMP Root Mode", NULL, NULL, hwmp_root_mode },
+ { "3", "STP", NULL, NULL, stp },
+ { "4", "Run", NULL, run_set_gate, NULL },
{ NULL, NULL, },
};