请问Android 嵌入式专家,4byte这种方式怎么传值?
// 1byte 09H
// 1byte Frame_len(帧长度)
// 1byte 烹饪仓位
// 4byte 菜品ID
// 1byte 配方个数
// 2byte 加水量(时间秒)
// 2byte 延迟时间
// 5byte 1byte 序号
// 2byte 加热功率
// 2byte 加热时间
//sendContent 信息体
byte sendContent[] = {1,1,4,};
commandSerialPort.send((byte) 1, (byte) 9, sendContent);
寻找嵌入式专家帮帮忙,补全信息体的内容,谢谢!
byte addr = 0x00;
byte func = 0x00;
byte info_len = 0x00;
byte info_pos = 0x00;
byte[] info_id = {0x00, 0x00, 0x00, 0x00};
byte info_num = 0x00;
byte[] info_water = {0x00, 0x00};
byte[] info_delay = {0x00, 0x00}
byte info_serial = 0x00;
byte[] info_power = {0x00, 0x00};
byte[] info_time = {0x00, 0x00};
byte[] msg = new byte[18];
System.arraycopy(addr, 0, msg, 0, 1);
System.arraycopy(func, 0, msg, 1, 1);
System.arraycopy(info_len, 0, msg, 2, 1);
System.arraycopy(info_pos, 0, msg, 3, 1);
System.arraycopy(info_id, 0, msg, 4, 4);
System.arraycopy(info_num, 0, msg, 8, 1);
System.arraycopy(info_water, 0, msg, 9, 2);
System.arraycopy(info_delay, 0, msg, 11, 2);
System.arraycopy(info_serial, 0, msg, 13, 1);
System.arraycopy(info_power, 0, msg, 14, 2);
System.arraycopy(info_time, 0, msg, 16, 2);
4byte是指长度4个字节吧,不是什么方式的区别