Commit 43ded144 authored by captainwong's avatar captainwong

fix 2

parent 13fde13a
......@@ -91,9 +91,8 @@ JNIEXPORT jstring JNICALL Java_javademo_jni_AdemcoHbLibrary_pack2
jboolean *buf = (jboolean *)calloc(xdata_len , sizeof(jboolean)); //开辟jboolean类型的内存空间,jboolean对应的c++类型为unsigned char
if(buf == nullptr){
LOGE("jni_radio_send: calloc error.");
return 0;
}
}
for(int i=0; i < xdata_len; i++){ //把jcharArray的数据元素复制到buf所指的内存空间
*(buf + i) = (jboolean)(*(array + i));
}
......
......@@ -80,7 +80,7 @@ public class SimpleServer {
xdata[2] = 0x3F;
xdata[3] = 0xA1;
xdata[4] = 0x76;
String data = lib.pack2(1234, "861234567890", 666666, 3400, 0, 0, xdata);
String data = lib.pack2(1234, "861234567890", 666666, 3400, 0, 0, xdata, 5);
try{
byte[] bytes = data.getBytes(data);
System.out.println("data=" + printable_bytes(bytes));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment