GList *found_group_list;
GList *found_device_list;
-GList *invited_device_list;
+GList *found_invited_device_list;
GList *found_channel_list;
static char groupid[MENU_DATA_SIZE + 1] = "mygroup";
/* Get a first item */
i = 0;
- iter = g_list_first(invited_device_list);
+ iter = g_list_first(found_invited_device_list);
while (NULL != iter) {
device = iter->data;
if (!device) {
char *address = NULL;
mdg_device_h device = NULL;
channel_t *channel = NULL;
- if (found_device_list) {
- device = g_list_nth_data(found_device_list, devidx - 1);
+ if (found_invited_device_list) {
+ device = g_list_nth_data(found_invited_device_list, devidx - 1);
if (NULL == device) {
msgr("Find local device first");
return RET_FAILURE;
{
int devidx = 0;
int chaidx = 0;
- int count = g_list_length(found_device_list);
+ int count = g_list_length(found_invited_device_list);
if (0 >= count) {
msgr("No Device");
if (addr)
free(addr);
- invited_device_list = g_list_append(invited_device_list, device);
+ found_invited_device_list = g_list_append(found_invited_device_list, device);
return TRUE;
}
msg(" - mdg_device_find_invited_device() ret: [0x%X] [%s]",
ret, mdg_error_to_string(ret));
- if (invited_device_list) {
- g_list_free_full(invited_device_list, _destroy_mdg_device_info);
- invited_device_list = NULL;
+ if (found_invited_device_list) {
+ g_list_free_full(found_invited_device_list, _destroy_mdg_device_info);
+ found_invited_device_list = NULL;
}
return RET_SUCCESS;
msg("Request create group");
- dev_count = g_list_length(found_device_list);
+ dev_count = g_list_length(found_invited_device_list);
if (0 >= dev_count) {
msgr("No Device");
}
}
- if (found_device_list) {
- device = g_list_nth_data(found_device_list, dev_idx - 1);
+ if (found_invited_device_list) {
+ device = g_list_nth_data(found_invited_device_list, dev_idx - 1);
if (NULL == device) {
msgr("Failed to g_hash_table_find");
return RET_FAILURE;
mdg_device_h device = NULL;
mdg_group_h group = NULL;
- dev_count = g_list_length(found_device_list);
+ dev_count = g_list_length(found_invited_device_list);
grp_count = g_list_length(found_group_list);
if (0 >= dev_count || 0 >= grp_count) {
}
}
- if (found_device_list) {
- device = g_list_nth_data(found_device_list, dev_idx - 1);
+ if (found_invited_device_list) {
+ device = g_list_nth_data(found_invited_device_list, dev_idx - 1);
if (NULL == device) {
msgr("Failed to g_hash_table_find");
return RET_FAILURE;
mdg_device_h device = NULL;
mdg_group_h group = NULL;
- dev_count = g_list_length(found_device_list);
+ dev_count = g_list_length(found_invited_device_list);
grp_count = g_list_length(found_group_list);
if (0 >= dev_count || 0 >= grp_count) {
}
}
- if (found_device_list) {
- device = g_list_nth_data(found_device_list, dev_idx - 1);
+ if (found_invited_device_list) {
+ device = g_list_nth_data(found_invited_device_list, dev_idx - 1);
if (NULL == device) {
msgr("Failed to g_hash_table_find");
return RET_FAILURE;
int dev_count = 0;
mdg_device_h device = NULL;
- dev_count = g_list_length(found_device_list);
+ dev_count = g_list_length(found_invited_device_list);
if (0 >= dev_count) {
msgr("No Device");
}
}
- if (found_device_list) {
- device = g_list_nth_data(found_device_list, dev_idx - 1);
+ if (found_invited_device_list) {
+ device = g_list_nth_data(found_invited_device_list, dev_idx - 1);
if (NULL == device) {
msgr("Failed to g_hash_table_find");
return RET_FAILURE;
return RET_SUCCESS;
}
-void __channel_cb(int result, mdg_device_h device, char *channel_id,
+void __channel_cb(int result, char *device_id, char *channel_id,
unsigned char *arg, int len, void *user_data)
{
- msg("[%s] channel callback is called by remote send message", channel_id);
+ msg("[%s] channel callback is called by [%s]'s send message", channel_id, device_id);
+ msg("arg : %s, len : %d", arg, len);
msg("result is %d", result);
}
};
static struct menu_data menu_send_data[] = {
- { "0", "Show My Owned Device(s)", NULL, run_invited_devices_show, NULL },
+ { "0", "Show Found Invited Device(s)", NULL, run_invited_devices_show, NULL },
{ "1", "Show Channel List", NULL, run_channels_show, NULL },
{ "2", "Message", NULL, NULL, message },
{ "3", "Device Index", NULL, NULL, device_idx },
};
static struct menu_data menu_request_create_group[] = {
- { "0", "Show Found Device(s)", NULL, run_devices_show, NULL },
+ { "0", "Show Found Invited Device(s)", NULL, run_invited_devices_show, NULL },
{ "1", "Device Index", NULL, NULL, device_idx },
{ "2", "Request Group Name", NULL, NULL, request_groupid },
{ "3", "Run", NULL, run_request_create_group, NULL },
static struct menu_data menu_request_invite[] = {
{ "0", "Show Found Group(s)", NULL, run_group_show, NULL },
- { "1", "Show Found Device(s)", NULL, run_devices_show, NULL },
+ { "1", "Show Found Invited Device(s)", NULL, run_invited_devices_show, NULL },
{ "2", "Group Index", NULL, NULL, group_idx },
{ "3", "Device Index", NULL, NULL, device_idx },
{ "4", "PIN", NULL, NULL, pin },
static struct menu_data menu_request_eject[] = {
{ "0", "Show Found Group(s)", NULL, run_group_show, NULL },
- { "1", "Show Found Device(s)", NULL, run_devices_show, NULL },
+ { "1", "Show Found Invited Device(s)", NULL, run_invited_devices_show, NULL },
{ "2", "Group Index", NULL, NULL, group_idx },
{ "3", "Device Index", NULL, NULL, device_idx },
{ "4", "Run", NULL, run_request_eject, NULL },
};
static struct menu_data menu_request_channel_list[] = {
- { "0", "Show Found Device(s)", NULL, run_devices_show, NULL },
+ { "0", "Show Found Invited Device(s)", NULL, run_invited_devices_show, NULL },
{ "1", "Device Index", NULL, NULL, device_idx },
{ "2", "Run", NULL, run_request_channel_list, NULL },
{ NULL, NULL, },