/* ******************************************************************************** * Arduino_BT_SlaveReply.pde * Author : CH, Chen (Taiwan) * Date : 2012.5.29 * * Data Packetage for Bluetooth Communication:(P22 of NXT Communication Protocol) * Length LSB + Length MSB + Command Type + Command + Data bytes... * * Data Payload of MESSAGEWRITE Direct Command * (Received from NXT) * Byte 0: Command type(0x00 or 0x80) * Byte 1: Direct Command-MESSAGEWRITE(0x09) * Byte 2: Inbox number(0 - 9) * Byte 3: Message size, include null termination byte * Byte 4 - N: Message data, where N = Message size + 3, is treated as a string, must include null termination. * ******************************************************************************** */ #define REPLY_PACKET_SIZE 66 char replyBuf[REPLY_PACKET_SIZE]; char replyMsg[16]={'H','e','l','l','o',' ','N','X','T',' ','(',' ',' ',' ',')','\0'}; int sendCountIndex, sendPacketSize; void build_MESSAGEREAD_returnPackage() { for(int xii=0; xii