} communication_state_e;
typedef struct _commu_data_s {
- int x;
- int y;
+ unsigned long long int seq_num;
+ int cmd;
+ int servo;
+ int speed;
+ unsigned long long int time;
} commu_data_s;
typedef struct _communication_info {
GError *error = NULL;
GIOCondition condi;
commu_data_s send_data = *(commu_data_s *)user_data;
- _D("Send data.x[%d], data.y[%d]", send_data.x, send_data.y);
+ _D("Send Servo[%d], Speed[%d]", send_data.servo, send_data.speed);
if (udp_info.commu_info->socket == NULL ||
udp_info.commu_info->opponent == NULL) {
for (i = 0; i < COMMUNICATION_MAX; i++)
{
if (communications[i])
- communications[i]->communication_start("192.168.0.61", 57984);
+ communications[i]->communication_start("192.168.1.168", 57984);
}
}
{
int i = 0;
+ commu_data_s *commu_data = (commu_data_s *)user_data;
+ if (commu_data == NULL) {
+ _E("Commu data is NULL");
+ return;
+ }
+
+ commu_data->cmd = 2;
+
for (i = 0; i < COMMUNICATION_MAX; i++)
{
if (communications[i])
- communications[i]->communication_send_data(user_data);
+ communications[i]->communication_send_data((void *)commu_data);
}
}
}
free(sensor_info);
- sensor_info == NULL;
+ sensor_info = NULL;
}
void resource_start_sensing(void)
commu_data_s temp = { NULL, NULL };
- temp.x = event->values[0] * 100;
- temp.y = event->values[1] * 100;
+ temp.servo = event->values[0] * -100;
+ temp.speed = event->values[1] * -100;
view_update_view_with_data((void *)&temp);
communication_center_send_data((void *)&temp);
_E("Failed to stop sensor listener event");
return;
}
+
+ commu_data_s temp = { NULL, NULL };
+
+ temp.servo = 0;
+ temp.speed = 0;
+
+ view_update_view_with_data((void *)&temp);
+ communication_center_send_data((void *)&temp);
}
char x_value[1024];
char y_value[1024];
- snprintf(x_value, 1024, "%d", data.x);
- snprintf(y_value, 1024, "%d", data.y);
+ snprintf(x_value, 1024, "%d", data.servo);
+ snprintf(y_value, 1024, "%d", data.speed);
elm_object_part_text_set(view_info.layout, "x_value", x_value);
elm_object_part_text_set(view_info.layout, "y_value", y_value);