|
@@ -161,7 +161,11 @@ namespace SmartBowSDK
|
|
|
if (smartBowHelper.GetIsConnectName())
|
|
if (smartBowHelper.GetIsConnectName())
|
|
|
{
|
|
{
|
|
|
//后续匹配名字 可以是多个设备
|
|
//后续匹配名字 可以是多个设备
|
|
|
- Log($"发现设备{res.name},is fileters empty:{ string.IsNullOrEmpty(smartBowHelper.GetFilters())},name:{smartBowHelper.GetFilters()}");
|
|
|
|
|
|
|
+ string _filters = string.IsNullOrEmpty(smartBowHelper.GetFilters())
|
|
|
|
|
+ ? bluetoothAim.deviceConfig.deviceName
|
|
|
|
|
+ : smartBowHelper.GetFilters();
|
|
|
|
|
+ //如果有定制执行定制
|
|
|
|
|
+ Log($"发现设备{res.name},is fileters empty:{ string.IsNullOrEmpty(smartBowHelper.GetFilters())},current filters:{smartBowHelper.GetFilters()}");
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -200,7 +204,7 @@ namespace SmartBowSDK
|
|
|
{
|
|
{
|
|
|
selectedDeviceId = res.id;
|
|
selectedDeviceId = res.id;
|
|
|
StopDeviceScan();
|
|
StopDeviceScan();
|
|
|
- Log($"Name匹配设备 {trimmedFilter}");
|
|
|
|
|
|
|
+ Log($"匹配设备名:{trimmedFilter}");
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -220,7 +224,7 @@ namespace SmartBowSDK
|
|
|
{
|
|
{
|
|
|
selectedDeviceId = res.id;
|
|
selectedDeviceId = res.id;
|
|
|
StopDeviceScan();
|
|
StopDeviceScan();
|
|
|
- Log($"MAC匹配设备 {searchMac}");
|
|
|
|
|
|
|
+ Log($"匹配设备 MAC:{searchMac}");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -259,7 +263,7 @@ namespace SmartBowSDK
|
|
|
status = BleApi.PollCharacteristic(out res, false);
|
|
status = BleApi.PollCharacteristic(out res, false);
|
|
|
if (status == BleApi.ScanStatus.AVAILABLE)
|
|
if (status == BleApi.ScanStatus.AVAILABLE)
|
|
|
{
|
|
{
|
|
|
- Log("res.userDescription:"+ res.userDescription+ ",res.uuid:" + res.uuid);
|
|
|
|
|
|
|
+ // Log("res.userDescription:"+ res.userDescription+ ",res.uuid:" + res.uuid);
|
|
|
if (res.userDescription == "no description available" || //旧设备
|
|
if (res.userDescription == "no description available" || //旧设备
|
|
|
res.userDescription == "SPP Write Channel" || //新设备
|
|
res.userDescription == "SPP Write Channel" || //新设备
|
|
|
res.userDescription == "SPP Read Channel")
|
|
res.userDescription == "SPP Read Channel")
|
|
@@ -466,7 +470,7 @@ namespace SmartBowSDK
|
|
|
data.buf[i] = payload[i];
|
|
data.buf[i] = payload[i];
|
|
|
// no error code available in non-blocking mode
|
|
// no error code available in non-blocking mode
|
|
|
BleApi.SendData(in data, false);
|
|
BleApi.SendData(in data, false);
|
|
|
- Log("Write(" + text + ")");
|
|
|
|
|
|
|
+ //Log("Write(" + text + ")");
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|