I need to support multiple devices including both serial and BLE. When i add the following code to Package.appxmanifest file, i get an error
Unable to activate Windows Store app 'blah.blah_blah!App'. The activation request failed with error 'E_INVALIDARG'.
<m2:DeviceCapability Name="bluetooth.genericAttributeProfile">
<m2:Device Id="any">
<m2:Function Type="name:heartRate"/>
</m2:Device>
</m2:DeviceCapability>
<m2:DeviceCapability Name="bluetooth.rfcomm">
<m2:Device Id="any">
<m2:Function Type="name:serialPort"/>
</m2:Device>
</m2:DeviceCapability>
I have reappeared your project’s error. If you just add Bluetooth.genericAttributeProfile or Bluetooth.rfcom, that is ok. So I think the error caused by citing repeatability and you can follow the below step to add Bluetooth and add all Bluetooth’s services.
in the code Behind, you could add RfcommDeviceService by var rfcommDeviceService = Windows.Devices.Bluetooth.Rfcomm.RfcommDeviceService;
and add gattDeviceService by var gattDeviceService = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService;
.