@@ -91,13 +91,17 @@ private void RegisterAndConfigureComPort()
9191 return ;
9292 }
9393
94- var result = Port . Register ( ) ;
95- if ( result != eDeviceRegistrationUnRegistrationResponse . Success )
94+
95+ if ( Port . Parent is CrestronControlSystem || Port . Parent is CenIoCom102 )
9696 {
97- this . LogError ( $ "Cannot register { Key } using { Port . Parent . GetType ( ) . Name } -comport-{ Port . ID } (result == { result } )") ;
98- return ;
97+ var result = Port . Register ( ) ;
98+ if ( result != eDeviceRegistrationUnRegistrationResponse . Success )
99+ {
100+ this . LogError ( $ "Cannot register { Key } using { Port . Parent . GetType ( ) . Name } -comport-{ Port . ID } (result == { result } )") ;
101+ return ;
102+ }
103+ this . LogInformation ( $ "Successfully registered { Key } using { Port . Parent . GetType ( ) . Name } -comport-{ Port . ID } (result == { result } )") ;
99104 }
100- this . LogInformation ( $ "Successfully registered { Key } using { Port . Parent . GetType ( ) . Name } -comport-{ Port . ID } (result == { result } )") ;
101105
102106 var specResult = Port . SetComPortSpec ( Spec ) ;
103107 if ( specResult != 0 )
@@ -107,38 +111,6 @@ private void RegisterAndConfigureComPort()
107111 }
108112 this . LogInformation ( $ "Successfully set comspec for { Key } using { Port . Parent . GetType ( ) . Name } -comport-{ Port . ID } (result == { specResult } )") ;
109113
110-
111- // TODO [ ] - Remove debug logging once verified working
112- // if (Port.Parent is CenIoCom102)
113- // {
114- // Port.PropertyChanged += (s, e) =>
115- // {
116- // this.LogInformation($@"RegisterAndConfigureComPort: PropertyChanged Fired >>
117- // comPort-'{Port.ID}',
118- // Property Changed-'{e.Property}',
119- // Value Changed-'{e.Value}',
120- // deviceName-'{Port.DeviceName}',
121- // parentDevice-'{Port.ParentDevice}',
122- // parent-`{Port.Parent}`,
123- // online-`{Port.IsOnline}`,
124- // present-`{Port.Present}`,
125- // supportedBaudRates-'{Port.SupportedBaudRates}'");
126- // };
127- // Port.ExtendedInformationChanged += (s, e) =>
128- // {
129-
130- // this.LogInformation($@"RegisterAndConfigureComPort: ExtendedInformationChanged Fired >>
131- // comPort-'{Port.ID}',
132- // {e.Protocol},
133- // {e.BaudRate},
134- // {e.Parity},
135- // {e.DataBits},
136- // {e.StopBits},
137- // HW Handshake-'{e.HardwareHandshakeSetting}',
138- // SW Handshake-'{e.SoftwareHandshakeSetting}'");
139- // };
140- // }
141-
142114 Port . SerialDataReceived += Port_SerialDataReceived ;
143115 }
144116
0 commit comments