arduino字符串数组,arduino模拟接口和数字接口
我有一个在安卓上构建的NFC APP应用程序。 那个作为apdu的回答发送哈希。 这是我在安卓APP应用程序中使用的代码发送散列。 Arduino:uint8_t数组到字符串
@Override
公共byte [ ] processcommandapdu (byte [ ] arg 0,Bundle arg1) {
string hash=' e 68d 3f 574009 cbbe 011150263634 c5c0';
return hash.getbytes (charset.forname (' utf-8 ' ) );
}
现在,在我收到它的Arduino身边,我得到了这个原始数据:
10154561005110253555248485799989810148494949534850255255255255255255255255255
如何得到从那里回来的哈希?
这就是我现在有的东西,但显然不是工作:
uint8_t response[32];
uint8_ tresponselength=sizeof (response );
消息交换(消息,大小)消息(if )、响应、响应长度) }
serial.print(raw: );
for(intI=0; Isizeof(response; I ) {
serial.print(response[I];
}
Serial.println (' );
char buffer[32];
itoa () int ) response,buffer,8 );
串行. print (itoa : );
for(intI=0; Isizeof(buffer ); I ) {
serial.print(buffer[I];
}
Serial.println (' );
}
这是上面代码的串行输出:
raw 3360101545610051102535524848485799810148494953485025525525525525525525525525525525525525525525525525525525552552525255525525255252525525252525255252525252525252525252525252525
ITOA: 4253
r
HALP!
2013-11-26
ReX357