tree: c43b695ec61059c6ddfa05d54ae61d1bc03da45e [path history] [tgz]
  1. dbus_bindings/
  2. share/
  3. cec_device.cc
  4. cec_device.h
  5. cec_device_mock.h
  6. cec_device_unittest.cc
  7. cec_fd.cc
  8. cec_fd.h
  9. cec_fd_mock.h
  10. cec_manager.cc
  11. cec_manager.h
  12. cec_manager_unittest.cc
  13. cecservice.gyp
  14. cecservice_dbus_adaptor.cc
  15. cecservice_dbus_adaptor.h
  16. main.cc
  17. OWNERS
  18. README.md
  19. udev.cc
  20. udev.h
  21. udev_mock.h
cecservice/README.md

cecservice

About

cecservice is a system service allowing its clients to put CEC enabled TVs in and out of standby mode.

D-Bus API

The service exposes a D-Bus API consisting of following functions:

  • SendWakeUpToAllDevices - wakes up all TVs, putting them out of standby and announces the device running this service as an active source.
  • SendStandByToAllDevices - puts all TVs on standby.
  • GetTvsPowerStatus - returns power status of TVs (devices with logical address 0) on all connected CEC adapters.

Implementation

cecservice uses the Linux CEC API to interact with CEC adapters present on the device. It assumes exclusive ownership of /dev/cecX device nodes and keeps all of them open at all times. The service uses libudev to keep track of CEC devices as they come and go.

When the client invokes the SendWakeUpToAllDevices method on the service, the service sends a Image View On request to devices with logical address 0 on all present /dev/cecX adapters. Following that, an Active Source message is sent, announcing the device to be an active source.

Similarly, when SendWakeUpToAllDevices is called, the service sends a StandBy request to devices with logical address 0 on all CEC adapters.

After the SendWakeUpToAllDevices is called the service will assume an active source role. While being an active source it will respond to Request Active Source requests and will continue doing so until either another CEC device announces itself as an active source or the SendStandByToAllDevice is called.

GetTvsPowerStatus sends give device power status request on all adapters. This method returns array of integers, each integer describing power state of a TV connected to an adapter. The meaning of the values is explained in the service system API definition.

Supported adapters / limitations

The service only works with CEC adapters which drivers handle physical address configuration on their own and which allow userland to configure logical addresses.