@@ -66,8 +66,20 @@ public enum TPCANStatus : uint
6666
6767namespace Peak . Can . Basic
6868{
69- using Peak . Can . Basic . BackwardCompatibility ;
69+ using BackwardCompatibility ;
7070
71+ public enum MessageType : byte
72+ {
73+ Standard = 0 ,
74+ RemoteRequest = 1 ,
75+ Extended = 2 ,
76+ FlexibleDataRate = 4 ,
77+ BitRateSwitch = 8 ,
78+ ErrorStateIndicator = 16 ,
79+ Echo = 32 ,
80+ Error = 64 ,
81+ Status = 128
82+ }
7183 [ Flags ]
7284 public enum PcanStatus : uint
7385 {
@@ -188,7 +200,21 @@ public enum BitrateType
188200 public BitrateSegment Data ;
189201
190202 public BitrateFD ( ClockFrequency clock , BitrateSegment nominal , BitrateSegment data )
191- { Clock = clock ; Nominal = nominal ; Data = data ; }
203+ {
204+ Clock = clock ; Nominal = nominal ; Data = data ;
205+ }
206+
207+ public override string ToString ( )
208+ {
209+ // "f_clock=80000000,nom_brp=2,nom_tseg1=63,nom_tseg2=16,nom_sjw=16,
210+ // data_brp=2,data_tseg1=15,data_tseg2=4,data_sjw=4"
211+ var fclk = ( ( uint ) Clock ) . ToString ( System . Globalization . CultureInfo . InvariantCulture ) ;
212+ return $ "f_clock={ fclk } ," +
213+ $ "nom_brp={ Nominal . Brp } ,nom_tseg1={ Nominal . Tseg1 } ,nom_tseg2={ Nominal . Tseg2 } ,nom_sjw={ Nominal . Sjw } ," +
214+ $ "data_brp={ Data . Brp } ,data_tseg1={ Data . Tseg1 } ,data_tseg2={ Data . Tseg2 } ,data_sjw={ Data . Sjw } ";
215+ }
216+
217+ public static implicit operator string ( BitrateFD fd ) => fd . ToString ( ) ;
192218 }
193219
194220 public static class Api
0 commit comments