public unsafe void GetCommProperties() { using (SafeFileHandle handle = CommunicationsMethods.CreateComFileHandle(@"\\.\COM4")) { COMMPROP properties = CommunicationsMethods.GetCommProperties(handle); } }
public unsafe void GetCommConfig() { using (SafeFileHandle handle = CommunicationsMethods.CreateComFileHandle(@"\\.\COM4")) { COMMCONFIG config = CommunicationsMethods.GetCommConfig(handle); } }
public unsafe void BuildCommDcb() { DCB dcb = CommunicationsMethods.BuildCommDCB(@"baud=1200 parity=N data=8 stop=1"); dcb.BaudRate.Should().Be(CommBaudRate.CBR_1200); dcb.Parity.Should().Be(Parity.NOPARITY); dcb.ByteSize.Should().Be(8); dcb.StopBits.Should().Be(StopBits.ONESTOPBIT); }
public unsafe void CommConfigDialog() { COMMCONFIG config = CommunicationsMethods.CommConfigDialog( @"COM4", WindowMethods.GetForegroundWindow()); }
public unsafe void GetDefaultCommConfig() { COMMCONFIG config = CommunicationsMethods.GetDefaultCommConfig(@"COM4"); }