usb_moded
0.86.0+mer57
|
#include "usb_moded-control.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"
Go to the source code of this file.
Macros | |
#define | CONTROL_PENDING_USER_CHANGE_TIMEOUT (3000) |
Functions | |
uid_t | control_get_user_for_mode (void) |
void | control_set_user_for_mode (uid_t uid) |
const char * | control_get_selected_mode (void) |
void | control_set_selected_mode (const char *mode) |
bool | control_select_mode (const char *mode) |
const char * | control_get_usb_mode (void) |
void | control_user_changed (void) |
void | control_device_lock_changed (void) |
void | control_device_state_changed (void) |
void | control_settings_changed (void) |
void | control_init_done_changed (void) |
void | control_set_enabled (bool enable) |
void | control_set_cable_state (cable_state_t cable_state) |
cable_state_t | control_get_cable_state (void) |
bool | control_get_connection_state (void) |
Copyright (c) 2013 - 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-control.c.
#define CONTROL_PENDING_USER_CHANGE_TIMEOUT (3000) |
How long to wait for device lock after user change [ms]
If device lock code is in use, the wait time needs to be long enough to cover user session change and subsequent device locking (ballpark 500 ms) and reasonable amount of variance caused by slower devices etc.
If device lock code is not in use, the wait is not terminated by device lock status changes and thus the time needs to be short enough not to cause confusion at user end.
Definition at line 53 of file usb_moded-control.c.
void control_device_lock_changed | ( | void | ) |
React to device lock state changes
Definition at line 473 of file usb_moded-control.c.
void control_device_state_changed | ( | void | ) |
React to device state changes
Definition at line 486 of file usb_moded-control.c.
cable_state_t control_get_cable_state | ( | void | ) |
get the usb connection status
Definition at line 846 of file usb_moded-control.c.
bool control_get_connection_state | ( | void | ) |
Get if the cable (pc or charger) is connected or not
@ return true if connected, false if disconnected
Definition at line 864 of file usb_moded-control.c.
const char * control_get_selected_mode | ( | void | ) |
get mode selected by user
Definition at line 281 of file usb_moded-control.c.
const char * control_get_usb_mode | ( | void | ) |
uid_t control_get_user_for_mode | ( | void | ) |
Get uid of the user that set the current mode
Definition at line 157 of file usb_moded-control.c.
void control_init_done_changed | ( | void | ) |
React to init-done changes
Definition at line 505 of file usb_moded-control.c.
bool control_select_mode | ( | const char * | mode | ) |
handle mode request from client / udev trigger
mode | The requested USB mode |
Definition at line 307 of file usb_moded-control.c.
void control_set_cable_state | ( | cable_state_t | cable_state | ) |
set the usb connection status
cable_state | CABLE_STATE_DISCONNECTED, ... |
Definition at line 822 of file usb_moded-control.c.
void control_set_enabled | ( | bool | enable | ) |
Enable/disable mode changes
Definition at line 521 of file usb_moded-control.c.
void control_set_selected_mode | ( | const char * | mode | ) |
set mode selected by user
mode | selected mode, or NULL to reset selection |
Definition at line 291 of file usb_moded-control.c.
void control_set_user_for_mode | ( | uid_t | uid | ) |
Set the uid of the user that set the current mode
uid | of current user |
Definition at line 167 of file usb_moded-control.c.
void control_settings_changed | ( | void | ) |
React to settings changes
Definition at line 496 of file usb_moded-control.c.
void control_user_changed | ( | void | ) |
React to current user change
Definition at line 445 of file usb_moded-control.c.