File tree 4 files changed +14
-1
lines changed 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ will be indicated by each configuration setting shown.
32
32
` sdo-id ` = * u12* (** 0** )
33
33
: The "source domain identity" of this PTP instance. Together with the ` domain ` it identifies a domain.
34
34
35
+ ` slave-only ` = * bool* (** false** )
36
+ : Forbids this instance to ever become a master on any port.
37
+
35
38
` priority1 ` = * priority* (** 128** )
36
39
: A tie breaker for the best master clock algorithm in the range ` 0..256 ` . ` 0 ` being the highest priority and ` 255 ` the lowest.
37
40
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ domain.
33
33
The \[lq ] source domain identity\[rq ] of this PTP instance.
34
34
Together with the \f[CR] domain \f[ R ] it identifies a domain.
35
35
.TP
36
+ \f[CR] slave \- only \f[ R ] = \f[I] bool \f[ R ] (\f[B] false \f[ R ] )
37
+ Forbids this instance to ever become a master on any port.
38
+ .TP
36
39
\f[CR] priority1 \f[ R ] = \f[I] priority \f[ R ] (\f[B] 128 \f[ R ] )
37
40
A tie breaker for the best master clock algorithm in the range
38
41
\f[CR] 0..256 \f[ R ] .
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ pub struct Config {
24
24
pub sdo_id : u16 ,
25
25
#[ serde( default = "default_domain" ) ]
26
26
pub domain : u8 ,
27
+ #[ serde( default = "default_slave_only" ) ]
28
+ pub slave_only : bool ,
27
29
#[ serde( default , deserialize_with = "deserialize_clock_identity" ) ]
28
30
pub identity : Option < ClockIdentity > ,
29
31
#[ serde( default = "default_priority1" ) ]
@@ -190,6 +192,10 @@ fn default_sdo_id() -> u16 {
190
192
0x000
191
193
}
192
194
195
+ fn default_slave_only ( ) -> bool {
196
+ false
197
+ }
198
+
193
199
fn default_announce_interval ( ) -> i8 {
194
200
1
195
201
}
@@ -281,6 +287,7 @@ interface = "enp0s31f6"
281
287
loglevel : LogLevel :: Info ,
282
288
sdo_id : 0x000 ,
283
289
domain : 0 ,
290
+ slave_only : false ,
284
291
identity : None ,
285
292
priority1 : 128 ,
286
293
priority2 : 128 ,
Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ async fn actual_main() {
268
268
priority_1 : config. priority1 ,
269
269
priority_2 : config. priority2 ,
270
270
domain_number : config. domain ,
271
- slave_only : false ,
271
+ slave_only : config . slave_only ,
272
272
sdo_id : SdoId :: try_from ( config. sdo_id ) . expect ( "sdo-id should be between 0 and 4095" ) ,
273
273
path_trace : config. path_trace ,
274
274
} ;
You can’t perform that action at this time.
0 commit comments