Cleaned up compiler warnings, deprecated API usage and some localization language settings (PRI errors)

This commit is contained in:
Tony Goodhew 2018-10-09 14:01:01 -07:00
Родитель 668ec5d976
Коммит 8ad6272a51
13 изменённых файлов: 53 добавлений и 38 удалений

Просмотреть файл

@ -42,6 +42,7 @@ Windows::Foundation::IAsyncOperation<bool>^ ArduinoFirmataProvider::InitializeAs
{
_Arduino = arduinoTask.get();
}
#pragma warning (suppress: 4101) // To make debugging easier we're leaving ex declared but suppressing the warning
catch (const std::exception& ex)
{
OutputDebugString(L"_Arduino->GetArduinoConnectionAsync(); failed");
@ -68,6 +69,7 @@ Windows::Foundation::IAsyncOperation<bool>^ ArduinoFirmataProvider::InitializeAs
_initialized = true;
}
}
#pragma warning (suppress: 4101) // To make debugging easier we're leaving ex declared but suppressing the warning
catch (const std::exception& ex)
{
OutputDebugString(L"_Arduino->GetPinConfigurationAsync(); failed");

Просмотреть файл

@ -31,7 +31,7 @@
<Keyword>WindowsRuntimeComponent</Keyword>
<ProjectName>ArduinoProviders</ProjectName>
<RootNamespace>ArduinoProviders</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<DefaultLanguage>en</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>

Просмотреть файл

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ArduinoSelector</RootNamespace>
<AssemblyName>ArduinoSelector</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<DefaultLanguage>en</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>

Просмотреть файл

@ -56,7 +56,6 @@ namespace UploaderComponent
internal async Task ProgramInternal(MemoryBlock memoryBlockContents)
{
Debug.WriteLine("ProgramInternal");
bool good = true;
if (!arduino.IsConnected)
{
Debug.WriteLine("Arduino is not connected????");

Просмотреть файл

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ArduinoUploader</RootNamespace>
<AssemblyName>ArduinoUploader</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<DefaultLanguage>en</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.15063.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>

Просмотреть файл

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DSConnectAppService</RootNamespace>
<AssemblyName>DSConnectAppService</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<DefaultLanguage>en</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>

Просмотреть файл

@ -31,7 +31,7 @@
<Keyword>WindowsRuntimeComponent</Keyword>
<ProjectName>Microsoft.Maker.Firmata</ProjectName>
<RootNamespace>Microsoft.Maker.Firmata</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<DefaultLanguage>en</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>

Просмотреть файл

@ -31,7 +31,7 @@
<Keyword>WindowsRuntimeComponent</Keyword>
<ProjectName>Microsoft.Maker.RemoteWiring</ProjectName>
<RootNamespace>Microsoft.Maker.RemoteWiring</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<DefaultLanguage>en</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>

Просмотреть файл

@ -108,7 +108,7 @@ HardwareProfile::getPinCapabilitiesBitmask(
size_t pin_
)
{
if( !_is_valid || _pinCapabilities == nullptr || pin_ >= _total_pin_count )
if( !_is_valid || _pinCapabilities == nullptr || pin_ >= (unsigned)_total_pin_count )
{
return 0;
}

Просмотреть файл

@ -103,11 +103,11 @@ public:
auto vector = ref new Platform::Collections::Vector<uint8_t>();
if( _is_valid )
{
for( size_t pin = _analog_offset; pin < _total_pin_count; ++pin )
for( size_t pin = _analog_offset; pin < (unsigned)_total_pin_count; ++pin )
{
if( isAnalogSupported( pin ) )
{
vector->Append( pin );
vector->Append( (uint8_t)pin );
}
}
}
@ -122,11 +122,11 @@ public:
auto vector = ref new Platform::Collections::Vector<uint8_t>();
if( _is_valid )
{
for( size_t pin = 0; pin < _total_pin_count; ++pin )
for( size_t pin = 0; pin < (unsigned)_total_pin_count; ++pin )
{
if( isDigitalOutputSupported( pin ) )
{
vector->Append( pin );
vector->Append((uint8_t)pin );
}
}
}
@ -141,11 +141,11 @@ public:
auto vector = ref new Platform::Collections::Vector<uint8_t>();
if( _is_valid )
{
for( size_t pin = 0; pin < _total_pin_count; ++pin )
for( size_t pin = 0; pin < (unsigned)_total_pin_count; ++pin )
{
if( getPinCapabilitiesBitmask( pin ) == 0 )
{
vector->Append( pin );
vector->Append((uint8_t)pin );
}
}
}
@ -160,11 +160,11 @@ public:
auto vector = ref new Platform::Collections::Vector<uint8_t>();
if( _is_valid )
{
for( size_t pin = 0; pin < _total_pin_count; ++pin )
for( size_t pin = 0; pin < (unsigned)_total_pin_count; ++pin )
{
if( isI2cSupported( pin ) )
{
vector->Append( pin );
vector->Append((uint8_t)pin );
}
}
}
@ -179,11 +179,11 @@ public:
auto vector = ref new Platform::Collections::Vector<uint8_t>();
if( _is_valid )
{
for( size_t pin = 0; pin < _total_pin_count; ++pin )
for( size_t pin = 0; pin < (unsigned)_total_pin_count; ++pin )
{
if( isPwmSupported( pin ) )
{
vector->Append( pin );
vector->Append((uint8_t)pin );
}
}
}
@ -198,11 +198,11 @@ public:
auto vector = ref new Platform::Collections::Vector<uint8_t>();
if( _is_valid )
{
for( size_t pin = 0; pin < _total_pin_count; ++pin )
for( size_t pin = 0; pin < (unsigned)_total_pin_count; ++pin )
{
if( isServoSupported( pin ) )
{
vector->Append( pin );
vector->Append((uint8_t)pin );
}
}
}

Просмотреть файл

@ -31,7 +31,7 @@
<Keyword>WindowsRuntimeComponent</Keyword>
<ProjectName>Microsoft.Maker.Serial</ProjectName>
<RootNamespace>Microsoft.Maker.Serial</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<DefaultLanguage>en</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>

Просмотреть файл

@ -397,26 +397,40 @@ BleSerial::connectToDeviceAsync (
) {
_device_name = device_->Name; // Update name in case device was specified directly
return Concurrency::create_task(Windows::Devices::Bluetooth::BluetoothLEDevice::FromIdAsync(device_->Id))
.then([this](Windows::Devices::Bluetooth::BluetoothLEDevice ^gatt_device_) {
if( gatt_device_ == nullptr )
{
throw ref new Platform::Exception( E_UNEXPECTED, ref new Platform::String( L"Unable to initialize the device. BluetoothLEDevice::FromIdAsync returned null." ) );
}
.then([this](Windows::Devices::Bluetooth::BluetoothLEDevice ^gatt_device_) {
if (gatt_device_ == nullptr)
{
throw ref new Platform::Exception(E_UNEXPECTED, ref new Platform::String(L"Unable to initialize the device. BluetoothLEDevice::FromIdAsync returned null."));
}
// Store parameter as a member to ensure the duration of object allocation
_gatt_device = gatt_device_;
// Store parameter as a member to ensure the duration of object allocation
_gatt_device = gatt_device_;
// Enable TX
_tx = ref new DataWriter();
_gatt_service = _gatt_device->GetGattService(BLE_SERVICE_UUID);
_gatt_tx_characteristic = _gatt_service->GetCharacteristics(BLE_SERIAL_TX_CHARACTERISTIC_UUID)->GetAt(0);
// Create a task to handle the BLE TX & RX setup as async
auto _gatt_task = create_task(_gatt_device->GetGattServicesForUuidAsync(BLE_SERVICE_UUID));
// Enable RX
_gatt_rx_characteristic = _gatt_service->GetCharacteristics(BLE_SERIAL_RX_CHARACTERISTIC_UUID)->GetAt(0);
_gatt_rx_characteristic->ValueChanged += ref new Windows::Foundation::TypedEventHandler<GattCharacteristic ^, GattValueChangedEventArgs ^>(this, &BleSerial::rxCallback);
_gatt_rx_characteristic->WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue::Notify);
// Enable TX
_gatt_task.then([this](GattDeviceServicesResult^ _gatt_service_result)
{
_tx = ref new DataWriter();
// TODO: Need to implement the communication status check properly - Currently assumes that it just works
_gatt_service = _gatt_service_result->Services->GetAt(0);
}).then([this]()
{
auto _gatt_characterist_task = create_task(_gatt_service->GetCharacteristicsForUuidAsync(BLE_SERIAL_TX_CHARACTERISTIC_UUID));
// Set connection ready flag and fire connection established event
_gatt_characterist_task.then([this](GattCharacteristicsResult^ _gatt_characteristic_result)
{
//// Enable RX
// TODO: Need to implement the communication status check properly - Currently assumes that it just works
_gatt_rx_characteristic = _gatt_characteristic_result->Characteristics->GetAt(0);
_gatt_rx_characteristic->ValueChanged += ref new Windows::Foundation::TypedEventHandler<GattCharacteristic ^, GattValueChangedEventArgs ^>(this, &BleSerial::rxCallback);
_gatt_rx_characteristic->WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue::Notify);
});
});
// Set connection ready flag and fire connection established event
_connection_ready = true;
ConnectionEstablished();
});

Просмотреть файл

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UWPIntelHexFormatReader</RootNamespace>
<AssemblyName>UWPIntelHexFormatReader</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<DefaultLanguage>en</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>