udev: define all generic tags as symbols

This prevents errors due to nasty typos in the strings.

We define all symbols in a single header file that is NOT considered
part of the API, as there is no need for MM clients to know about
these tags code-wise. These tags are only meaningful when associated
to devices in udev.

Information of each tag is included in the general API documentation.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/88
This commit is contained in:
Aleksander Morgado
2018-09-13 11:47:10 +02:00
committed by Dan Williams
parent a2705abb24
commit 2a1a0b88fb
10 changed files with 273 additions and 24 deletions

View File

@@ -30,6 +30,8 @@
#include "mm-kernel-device-generic.h"
#include <ModemManager.h>
#include <ModemManager-tags.h>
#include <mm-errors-types.h>
#include <mm-gdbus-manager.h>
#include <mm-gdbus-test.h>
@@ -303,8 +305,8 @@ device_added (MMBaseManager *manager,
*
* This udev tag applies to each port in a device. In other words, the flag
* may be set in some ports, but not in others */
if (!mm_kernel_device_get_property_as_boolean (port, "ID_MM_CANDIDATE")) {
/* This could mean that device changed, losing its ID_MM_CANDIDATE
if (!mm_kernel_device_get_property_as_boolean (port, ID_MM_CANDIDATE)) {
/* This could mean that device changed, losing its candidate
* flags (such as Bluetooth RFCOMM devices upon disconnect.
* Try to forget it. */
device_removed (manager, port);