private void device_Error(object sender, SemtechLib.General.Events.ErrorEventArgs e) { if (InvokeRequired) BeginInvoke((Delegate)new MainForm.ErrorDelegate(OnError), e.Status, e.Message); else OnError(e.Status, e.Message); }
private void packetHandlerView1_Error(object sender, SemtechLib.General.Events.ErrorEventArgs e) { this.OnError(e.Status, e.Message); }
private static string GetDevicePath(IntPtr DeviceInfoTable, ref SemtechLib.Devices.Common.NativeMethods.SP_DEVICE_INTERFACE_DATA InterfaceDataStructure) { int RequiredSize = 0; SemtechLib.Devices.Common.NativeMethods.SP_DEVICE_INTERFACE_DETAIL_DATA interfaceDetailData = new SemtechLib.Devices.Common.NativeMethods.SP_DEVICE_INTERFACE_DETAIL_DATA(); interfaceDetailData.cbSize = Marshal.SizeOf(interfaceDetailData); SemtechLib.Devices.Common.NativeMethods.SetupDiGetDeviceInterfaceDetail(DeviceInfoTable, ref InterfaceDataStructure, IntPtr.Zero, 0, ref RequiredSize, IntPtr.Zero); IntPtr hDevice = Marshal.AllocHGlobal(RequiredSize); interfaceDetailData.cbSize = IntPtr.Size != 8 ? 4 + Marshal.SystemDefaultCharSize : 8; Marshal.StructureToPtr(interfaceDetailData, hDevice, false); if (SemtechLib.Devices.Common.NativeMethods.SetupDiGetDeviceInterfaceDetail(DeviceInfoTable, ref InterfaceDataStructure, hDevice, RequiredSize, IntPtr.Zero, IntPtr.Zero)) { string devicePath = Marshal.PtrToStringUni(new IntPtr(hDevice.ToInt32() + 4)); Marshal.FreeHGlobal(hDevice); return devicePath; } Marshal.FreeHGlobal(hDevice); return string.Empty; }
private void sx1231ViewControl_Error(object sender, SemtechLib.General.Events.ErrorEventArgs e) { if (InvokeRequired) BeginInvoke(new ErrorDelegate(OnError), new object[] { e.Status, e.Message }); else OnError(e.Status, e.Message); }
private void loRaViewControl1_Error(object sender, SemtechLib.General.Events.ErrorEventArgs e) { this.OnError(e.Status, e.Message); }