예제 #1
0
파일: MainForm.cs 프로젝트: kaaLabs15/LoRa
 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);
 }
예제 #2
0
 private void packetHandlerView1_Error(object sender, SemtechLib.General.Events.ErrorEventArgs e)
 {
     this.OnError(e.Status, e.Message);
 }
예제 #3
0
파일: HidDevice.cs 프로젝트: kaaLabs15/LoRa
        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;
        }
예제 #4
0
		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);
		}
예제 #5
0
 private void loRaViewControl1_Error(object sender, SemtechLib.General.Events.ErrorEventArgs e)
 {
     this.OnError(e.Status, e.Message);
 }