Project

General

Profile

Revision 334

Added by Greg Tress over 16 years ago

Added battery request functionaltiy. It works, but is kind of a hack. I will be cleaning it up so the format is the same as other requests.

View differences:

colonet_dragonfly.c
167 167

  
168 168
    // Battery
169 169
    case BATTERY:
170
      usb_puts("Got battery request.");
171
      wl_send_robot_to_robot_global_packet(colonet_pgh.groupCode, BATTERY,
172
        "34", 2, 0xA, 0);
173
      usb_puts("Sent.\n");
170
      usb_puts("Got battery request.\n");
171
      int xbeeDongleID = 0xA;  // too bad this is hard-coded.
172
      char data[20];
173
      data[0] = 0;  // client ID specified in bytes 0-3
174
      data[1] = 0;
175
      data[2] = 0;
176
      data[3] = 0;
177
      data[4] = 0;  // ???
178
      data[5] = RESPONSE_TO_CLIENT_REQUEST;
179
      data[6] = ' ';
180
      data[7] = BATTERY;
181
      data[8] = ' ';
182
      data[9] = (char) wl_get_xbee_id();  // robot number (self)
183
      data[10] = ' ';
184
      data[11] = (char) battery8();  // battery reading
185
      data[12] = '\0';
186

  
187
      wl_send_robot_to_robot_global_packet(colonet_pgh.groupCode, COLONET_RESPONSE,
188
        data, 13, xbeeDongleID, 0);
189
      usb_puts("lol \n");
190

  
174 191
      break;
175 192

  
176 193
    case ORB_INIT:

Also available in: Unified diff