MESH_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not Supported */
MESH_ERROR_OPERATION_FAILED = TIZEN_ERROR_MESH | 0x01, /**< Operation failed */
MESH_ERROR_OPERATION_ABORTED = TIZEN_ERROR_MESH | 0x02, /**< Operation is aborted */
- MESH_ERROR_ALREADY_INITIALIZED = TIZEN_ERROR_MESH | 0x09 /**< Already Iinitialized */
} mesh_error_e;
/**
* @since_tizen 4.0
*/
typedef enum {
- MESH_EVENT_ENABLED = 0x00, /**< This event is received after enabling mesh network */
- MESH_EVENT_SCAN_DONE = 0x01, /**< This event comes after scanning operation completed */
- MESH_EVENT_CONNECTION_STATE = 0x02, /**< This event takes place when mesh network connection state is changed */
- MESH_EVENT_STATION_JOINED = 0x03, /**< This event takes place when new station joined */
- MESH_EVENT_STATION_LEFT = 0x04, /**< This event takes place when existing station left */
+ MESH_MESH_ENABLED_EVENT = 0x00, /**< This event is received after enabling mesh network */
+ MESH_SCAN_DONE_EVENT = 0x01, /**< This event comes after scanning operation completed */
+ MESH_CONNECTION_STATE_EVENT = 0x02, /**< This event takes place when mesh network connection state is changed */
+ MESH_STATION_JOIN_EVENT = 0x03, /**< This event takes place when new station joined */
+ MESH_STATION_LEFT_EVENT = 0x04, /**< This event takes place when existing station left */
} mesh_event_e;
/**
} mesh_mesh_enabled_event_s;
/**
- * @brief The structure type for the MESH_EVENT_STATION_JOINED or MESH_EVENT_STATION_LEFT callback data.
+ * @brief The structure type for the MESH_STATION_JOIN_EVENT or MESH_STATION_LEFT_EVENT callback data.
* @details Result of join or left event of other station.
*
* @since_tizen 4.0
} mesh_other_station_event_s;
/**
- * @brief The structure type for the MESH_EVENT_CONNECTION_STATE callback data.
+ * @brief The structure type for the MESH_CONNECTION_STATE_EVENT callback data.
* @details The state of mesh network connection.
*
* @since_tizen 4.0
*
* @since_tizen 4.0
*
- * @param[in] network The mesh network information handle.
+ * @param[in] netowrk The mesh network information handle.
* @param[out] rssi The received signal strength indicator.
*
* @return 0 on success, otherwise a negative error value.
* @param[out] handle The mesh handle
* @return @c 0 on success, otherwise negative error value
* @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_ALREADY_INITIALIZED Already initialized
+ * @retval #WIFI_MANAGER_ERROR_ALREADY_INITIALIZED Already initialized
* @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MESH_ERROR_INVALID_OPERATION Invalid operation
* @retval #MESH_ERROR_OPERATION_FAILED Operation failed
/**
* @brief Deinitializes Mesh network.
* @since_tizen 4.0
- * @param[in] handle The mesh handle
+ * @param[in] mesh The mesh handle
* @return 0 on success, otherwise negative error value
- * @retval #MESH_ERROR_NONE Successful
- * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MESH_ERROR_INVALID_OPERATION Invalid operation
- * @retval #MESH_ERROR_OPERATION_FAILED Operation failed
- * @retval #MESH_ERROR_NOT_SUPPORTED Not supported
+ * @retval #WIFI_MANAGER_ERROR_NONE Successful
+ * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
*/
int mesh_deinitialize(mesh_h handle);
* @see #MESH_EVENT_ENABLED
* @see #MESH_EVENT_SCAN_DONE
* @see #MESH_EVENT_STATION_JOINED
- * @see #MESH_EVENT_STATION_LEFT
+ * @see #MESH_EVENT_STATION_DISJOINED
*
* @param[out] event_type The event identification
* @param[out] event parameter data pointer
/**
* @brief disable the mesh service.
- * @details All this function to stop mesh service
+ * @details all this function to stop mesh service
*
* @since_tizen 4.0
*
* @since_tizen 4.0
*
* @param[in] handle The mesh handle
- * @param[out] network Joined mesh network connection handle.
+ * @param[in] is_joined The state of mesh network connection.
*
*
* @return 0 on success, otherwise a negative error value.
if (expr) { \
LOGE("(%s)", #expr); \
return; \
- }\
- } while(0)
+ } \
+ } while (0)
#define RETV_IF(expr, val) \
do {\
LOGE("(%s)", #expr); \
return (val); \
} \
- } while(0)
+ } while (0)
#define RETM_IF(expr, fmt, arg...) \
do {\
if (expr) { \
LOGE(fmt, ##arg); \
return; \
- }\
- } while(0)
+ } \
+ } while (0)
#define RETVM_IF(expr, val, fmt, arg...) \
do {\
LOGE(fmt, ##arg); \
return (val); \
} \
- } while(0)
+ } while (0)
#define ERR_IF(expr) \
do { \
RETM_IF(NULL == ev.data.mesh_enable, "Failed to memory allocation !");
ev.data.mesh_enable->result = __convert_service_error_type(result);
- h->event_handler(MESH_EVENT_ENABLED, &ev);
+ h->event_handler(MESH_MESH_ENABLED_EVENT, &ev);
free(ev.data.mesh_enable);
} else if (0 == g_strcmp0(signal_name, "scan_done")) {
- h->event_handler(MESH_EVENT_SCAN_DONE, NULL);
+ h->event_handler(MESH_SCAN_DONE_EVENT, NULL);
} else if (0 == g_strcmp0(signal_name, "connection_state")) {
char *mesh_id = NULL;
char *bssid = NULL;
ev.data.connection_state->security = (mesh_security_type_e)security;
ev.data.connection_state->state = (mesh_connection_state_e)state;
- h->event_handler(MESH_EVENT_CONNECTION_STATE, &ev);
+ h->event_handler(MESH_CONNECTION_STATE_EVENT, &ev);
free(ev.data.connection_state);
} else if (0 == g_strcmp0(signal_name, "sta_joined")) {
char *bssid = NULL;
RETM_IF(NULL == ev.data.sta_info, "Failed to memory allocation !");
g_variant_get(parameters, "(s)", &bssid);
memcpy(ev.data.sta_info->bssid, bssid, MAX_BSSID_LEN);
- h->event_handler(MESH_EVENT_STATION_JOINED, &ev);
+ h->event_handler(MESH_STATION_JOIN_EVENT, &ev);
free(ev.data.sta_info);
} else if (0 == g_strcmp0(signal_name, "sta_left")) {
char *bssid = NULL;
RETM_IF(NULL == ev.data.sta_info, "Failed to memory allocation !");
g_variant_get(parameters, "(s)", &bssid);
memcpy(ev.data.sta_info->bssid, bssid, MAX_BSSID_LEN);
- h->event_handler(MESH_EVENT_STATION_LEFT, &ev);
+ h->event_handler(MESH_STATION_LEFT_EVENT, &ev);
free(ev.data.sta_info);
}
}
{
switch (e) {
/* CHECK: List all enum values here */
- CASE_TO_STR(MESH_EVENT_ENABLED)
- CASE_TO_STR(MESH_EVENT_SCAN_DONE)
- CASE_TO_STR(MESH_EVENT_CONNECTION_STATE)
- CASE_TO_STR(MESH_EVENT_STATION_JOINED)
- CASE_TO_STR(MESH_EVENT_STATION_LEFT)
+ CASE_TO_STR(MESH_MESH_ENABLED_EVENT)
+ CASE_TO_STR(MESH_SCAN_DONE_EVENT)
+ CASE_TO_STR(MESH_CONNECTION_STATE_EVENT)
+ CASE_TO_STR(MESH_STATION_JOIN_EVENT)
+ CASE_TO_STR(MESH_STATION_LEFT_EVENT)
default :
return "MESH_EVENT_UNKNOWN";
}
msgp("Event received [%s]", _mesh_event_to_string(event_type));
switch (event_type) {
- case MESH_EVENT_ENABLED: {
+ case MESH_MESH_ENABLED_EVENT: {
msgp(" Mesh Network Enabled Result = %d", event->data.mesh_enable->result);
} break;
- case MESH_EVENT_SCAN_DONE: {
+ case MESH_SCAN_DONE_EVENT: {
msgp(" Mesh Scan Done");
} break;
- case MESH_EVENT_CONNECTION_STATE:{
+ case MESH_CONNECTION_STATE_EVENT:{
msgp(" Connection state changed [%s]",
_mesh_connection_event_to_string(event->data.connection_state->state));
msgp(" From Mesh ID[%-10s] BSSID[%s] Channel[%d] Security[%4s]",
event->data.connection_state->channel,
(MESH_SECURITY_SAE == event->data.connection_state->security) ? "SAE" : "NONE");
} break;
- case MESH_EVENT_STATION_JOINED: {
+ case MESH_STATION_JOIN_EVENT: {
msgp(" New Station Joined = %s", event->data.sta_info->bssid);
} break;
- case MESH_EVENT_STATION_LEFT: {
+ case MESH_STATION_LEFT_EVENT: {
msgp(" A Station Left = %s", event->data.sta_info->bssid);
} break;
default:
#define ANSI_COLOR_WHITE "\e[1;37m"
-#define msg(fmt,args...) do { fprintf(stdout, fmt "\n", ##args); \
+#define msg(fmt, args...) do { fprintf(stdout, fmt "\n", ##args); \
fflush(stdout); } while (0)
-#define msgn(fmt,args...) do { fprintf(stdout, fmt, ##args); \
+#define msgn(fmt, args...) do { fprintf(stdout, fmt, ##args); \
fflush(stdout); } while (0)
/* Bold (red) */
-#define msgr(fmt,args...) do { fprintf(stdout, ANSI_COLOR_RED fmt \
+#define msgr(fmt, args...) do { fprintf(stdout, ANSI_COLOR_RED fmt \
ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0)
/* Bold (green) */
-#define msgb(fmt,args...) do { fprintf(stdout, ANSI_COLOR_LIGHTGREEN fmt \
+#define msgb(fmt, args...) do { fprintf(stdout, ANSI_COLOR_LIGHTGREEN fmt \
ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0)
/* Property message */
-#define msgp(fmt,args...) do { fprintf(stdout, ANSI_COLOR_LIGHTMAGENTA fmt \
+#define msgp(fmt, args...) do { fprintf(stdout, ANSI_COLOR_LIGHTMAGENTA fmt \
ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0)
-#define msgt(n,fmt,args...) do { fprintf(stdout, "\e[%dC" fmt "\n", \
+#define msgt(n, fmt, args...) do { fprintf(stdout, "\e[%dC" fmt "\n", \
3 + ((n) * 2), ##args); fflush(stdout); } while (0)
-#define pmsg(fmt,args...) do { \
+#define pmsg(fmt, args...) do { \
if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \
fprintf(stdout, fmt "\n", ##args); fflush(stdout); } while (0)
-#define pmsgb(fmt,args...) do { \
+#define pmsgb(fmt, args...) do { \
if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \
fprintf(stdout, ANSI_COLOR_LIGHTGREEN fmt \
ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0)
-#define pmsgt(n,fmt,args...) do { \
+#define pmsgt(n, fmt, args...) do { \
if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \
fprintf(stdout, "\e[%dC" fmt "\n", \
3 + ((n) * 2), ##args); fflush(stdout); } while (0)
#define HR_SINGLE2 " ---------------------------------------" \
"------------------------ "
-#define MAX_WIDTH strlen (HR_SINGLE)
+#define MAX_WIDTH strlen(HR_SINGLE)
#define MAX_TITLE ((MAX_WIDTH) - 10)
#define POS_MORE ((MAX_WIDTH) - 3)
#define RET_SUCCESS 0
};
MManager* menu_manager_new(struct menu_data items[], GMainLoop *mainloop);
-int menu_manager_run(MManager *mm);
-int menu_manager_set_user_data(MManager *mm, void *user_data);
-void* menu_manager_ref_user_data(MManager *mm);
+int menu_manager_run(MManager *mm);
+int menu_manager_set_user_data(MManager *mm, void *user_data);
+void* menu_manager_ref_user_data(MManager *mm);
gboolean on_menu_manager_keyboard(GIOChannel *src, GIOCondition con,
gpointer data);
-pid_t get_tid ();
-void hide_pid ();
-void show_pid ();
-int is_pid_show ();
-void menu_print_dump(int data_len, void *data);
+pid_t get_tid();
+void hide_pid();
+void show_pid();
+int is_pid_show();
+void menu_print_dump(int data_len, void *data);
__END_DECLS