Fix windows release build compilation (#16)
This commit is contained in:
@@ -26,7 +26,6 @@ namespace universal_ble
|
||||
|
||||
std::string to_uuidstr(winrt::guid guid);
|
||||
|
||||
|
||||
/// To call async functions synchronously
|
||||
template <typename async_t>
|
||||
static auto async_get(async_t const &async)
|
||||
@@ -43,9 +42,9 @@ namespace universal_ble
|
||||
{
|
||||
throw FlutterError(winrt::to_string(err.message()));
|
||||
}
|
||||
catch (const std::exception &err)
|
||||
catch (...)
|
||||
{
|
||||
throw FlutterError(err.what());
|
||||
throw FlutterError("Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -785,10 +785,6 @@ namespace universal_ble
|
||||
std::cout << "WriteValueLog: " << winrt::to_string(err.message()) << " ErrorCode: " << std::to_string(errorCode) << std::endl;
|
||||
result(FlutterError(std::to_string(errorCode), winrt::to_string(err.message())));
|
||||
}
|
||||
catch (const std::exception &err)
|
||||
{
|
||||
result(FlutterError("WriteFailed", err.what()));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
result(FlutterError("WriteFailed", "Unknown error"));
|
||||
@@ -904,7 +900,8 @@ namespace universal_ble
|
||||
flutter::EncodableList results = flutter::EncodableList();
|
||||
for (auto &&deviceInfo : devices)
|
||||
{
|
||||
try{
|
||||
try
|
||||
{
|
||||
BluetoothLEDevice device = co_await BluetoothLEDevice::FromIdAsync(deviceInfo.Id());
|
||||
auto deviceId = _mac_address_to_str(device.BluetoothAddress());
|
||||
// Filter by services
|
||||
@@ -932,7 +929,10 @@ namespace universal_ble
|
||||
universalScanResult.set_name(winrt::to_string(deviceInfo.Name()));
|
||||
universalScanResult.set_is_paired(deviceInfo.Pairing().IsPaired());
|
||||
results.push_back(flutter::CustomEncodableValue(universalScanResult));
|
||||
}catch(...){ }
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
result(results);
|
||||
}
|
||||
@@ -942,10 +942,6 @@ namespace universal_ble
|
||||
std::cout << "GetConnectedDeviceLog: " << winrt::to_string(err.message()) << " ErrorCode: " << std::to_string(errorCode) << std::endl;
|
||||
result(FlutterError(std::to_string(errorCode), winrt::to_string(err.message())));
|
||||
}
|
||||
catch (const std::exception &err)
|
||||
{
|
||||
result(FlutterError(err.what()));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "Unknown error GetConnectedDevicesAsync" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user