libcamera v0.5.1 Supporting cameras in Linux since 2019 |

Loading...
Searching...
No Matches
Namespaces | Functions
sysfs.h File Reference

Miscellaneous utility functions to access sysfs. More...

`#include <string>`
Include dependency graph for sysfs.h:

Go to the source code of this file.

## Namespaces
namespace | libcamera
| Top-level libcamera namespace.

## Functions
std::string | libcamera::sysfs::charDevPath (const std::string &deviceNode)
| Retrieve the sysfs path for a character device.
std::string | libcamera::sysfs::firmwareNodePath (const std::string &device)
| Retrieve the path of the firmware node for a device.

## Detailed Description

Miscellaneous utility functions to access sysfs.

## Function Documentation

## ◆ charDevPath()

std::string libcamera::sysfs::charDevPath | ( | const std::string & | deviceNode | ) |

Retrieve the sysfs path for a character device.

Parameters

  [in] | deviceNode | Path to character device node

Returns
  The sysfs path on success or an empty string on failure

## ◆ firmwareNodePath()

std::string libcamera::sysfs::firmwareNodePath | ( | const std::string & | device | ) |

Retrieve the path of the firmware node for a device.

Parameters

  [in] | device | Path in sysfs to search

Physical devices in a system are described by the system firmware. Depending on the type of platform, devices are identified using different naming schemes. The Linux kernel abstract those differences with "firmware nodes". This function retrieves the firmware node path corresponding to the device.

For DT-based systems, the path is the full name of the DT node that represents the device. For ACPI-based systems, the path is the absolute namespace path to the ACPI object that represents the device. In both cases, the path is guaranteed to be unique and persistent as long as the system firmware is not modified.

Returns
  The firmware node path on success or an empty string on failure