OpenCPN Partial API docs
linux_devices.h File Reference

Low level udev usb device management. More...

#include "config.h"

Go to the source code of this file.

Functions

bool IsDonglePermissionsWrong ()
 Return true if an existing dongle cannot be accessed.
 
bool IsDevicePermissionsOk (const char *path)
 Check device path permissions. More...
 
std::string GetDongleRule ()
 
std::string MakeUdevLink ()
 Get next available udev rule base name. More...
 
std::string GetDeviceRule (const char *device, const char *symlink)
 Get device udev rule. More...
 

Detailed Description

Low level udev usb device management.

Definition in file linux_devices.h.

Function Documentation

◆ GetDeviceRule()

std::string GetDeviceRule ( const char *  device,
const char *  symlink 
)

Get device udev rule.

Parameters
deviceComplete device path
symlinkAs returned by MakeUdevLink()
Returns
udev rule which makes the device public read/write (0666)

Definition at line 301 of file linux_devices.cpp.

◆ GetDongleRule()

std::string GetDongleRule ( )
Returns
udev rule which makes the dongle public read write (666)

Definition at line 289 of file linux_devices.cpp.

◆ IsDevicePermissionsOk()

bool IsDevicePermissionsOk ( const char *  path)

Check device path permissions.

Parameters
pathcomplete device path
Returns
True if device is exposing read/write permissions.

Definition at line 156 of file linux_devices.cpp.

◆ MakeUdevLink()

std::string MakeUdevLink ( )

Get next available udev rule base name.

Returns
first name not used in the sequence opencpn0..opencpn9

Definition at line 244 of file linux_devices.cpp.