Device Publishers

Device publishers are hardware-support components that publish information on attached devices through the
Persistent Publish/Subscribe (PPS) service. Applications use this information to access the content on devices
so they can display media information in browsers or invoke multimedia services to read metadata from those devices.

Applications could send commands to device drivers to read device information but this design requires developers to learn
hardware interfaces, which is inconvenient. Device publishers offer a reliable source of device information by allowing
applications to subscribe to PPS objects to receive device updates.
Refer to the Persistent Publish/Subscribe Developer's Guide for details on implementing a subscriber.

The information published for a device includes:

its raw device name

its mountpoint

the names and indexes of its partitions

connection information such as the bus number, device number, and slot number

Device publishers are designed for specific hardware types. We ship the following device publishers:

usblauncher, for USB storage devices

mmcsdpub, for MMC and SD cards

cdpub, for CDs

Note: The usblauncher service replaces usbpub and the other USB driver-related services
with a single service for monitoring USB devices and publishing their information.

Device publishers don't monitor the physical connection of devices. Other system services monitor hardware events and respond
when users attach or detach storage devices (e.g., USB sticks) or when they insert or remove mediastores
(e.g., SD cards) from physical slots. For instance, the io-usb server monitors the hardware and reacts
to each USB device attachment or detachment by notifying usblauncher.

The publishers run as persistent background processes. Typically, they're launched during bootup. You can restart publishers
if they unexpectedly terminate.

Running a device publisher
The PPS service must be running if you want to use the device publishers. All publishers write to objects in the same path; you must create the root directory in this path before starting any publisher.

Role of device drivers and mcd
Device drivers enable communication with attached devices by supporting system calls such as open(), read(), and write(). Publishers use these same system calls to obtain information from drivers on the devices that they manage. Another system service, mcd, uses the drivers to mount device filesystems.