我遇到以下错误:
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.ni.dll ErrorThe object has been closed. (Exception from HRESULT: 0x80000013)
对于下面发布的代码段:
var writer = new DataWriter();
writer.WriteBytes(packet_command);
GattWriteResult write_result = await PacketCharacteristic.WriteValueWithResultAsync(writer.DetachBuffer());
if (write_result.Status == GattCommunicationStatus.Success)
{
Debug.WriteLine("PACKETS SENT TO DEVICE = " + BitConverter.ToString(packet_command));
}
else
{
Debug.WriteLine("NOT WRITING TO DEVICE");
}