Main Content

Target.ptpd

Target Computer PTP Daemon

Description

A Target.ptpd object represents the RTOS PTP daemon that runs on a target computer and provides access to methods and properties related to the PTP daemon.

The object provides access to methods and properties that:

  • Start and stop the PTP daemon.

  • Configure the PTP daemon startup command.

  • Enable auto start of the PTP daemon.

  • Retrieve status information about the PTP daemon.

Function names are case-sensitive. Type the entire name. Property names are not case-sensitive. You do not need to type the entire name if the characters you type are unique for the property.

Creation

A Target.ptpd object is created when you create a Target object by using the slrealtime command. After you create and connect to the Target object, you can access the Target.ptpd object. This example creates and connects to Target object tg, and then starts the PTP daemon on the target computer.

tg = slrealtime('TargetPC1');
connect(tg);
start(tg.ptpd);

Properties

expand all

When AutoStart is enabled, after the target computer boots, the RTOS PTP daemon starts by using the command specified in the Target.ptpd object Command property.

Example: 0

The default value for the Command property is a command string that starts the RTOS PTP daemon with enable multiple daemons (-L), devctl() support (-K), and slave (-g). To change from slave to master, stop the PTP daemon, change the command string, and start the PTP daemon. To enable hardware time stamp and achieve best master-slave clock synchronization, bind the PTP daemon to an Ethernet i210 interface by using the -b switch. For more information about PTP commands, see the QNX Neutrino documentation.

Example: 'ptpd -L -K -g'

Object Functions

startStart the PTP daemon on the target computer
stopStop the PTP daemon on the target computer
statusView the PTP daemon status on the target computer

Examples

collapse all

The Target.ptpd.Command and Target.ptpd.AutoStart properties configure operation of the PTP daemon.

Create a Target object and connect to the target computer. Creating a Target object creates a child Target.ptpd object. Connecting to the target computer provides access to the Target.ptpd object.

tg = slrealtime('TargetPC1');
connect(tg);

View the Target.ptpd object Command property value.

tg.ptpd.Command
ans =

    'ptpd -L -K -g'

View the Target.ptpd object AutoStart property value.

tg.ptpd.AutoStart
ans =

  logical

   0

Configure Target.ptpd object Command property value for master and AutoStart property value for auto start.

stop(tg.ptpd); % ensure that the daemon is stopped
tg.ptpd.Command = 'ptpd -L -K -G';
tg.ptpd.AutoStart = 1;
start(tg.ptpd); % start daemon with new values
Introduced in R2020b