To publish to a PPS object, a publisher simply calls open() for the object file with O_WRONLY to publish only, or O_RDWR to publish and subscribe. The publisher can then call write() to modify the object's attributes. This operation is non-blocking.
You can create, modify, and delete objects and attributes:
sprintf( ppsobj, "-url\n" ); // Delete the "url" attribute write( ppsobj-fd, ppsobj, strlen( ppsobj ) );
Note the following about deleting attributes:
|
PPS supports multiple publishers that publish to the same PPS object. This capability is required because different publishers may have access to data which applies to different attributes for the same object.
In a multimedia system, for instance, io-media may be the source of a time::value attribute, while the HMI may be the source of a duration::value attribute. A publisher that changes only the time attribute will update only that attribute when it writes to the object. It will leave the other attributes unchanged. For example, in the following pseudocode:
write() PlayCurrent::1.24