示例#1
0
 public unsafe void GetCommProperties()
 {
     using (SafeFileHandle handle = CommunicationsMethods.CreateComFileHandle(@"\\.\COM4"))
     {
         COMMPROP properties = CommunicationsMethods.GetCommProperties(handle);
     }
 }
示例#2
0
 public unsafe void GetCommConfig()
 {
     using (SafeFileHandle handle = CommunicationsMethods.CreateComFileHandle(@"\\.\COM4"))
     {
         COMMCONFIG config = CommunicationsMethods.GetCommConfig(handle);
     }
 }
示例#3
0
        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);
        }
示例#4
0
 public unsafe void CommConfigDialog()
 {
     COMMCONFIG config = CommunicationsMethods.CommConfigDialog(
         @"COM4",
         WindowMethods.GetForegroundWindow());
 }
示例#5
0
 public unsafe void GetDefaultCommConfig()
 {
     COMMCONFIG config = CommunicationsMethods.GetDefaultCommConfig(@"COM4");
 }