Re: [Linuxptp-users] How do I use "slave_event_monitor" to get the management info(such as offset,
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: <957...@qq...> - 2022-06-20 03:59:20
|
Thanks for your quick reply. Q1.I have known the monitor socket should be created by the mointor, like PMC. ptp4l --slave_event_monitor=/tmp/foo pmc -u -i /tmp/foo The ptp4l don't need to create a socket fd bind the slave_event_monitor address, so how it send message to the local address? It use the API raw_send() to achieve send the message to the fd to PMC client? Socket created only in PMC, is it? I'm now using v3.1, port.c line 1298 is not the implementation code. Which version should I see. Q2. How can I subscribe to receive PORT_DATA_SET TIME_STATUS_NP via the push method? Could you help me some example and guidance? Thanks a lot. ------------------ Original ------------------ From: "Richard Cochran";<ric...@gm...>; Send time: Monday, Jun 20, 2022 5:22 AM To: "这个🍊 不太冷"<957...@qq...>; Cc: "linuxptp-users"<lin...@li...>; Subject: Re: [Linuxptp-users] How do I use "slave_event_monitor" to get the management info(such as offset, delay, master time) which should from PMC. On Mon, Jun 20, 2022 at 12:23:02AM +0800, 这个🍊 不太冷 via Linuxptp-users wrote: > Q1. How do I use the this configuration item “slave_event_monitor”? > But I can not understand how it communicate with the > ptp4l, I do not see the code about ptp4l send message to the > monitor. According to my previous understanding, ptp4l send > SLAVE_RX_SYNC_TIMING_DATA and SLAVE_DELAY_TIMING_DATA_NP TLVs to the > client bind to the slave_event_monitor address, is it? > Where is it's Implementation process? I just see the > monitor_create(). See port.c line 1298. > Q2. Any other way to get the management information(such as master, offset, delay) without using PMC? You don't have to use the pmc program. You can use any program that implements the IEEE 1588 management message protocol. > Now I can use PMC send command "GET TIME_STATUS_NP" and "GET > PORT_DATA_SET" to ptp4l uds_address get messages. It's no problem. > But I notice every time I need to active the call and ptp4l poll() > every port to process message, it will cause some reply delay and I > have to wait to get it's response. I wonder if there is any other > way to let ptp4l active send "TIME_STATUS_NP" "PORT_DATA_SET" tlvs > to user program(e.x. Every time ptp4l( run as slave) complete time > sync, send the master time, offset, delay to user, user can get it > any time they want)? Maybe can achieved through the question 1? You can subscribe to receive PORT_DATA_SET TIME_STATUS_NP via the push method. No need to poll by sending requests. HTH, Richard |