Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when writing to bluetooth GATT Characteristic #755

Closed
caseymtimm opened this issue Mar 3, 2021 · 0 comments · Fixed by #930
Closed

Exception when writing to bluetooth GATT Characteristic #755

caseymtimm opened this issue Mar 3, 2021 · 0 comments · Fixed by #930
Assignees
Labels
bug Something isn't working fixed Issue has been fixed in an upcoming or existing release
Milestone

Comments

@caseymtimm
Copy link

Describe the bug
When using a .net 5 project attempting to write to a GATT Characteristic with a buffer allocated in C# results in an exception.

To Reproduce
Please see gist: https://gist.github.com/caseymtimm/735ca6ff44dea3fd572c1686b11dfefc

Expected behavior
The value is written to the characteristic without triggering an exception.

Version Info
TFM net5.0-windows10.0.19041

Additional context
Interestingly this does not happen if I read the characteristic and then update the resulting buffer then write it back. This issue also doesn't occur in older version of .net not using the new winrt system.

Exception Details

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=WinRT.Runtime
  StackTrace:
   at WinRT.ObjectReference`1.GetVtable(IntPtr thisPtr)

Call Stack

>	WinRT.Runtime.dll!WinRT.ObjectReference<ABI.Com.IMarshal.Vftbl>.GetVtable(System.IntPtr thisPtr)	Unknown
 	WinRT.Runtime.dll!WinRT.ObjectReference<ABI.Com.IMarshal.Vftbl>.ObjectReference(System.IntPtr thisPtr)	Unknown
 	WinRT.Runtime.dll!WinRT.ObjectReference<ABI.Com.IMarshal.Vftbl>.Attach(ref System.IntPtr thisPtr)	Unknown
 	Microsoft.Windows.SDK.NET.dll!System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer.EnsureHasMarshalProxy()	Unknown
 	Microsoft.Windows.SDK.NET.dll!System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer.Com.IMarshal.GetMarshalSizeMax(ref System.Guid riid, System.IntPtr pv, Com.MSHCTX dwDestContext, System.IntPtr pvDestContext, Com.MSHLFLAGS mshlflags, out uint pSize)	Unknown
 	Microsoft.Windows.SDK.NET.dll!ABI.Com.IMarshal.Vftbl.Do_Abi_GetMarshalSizeMax_1(System.IntPtr thisPtr, ref System.Guid riid, System.IntPtr pv, Com.MSHCTX dwDestContext, System.IntPtr pvDestContext, Com.MSHLFLAGS mshlflags, out uint pSize)	Unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Issue has been fixed in an upcoming or existing release
Projects
None yet
6 participants