usb_moded 0.86.0+mer64
|
#include "usb_moded-common.h"
#include "usb_moded.h"
#include "usb_moded-config-private.h"
#include "usb_moded-dbus-private.h"
#include "usb_moded-log.h"
#include "usb_moded-modes.h"
#include "usb_moded-worker.h"
#include <sys/wait.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
Go to the source code of this file.
Data Structures | |
struct | modemapping_t |
Typedefs | |
typedef struct modemapping_t | modemapping_t |
Functions | |
void | common_send_supported_modes_signal (void) |
void | common_send_available_modes_signal (void) |
void | common_send_hidden_modes_signal (void) |
void | common_send_whitelisted_modes_signal (void) |
void | common_acquire_wakelock (const char *wakelock_name) |
void | common_release_wakelock (const char *wakelock_name) |
int | common_system_ (const char *file, int line, const char *func, const char *command) |
FILE * | common_popen_ (const char *file, int line, const char *func, const char *command, const char *type) |
bool | common_msleep_ (const char *file, int line, const char *func, unsigned msec) |
bool | common_modename_is_internal (const char *modename) |
bool | common_modename_is_static (const char *modename) |
int | common_valid_mode (const char *mode) |
gchar * | common_get_mode_list (mode_list_type_t type, uid_t uid) |
Copyright (c) 2010 Nokia Corporation. All rights reserved. Copyright (c) 2012 - 2021 Jolla Ltd. Copyright (c) 2020 Open Mobile Platform LLC.
This program is free software; you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the Lesser GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file usb_moded-common.c.
typedef struct modemapping_t modemapping_t |
Mapping usb mode from internal to hardware/broadcast use
void common_acquire_wakelock | ( | const char * | wakelock_name | ) |
Acquire wakelock via sysfs
Wakelock must be released via common_release_wakelock().
Automatically terminating wakelock is used, so that we do not block suspend indefinately in case usb_moded gets stuck or crashes.
Note: The name should be unique within the system.
wakelock_name | Wake lock to be acquired |
Definition at line 324 of file usb_moded-common.c.
gchar * common_get_mode_list | ( | mode_list_type_t | type, |
uid_t | uid ) |
make a list of all available usb modes
type | The type of list to return. Supported or available. |
uid | Uid of the process requesting the information; this is used to limit allowed modes, 0 returns all |
Definition at line 575 of file usb_moded-common.c.
bool common_modename_is_internal | ( | const char * | modename | ) |
Check if given usb mode is internal
modename | name of a more |
Definition at line 504 of file usb_moded-common.c.
bool common_modename_is_static | ( | const char * | modename | ) |
Check if given usb mode is static
modename | name of a more |
Definition at line 520 of file usb_moded-common.c.
bool common_msleep_ | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
unsigned | msec ) |
Wrapper to give visibility to blocking sleeps usb-moded is making
Definition at line 466 of file usb_moded-common.c.
FILE * common_popen_ | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
const char * | command, | ||
const char * | type ) |
Wrapper to give visibility subprocesses usb-moded is invoking via popen()
Definition at line 404 of file usb_moded-common.c.
void common_release_wakelock | ( | const char * | wakelock_name | ) |
Release wakelock via sysfs
wakelock_name | Wake lock to be released |
Definition at line 343 of file usb_moded-common.c.
void common_send_available_modes_signal | ( | void | ) |
Send available modes signal
Definition at line 241 of file usb_moded-common.c.
void common_send_hidden_modes_signal | ( | void | ) |
Send hidden modes signal
Definition at line 252 of file usb_moded-common.c.
void common_send_supported_modes_signal | ( | void | ) |
Send supported modes signal
Definition at line 230 of file usb_moded-common.c.
void common_send_whitelisted_modes_signal | ( | void | ) |
Send whitelisted modes signal
Definition at line 263 of file usb_moded-common.c.
int common_system_ | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
const char * | command ) |
Wrapper to give visibility to blocking system() calls usb-moded is making
Definition at line 361 of file usb_moded-common.c.
int common_valid_mode | ( | const char * | mode | ) |
check if a given usb_mode exists
mode | The mode to look for |
Definition at line 536 of file usb_moded-common.c.