Project

General

Profile

Revision 408

added asleep to wl_do loop

View differences:

colonet_wireless.cpp
93 93
  return 0;
94 94
}
95 95

  
96
void colonet_wl_send(short client_source, short dest, ColonetMessageType msg_type, unsigned char msg_code,
96
int colonet_wl_send(short client_source, short dest, ColonetMessageType msg_type, unsigned char msg_code,
97 97
                     unsigned char* args) {
98 98
  printf("colonet_wl_send: client_source:%d, dest:%d, msg_code:%d\n", client_source, dest, msg_code);
99 99

  
......
107 107

  
108 108
  if (dest == GLOBAL_DEST) {
109 109
    printf("sending to global dest\n");
110

  
111
    wl_send_global_packet(COLONET_PACKET_GROUP_ID, (char)msg_type, (char*)(&pkt), sizeof(ColonetRobotServerPacket), 0);
110
    if (wl_send_global_packet(COLONET_PACKET_GROUP_ID, (char)msg_type, (char*)(&pkt),
111
                              sizeof(ColonetRobotServerPacket), 0) != 0) {
112
      return -1;
113
    }
112 114
  } else {
113 115
    printf("sending to specific robot.\n");
114 116
    wl_send_robot_to_robot_global_packet(COLONET_PACKET_GROUP_ID, (char)msg_type, (char*)(&pkt),
......
208 210

  
209 211
  while (1) {
210 212
    wl_do();
213
    usleep(50000);
211 214
  }
212 215

  
213 216
  wl_terminate();

Also available in: Unified diff