/* The first 40 bytes of the packet (the IP and TCP headers) are read from the uip_buf buffer, and the following bytes (the application data) are read from the uip_appdata buffer.  */
void slipdev_send(void)
/* The first 40 bytes of the packet (the IP and TCP headers) are read from the uip_buf buffer, and the following bytes (the application data) are read from the uip_appdata buffer.  */
void slipdev_send(void)
{
  u16_t i;
  u8_t *ptr;
  u8_t c;
  slipdev_char_put(SLIP_END);
  ptr = uip_buf;
  for(i = 0; i < uip_len; ++i) {
    if(i == 40) {
      ptr = (u8_t *)uip_appdata;
    }
    c = *ptr++;
    switch(c) {
    case SLIP_END:
      slipdev_char_put(SLIP_ESC);
      slipdev_char_put(SLIP_ESC_END);
      break;
    case SLIP_ESC:
      slipdev_char_put(SLIP_ESC);
      slipdev_char_put(SLIP_ESC_ESC);
      break;
    default:
      slipdev_char_put(c);
      break;
    }
  }
  slipdev_char_put(SLIP_END);
}