Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review configuration interface #115

Closed
davidcemin opened this issue Oct 31, 2014 · 5 comments
Closed

Review configuration interface #115

davidcemin opened this issue Oct 31, 2014 · 5 comments

Comments

@davidcemin
Copy link
Contributor

Current configuration interface is done through switches upon gPTP initialization. Improve the current one to support more parameters.

Here the current configuration switches we have:
./daemon_cl [-S] [-P] [-M ] [-A ] [-G ] [-R <priority 1>]
-S start syntonization
-P pulse per second
-M save/restore state
-A initial accelerated sync count
-G group id for shared memory
-R <priority 1> priority 1 value
-T force master
-L force slave

We could embed that on a gPTP.cfg and read this file on its initialization. Eventually we will need more parameters, as for instance the phy delay, which currently has to be manually set on a define (and hence recompile the gPTP). Code below:

linux/src/linux_hal_generic.cpp:52:#define TX_PHY_TIME 184
linux/src/linux_hal_generic.cpp:53:#define RX_PHY_TIME 382
linux/src/linux_hal_generic.cpp:55://#define TX_PHY_TIME 8000
linux/src/linux_hal_generic.cpp:56://#define RX_PHY_TIME 8000

@andrew-elder
Copy link

Need more details David....

@davidcemin
Copy link
Contributor Author

Andrew, please take a look now.

@andrew-elder
Copy link

Thanks. .cfg file sounds like a good idea.

@andrew-elder
Copy link

Duplicate of #253

@davidcemin
Copy link
Contributor Author

If we put the default configuration from daemon_cl in a file called lets say gPTP.cfg, we would have something like below.

The idea would be starting the daemon using the file as another option, as for instance:

daemon_cl eth0 -f gPTP.cfg.

Default command line parameters

sintonize = true
pulse_per_second = false
accelerated_sync_count = 0
override_port_state = false
port_state = PTP_MASTER
priority1 = 248
restore_state = false
restore_state_file = restore.dat
ipc_groupname = ptp

PHY Ingress/Egress delay in nanoseconds

tx_phy_time = 184
rx_phy_time = 382

davidcemin pushed a commit to davidcemin/Open-AVB that referenced this issue Nov 10, 2015
The same idea used inside the avtp_pipeline was used here.
We are now adding the possibility to use a configuration (ini) file
to configure the internal variables of gptp.

Currently the following was added:
 - 3rd party ini file parser;
 - Class with callback to the parser
 - some options were added as an example to the gptp_cfg.ini file
 - all the current options are parsed inside linux/daemon_cl.cpp and printed out during init.

Still missing:
 - use the options from the file inside gPTP

Also, the linux daemon_cl.cpp was indented since there were several indenting problems
on the file.
@davidcemin davidcemin self-assigned this Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants