地球收藏问题,ios 蓝牙有返回值处理,划船机倒计时1时重置
This commit is contained in:
1 parent
9511e30e50
commit
6501284bbc
9 files changed
+36
-13
No files matched your search
@@ -74,7 +74,7 @@ namespace Assets.Scripts.Devices.Ble.Devices
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Debug.Log("发送重置命令");
|
||||
Debug.Log("发送重置命令"+this.controlPointCharacteristic.ToString());
|
||||
hwInterface.WriteCharacteristic(this.controlPointCharacteristic, new byte[] { 0x01 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace Assets.Scripts.Ble
|
||||
|
||||
public void StopScan()
|
||||
{
|
||||
bleMobileThread.Stop();
|
||||
bleMobileThread?.Stop();
|
||||
}
|
||||
|
||||
//发现服务列表
|
||||
@@ -391,8 +391,12 @@ namespace Assets.Scripts.Ble
|
||||
//写入特征值
|
||||
public void WriteCharacteristic(BleCharacteristicInfo characteristic, byte[] data)
|
||||
{
|
||||
BluetoothLEHardwareInterface.WriteCharacteristic(characteristic.Peripheral.Address, characteristic.Service.Id.ToString(), characteristic.Id.ToString(), data, data.Length, false, (characteristicUUID) => {
|
||||
|
||||
bool withResponse = false;
|
||||
#if UNITY_IOS
|
||||
withResponse = characteristic.Id.ToString().ToLower().Contains("2AD9".ToLower());
|
||||
#endif
|
||||
BluetoothLEHardwareInterface.WriteCharacteristic(characteristic.Peripheral.Address, characteristic.Service.Id.ToString(), characteristic.Id.ToString(), data, data.Length, withResponse, (characteristicUUID) => {
|
||||
Debug.Log("相应" + characteristicUUID);
|
||||
BluetoothLEHardwareInterface.Log("Write Succeeded");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user