public static unsafe byte[] GetDeviceNotificateData(ulong addr, int idx) { byte[] retData = null; var buffer = new CharastricsBuffer(); void * ptr = &buffer.fixedBuffer[0]; var writePtr = new IntPtr(ptr); int size = _BlePluginCopyDeviceNotificateData(addr, idx, writePtr, CharastricsBuffer.BufferSize); retData = new byte[size]; for (int i = 0; i < size; ++i) { retData[i] = buffer.fixedBuffer[i]; } return(retData); }
public static unsafe byte[] GetReadRequestData(ReadRequestHandler handle, int maxSize) { byte[] retData = null; var buffer = new CharastricsBuffer(); void * ptr = &buffer.fixedBuffer[0]; var writePtr = new IntPtr(ptr); int size = _BlePluginCopyReadRequestData(handle.ptr, writePtr, CharastricsBuffer.BufferSize); retData = new byte[size]; for (int i = 0; i < size; ++i) { retData[i] = buffer.fixedBuffer[i]; } return(retData); }