今天好像找到问题了。
原来要发送的数据定义是这样的
//Æ÷¼þID,µ÷ÊÔ³ÌÐò¼Ù¶¨Îª197331
uint8_t SYSID[5] = {
0x31,0x39,0x37,0x33,0x33,0x31
};
//³ö³§ÈÕÆÚ£¬4×Ö½ÚYYMD£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª2021
uint8_t SYSMData[3] = {0x38,0x37,0x36,0x31};
//Ðͺţ¬4×Ö½Ú£¬ËùÓÐÐͺžù²ÉÓñàºÅ£¬µ÷ÊÔ³ÌÐò¼Ù¶¨ÎªEcho,
uint8_t SYSModel[3] = {0x45,0x63,0x68,0x6f};
//³ö³§°æ±¾ºÅ£¬2×Ö½Ú£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª0£»
uint8_t SYSMEdition[1] = {0x30,0x30};
//¸üÐÂÈÕÆÚ£¬4×Ö½ÚYYMD£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª2021
uint8_t SYSCData[3] = {0x32,0x30,0x32,0x31};
//¸üа汾ºÅ£¬2×Ö½Ú£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª1£»
uint8_t SYSCEdition[1] ={ 0x31,0x31};
今天突然感觉好像是错位了,就改了一下变成这样
//Æ÷¼þID,µ÷ÊÔ³ÌÐò¼Ù¶¨Îª197331
uint8_t SYSID[6] = {
0x31,0x39,0x37,0x33,0x33,0x31
};
//³ö³§ÈÕÆÚ£¬4×Ö½ÚYYMD£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª2021
uint8_t SYSMData[4] = {0x38,0x37,0x36,0x31};
//Ðͺţ¬4×Ö½Ú£¬ËùÓÐÐͺžù²ÉÓñàºÅ£¬µ÷ÊÔ³ÌÐò¼Ù¶¨ÎªEcho,
uint8_t SYSModel[4] = {0x45,0x63,0x68,0x6f};
//³ö³§°æ±¾ºÅ£¬2×Ö½Ú£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª0£»
uint8_t SYSMEdition[2] = {0x30,0x30};
//¸üÐÂÈÕÆÚ£¬4×Ö½ÚYYMD£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª2021
uint8_t SYSCData[4] = {0x32,0x30,0x32,0x31};
//¸üа汾ºÅ£¬2×Ö½Ú£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª1£»
uint8_t SYSCEdition[2] ={ 0x31,0x31};
现在输出正常了
上面一行是原来定义的输出结果,下面一行是改过定义之后的
f197338876EEch201202*1??àúf
------------------------------------------------------------------
f1973318761Echo00202111??àúf
------------------------------------------------------------------
但这是不是X-IDE有毛病吧,就算没有对齐,也不能写在别的变量里吧
今天好像找到问题了。
原来要发送的数据定义是这样的
//Æ÷¼þID,µ÷ÊÔ³ÌÐò¼Ù¶¨Îª197331
uint8_t SYSID[5] = {
0x31,0x39,0x37,0x33,0x33,0x31
};
//³ö³§ÈÕÆÚ£¬4×Ö½ÚYYMD£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª2021
uint8_t SYSMData[3] = {0x38,0x37,0x36,0x31};
//Ðͺţ¬4×Ö½Ú£¬ËùÓÐÐͺžù²ÉÓñàºÅ£¬µ÷ÊÔ³ÌÐò¼Ù¶¨ÎªEcho,
uint8_t SYSModel[3] = {0x45,0x63,0x68,0x6f};
//³ö³§°æ±¾ºÅ£¬2×Ö½Ú£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª0£»
uint8_t SYSMEdition[1] = {0x30,0x30};
//¸üÐÂÈÕÆÚ£¬4×Ö½ÚYYMD£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª2021
uint8_t SYSCData[3] = {0x32,0x30,0x32,0x31};
//¸üа汾ºÅ£¬2×Ö½Ú£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª1£»
uint8_t SYSCEdition[1] ={ 0x31,0x31};
今天突然感觉好像是错位了,就改了一下变成这样
//Æ÷¼þID,µ÷ÊÔ³ÌÐò¼Ù¶¨Îª197331
uint8_t SYSID[6] = {
0x31,0x39,0x37,0x33,0x33,0x31
};
//³ö³§ÈÕÆÚ£¬4×Ö½ÚYYMD£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª2021
uint8_t SYSMData[4] = {0x38,0x37,0x36,0x31};
//Ðͺţ¬4×Ö½Ú£¬ËùÓÐÐͺžù²ÉÓñàºÅ£¬µ÷ÊÔ³ÌÐò¼Ù¶¨ÎªEcho,
uint8_t SYSModel[4] = {0x45,0x63,0x68,0x6f};
//³ö³§°æ±¾ºÅ£¬2×Ö½Ú£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª0£»
uint8_t SYSMEdition[2] = {0x30,0x30};
//¸üÐÂÈÕÆÚ£¬4×Ö½ÚYYMD£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª2021
uint8_t SYSCData[4] = {0x32,0x30,0x32,0x31};
//¸üа汾ºÅ£¬2×Ö½Ú£¬µ÷ÊÔ³ÌÐò¼Ù¶¨Îª1£»
uint8_t SYSCEdition[2] ={ 0x31,0x31};
现在输出正常了
上面一行是原来定义的输出结果,下面一行是改过定义之后的
f197338876EEch201202*1??àúf
------------------------------------------------------------------
f1973318761Echo00202111??àúf
------------------------------------------------------------------
但这是不是X-IDE有毛病吧,就算没有对齐,也不能写在别的变量里吧
举报