I am using Windows 10 build 14393.2156. Bluetooth adapter LMP version is 6.X (Bluetooth version 4.0). I cannot write byte array data with length 350. However, I can write byte array data with length around 60 and get the expected data from the BLE device. When i write byte array of large length e.g. 350, I get windows exception: "Exception: The specified server cannot perform the requested operation. (Exception from HRESULT: 0x8007003A)". Following is the code:
private async Task CoreWrite(byte[] data)
{
var writeBuffer = CryptographicBuffer.CreateFromByteArray(data);
var result = await _txCharacteristic.WriteValueAsync(writeBuffer);
if (result != GattCommunicationStatus.Success)
{
throw new IOException($"Failed to write to bluetooth device. Status: {nameof(result)}");
}
}
Please note that the device is already paired. Is there any payload limit which can possibly affect limiting of payload length in Bluetooth 4.0 versus 4.2 specification. Or you suggest a higher Windows 10 builds with more recent Bluetooth LMP 8.X should help fix the issue. Appreciate any advice or help.
Many thanks.