/* make sure it's really a ping */
if (sci_rx_buf[1] != 'I' ||
sci_rx_buf[2] != 'N' ||
- sci_rx_buf[3] != 'G') {
+ sci_rx_buf[3] != 'G' ||
+ sci_rx_buf[4] != '\0') {
send_nack();
return;
}
/* respond with ack & pong */
wait_for_tx_free();
- sci_tx_buf[0] = 'P';
- sci_tx_buf[1] = 'O';
- sci_tx_buf[2] = 'N';
- sci_tx_buf[3] = 'G';
- sci_tx_buf[4] = '\n';
- sci_tx_buf[5] = 0;
+ my_strncpy(sci_tx_buf, "PONG\n", BUFFER_LEN);
send_packet();
}