Signed-off-by: Peter Schneider <[email protected]>
---
phc2sys.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/phc2sys.c b/phc2sys.c
index 5c54055..c2f0d8e 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -1286,6 +1286,7 @@ static void usage(char *progname)
" -O [offset] slave-master time offset (0)\n"
" -w wait for ptp4l\n"
" common options:\n"
+ " -f [file] configuration file\n"
" -E [pi|linreg] clock servo (pi)\n"
" -P [kp] proportional constant (0.7)\n"
" -I [ki] integration constant (0.3)\n"
@@ -1312,6 +1313,7 @@ static void usage(char *progname)
int main(int argc, char *argv[])
{
char *progname, *message_tag = NULL;
+ char *config = NULL;
char *src_name = NULL, *dst_name = NULL;
struct clock *src, *dst;
struct config *cfg;
@@ -1343,7 +1345,7 @@ int main(int argc, char *argv[])
progname = strrchr(argv[0], '/');
progname = progname ? 1+progname : argv[0];
while (EOF != (c = getopt(argc, argv,
-
"arc:d:s:E:P:I:S:F:R:N:O:L:M:i:u:wn:xz:l:t:mqvh"))) {
+
"arc:d:f:s:E:P:I:S:F:R:N:O:L:M:i:u:wn:xz:l:t:mqvh"))) {
switch (c) {
case 'a':
autocfg = 1;
@@ -1362,6 +1364,9 @@ int main(int argc, char *argv[])
goto end;
}
break;
+ case 'f':
+ config = optarg;
+ break;
case 'i':
fprintf(stderr,
"'-i' has been deprecated. please use '-s'
instead.\n");
@@ -1477,6 +1482,10 @@ int main(int argc, char *argv[])
}
}
+ if (config && (c = config_read(config, cfg))) {
+ return c;
+ }
+
if (autocfg && (src_name || dst_name || pps_fd >= 0 || wait_sync ||
node.forced_sync_offset)) {
fprintf(stderr,
"autoconfiguration cannot be mixed with manual config
options.\n");
--
2.14.3
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel