-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi,
I'm working on transmitting data from ESP32 to unity, thanks for providing this useful example.
I slightly modify your program so It is almost the same and I thought it won't be any problems. But when unity goes to subscribes stage.
`case States.Subscribe:
BluetoothLEHardwareInterface.SubscribeCharacteristicWithDeviceAddress(_deviceAddress, ServiceUUID, SubscribeCharacteristic, null, (address, characteristicUUID, bytes) => {
// we don't have a great way to set the state other than waiting until we actually got
// some data back. For this demo with the rfduino that means pressing the button
// on the rfduino at least once before the GUI will update.
_state = States.None;
// we received some data from the device
_dataBytes = bytes;
float qx = System.BitConverter.ToSingle(bytes, 0);
float qy = System.BitConverter.ToSingle(bytes, 8);
float qz = System.BitConverter.ToSingle(bytes, 4);
float qw = System.BitConverter.ToSingle(bytes, 12)*-1;
rawQuat = new Quaternion(qx, qy, qz, qw);
cubeTransform.rotation = quatLookAtCam*rawQuat;
//DeviceNameFoundedText.text = qx.ToString() + " " + qy.ToString() + " " + qz.ToString() + " " + qw.ToString()+"\n";
DeviceNameFoundedText.text = "raw : "+rawQuat.ToString()+"\n";
DeviceNameFoundedText.text += "cube : "+cubeTransform.rotation.ToString();
});
break;`
everything in side seems did nothing T_T.
and the console shows:

Did you met this problem before?
Metadata
Metadata
Assignees
Labels
No labels