string SensorModel::poseToString(Pose& pose) { char buffer[4]; buffer[0] = valueToChar(pose.x, pos_resolution); buffer[1] = valueToChar(pose.y, pos_resolution); buffer[2] = valueToChar(pose.t, theta_resolution); buffer[3] = '\0'; string str = buffer; return str; }
JNIEXPORT jstring JNICALL Java_com_OOBDeviceTest_helper_NativeManger_getLcdId( JNIEnv *env, jobject obj) { char src[4]; char buf[4 << 1 + 1]; lcd_id_get(src); valueToChar(src, buf, 4); return env->NewStringUTF(buf); }
JNIEXPORT jstring JNICALL Java_com_OOBDeviceTest_helper_NativeManger_getMAC( JNIEnv *env, jobject obj) { char buf[6 << 1 + 1]; // int i = 0; // for (i=0; i<7; i++) { // sprintf(&buf[i*2],"%x%x",sysIdbdata.Mac_Data[i]>>4, sysIdbdata.Mac_Data[i]&0x0f); // } // buf[6<<1]='\0'; valueToChar(sysIdbdata.BlueTooth, buf, 6); return env->NewStringUTF(buf); }
JNIEXPORT jstring JNICALL Java_com_OOBDeviceTest_helper_NativeManger_getBT( JNIEnv *env, jobject obj) { char buf[6 << 1 + 1]; valueToChar(sysIdbdata.BlueTooth, buf, 6); return env->NewStringUTF(buf); }