|
#Android stdio编程
#数据点数据透传方案
#下位机为STM32f407
#独立mcu方案
问题描述:我刚接触数据透传,按照机智云例程如下:
byte[] input1 = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 };
// byte[] input2 = { 11, 22, 33, 44, 55, 66, 77, 88, 99};
ConcurrentHashMap<String, Object> dataMap = new ConcurrentHashMap<String, Object>();
dataMap.put("kuozhan", input1);
device.write(dataMap, 0);
我在程序里是这样写的:
public void onClick(View v) {
switch (v.getId()) {
case R.id.apply_temporary_password:
Toast.makeText(EGSActivity.this, "点击了确定的按钮", Toast.LENGTH_SHORT).show();
//mHandler.sendEmptyMessage(send_code);
byte[] input1 = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 };
ConcurrentHashMap<String, Object> dataMap = new ConcurrentHashMap<String, Object>();
dataMap.put("userData", input1);
gizWifiDevice.write(dataMap, 0);
break;
}
}
(上面程序的意思是我按下这个按键就会把这个透传数据发送出去)
但是运行界面我点下按键就一直是“同步状态”这个过程,如下:
求解决!!!
|
|