config: convert 'clockAccuracy' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
a71ecc2816
commit
4e27856c8b
7
config.c
7
config.c
|
@ -95,6 +95,7 @@ struct config_item config_tab[] = {
|
||||||
GLOB_ITEM_INT("assume_two_step", 0, 0, 1),
|
GLOB_ITEM_INT("assume_two_step", 0, 0, 1),
|
||||||
PORT_ITEM_INT("boundary_clock_jbod", 0, 0, 1),
|
PORT_ITEM_INT("boundary_clock_jbod", 0, 0, 1),
|
||||||
GLOB_ITEM_INT("check_fup_sync", 0, 0, 1),
|
GLOB_ITEM_INT("check_fup_sync", 0, 0, 1),
|
||||||
|
GLOB_ITEM_INT("clockAccuracy", 0xfe, 0, UINT8_MAX),
|
||||||
GLOB_ITEM_INT("clockClass", 248, 0, UINT8_MAX),
|
GLOB_ITEM_INT("clockClass", 248, 0, UINT8_MAX),
|
||||||
PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX),
|
PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX),
|
||||||
PORT_ITEM_INT("delay_filter_length", 10, 1, INT_MAX),
|
PORT_ITEM_INT("delay_filter_length", 10, 1, INT_MAX),
|
||||||
|
@ -405,12 +406,6 @@ static enum parser_result parse_global_setting(const char *option,
|
||||||
return r;
|
return r;
|
||||||
dds->domainNumber = uval;
|
dds->domainNumber = uval;
|
||||||
|
|
||||||
} else if (!strcmp(option, "clockAccuracy")) {
|
|
||||||
r = get_ranged_uint(value, &uval, 0, UINT8_MAX);
|
|
||||||
if (r != PARSED_OK)
|
|
||||||
return r;
|
|
||||||
dds->clockQuality.clockAccuracy = uval;
|
|
||||||
|
|
||||||
} else if (!strcmp(option, "offsetScaledLogVariance")) {
|
} else if (!strcmp(option, "offsetScaledLogVariance")) {
|
||||||
r = get_ranged_uint(value, &uval, 0, UINT16_MAX);
|
r = get_ranged_uint(value, &uval, 0, UINT16_MAX);
|
||||||
if (r != PARSED_OK)
|
if (r != PARSED_OK)
|
||||||
|
|
2
ptp4l.c
2
ptp4l.c
|
@ -44,7 +44,6 @@ static struct config cfg_settings = {
|
||||||
|
|
||||||
.dds = {
|
.dds = {
|
||||||
.dds = {
|
.dds = {
|
||||||
.clockQuality.clockAccuracy = 0xfe,
|
|
||||||
.clockQuality.offsetScaledLogVariance = 0xffff,
|
.clockQuality.offsetScaledLogVariance = 0xffff,
|
||||||
.domainNumber = 0,
|
.domainNumber = 0,
|
||||||
},
|
},
|
||||||
|
@ -223,6 +222,7 @@ int main(int argc, char *argv[])
|
||||||
sk_tx_timeout = config_get_int(cfg, NULL, "tx_timestamp_timeout");
|
sk_tx_timeout = config_get_int(cfg, NULL, "tx_timestamp_timeout");
|
||||||
|
|
||||||
ds->clockQuality.clockClass = config_get_int(cfg, NULL, "clockClass");
|
ds->clockQuality.clockClass = config_get_int(cfg, NULL, "clockClass");
|
||||||
|
ds->clockQuality.clockAccuracy = config_get_int(cfg, NULL, "clockAccuracy");
|
||||||
|
|
||||||
if (config_get_int(cfg, NULL, "slaveOnly")) {
|
if (config_get_int(cfg, NULL, "slaveOnly")) {
|
||||||
ds->flags |= DDS_SLAVE_ONLY;
|
ds->flags |= DDS_SLAVE_ONLY;
|
||||||
|
|
Loading…
Reference in New Issue