usb_moded 0.86.0+mer64
|
#include <stdbool.h>
Go to the source code of this file.
Functions | |
void | appsync_switch_configuration (void) |
void | appsync_free_configuration (void) |
void | appsync_load_configuration (void) |
int | appsync_activate_pre (const char *mode) |
int | appsync_activate_post (const char *mode) |
int | appsync_mark_active (const char *name, int post) |
void | appsync_deactivate_pre (void) |
void | appsync_deactivate_post (void) |
void | appsync_deactivate_all (bool force) |
Copyright (c) 2010 Nokia Corporation. All rights reserved. Copyright (c) 2013 - 2020 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-appsync.h.
int appsync_activate_post | ( | const char * | mode | ) |
Activate post-enum applications for given mode
Starts all configured applications that have matching mode trigger and are scheduled to occur after usb enumeration.
mode | Name of usb-mode |
Definition at line 551 of file usb_moded-appsync.c.
int appsync_activate_pre | ( | const char * | mode | ) |
Activate pre-enum applications for given mode
Starts all configured applications that have matching mode trigger and are scheduled to occur before usb enumeration.
mode | Name of usb-mode |
Definition at line 426 of file usb_moded-appsync.c.
void appsync_deactivate_all | ( | bool | force | ) |
Stop all applications that (could) have been started by usb-moded
force | 0=started apps, 1=all configured apps |
Normally, when force=0 is used, this function is used on mode exit to stop applications that are known to have been started on mode entry.
Using force=1 param is mainly useful during usb-moded startup, as a way to cleanup applications that might have been left running as a concequence of for example usb-moded crash.
Definition at line 824 of file usb_moded-appsync.c.
void appsync_deactivate_post | ( | void | ) |
Stop all applications that were started in post-enum phase
Definition at line 806 of file usb_moded-appsync.c.
void appsync_deactivate_pre | ( | void | ) |
Stop all applications that were started in pre-enum phase
Definition at line 797 of file usb_moded-appsync.c.
void appsync_free_configuration | ( | void | ) |
Release appsync configuration data
Definition at line 347 of file usb_moded-appsync.c.
void appsync_load_configuration | ( | void | ) |
Load appsync configuration data
Appsync configuration files are read on usb-moded startup and whenever SIGHUP is sent to usb-moded.
Appsync configuration data is stateful and accessed both from worker and control threads. Due to this special care must be taken when configuration changes due to SIGHUP. Freshly loaded data is set aside and taken in use by calling appsync_switch_configuration() in an apprioriate time - presently when worker thread is executing mode transition and has cleaned up previously active usb mode.
Definition at line 380 of file usb_moded-appsync.c.
int appsync_mark_active | ( | const char * | name, |
int | post ) |
Set application state as successfully started
name | Application name |
post | 0=pre-enum app, or 1=post-enum app |
Update bookkeeping so that applications that are started when a mode is activated can be stopped when the mode is deactivated later on.
Note: If usb-moded is configured to use APP_SYNC_DBUS, usb enumeration actions are triggered when the last pre-enum app gets marked as active.
Definition at line 690 of file usb_moded-appsync.c.
void appsync_switch_configuration | ( | void | ) |
Take previously loaded appsync configuration in use
Definition at line 328 of file usb_moded-appsync.c.