Go to the documentation of this file.
27 #ifndef USB_MODED_COMMON_H_
28 # define USB_MODED_COMMON_H_
50 CABLE_STATE_DISCONNECTED,
51 CABLE_STATE_CHARGER_CONNECTED,
52 CABLE_STATE_PC_CONNECTED,
56 typedef enum waitres_t
71 const char *cable_state_repr(cable_state_t state);
77 const char *common_map_mode_to_hardware (
const char *internal_mode);
78 const char *common_map_mode_to_external (
const char *internal_mode);
85 int common_system_ (
const char *file,
int line,
const char *func,
const char *command);
86 FILE *
common_popen_ (
const char *file,
int line,
const char *func,
const char *command,
const char *type);
87 waitres_t common_wait (
unsigned tot_ms,
bool (*ready_cb)(
void *aptr),
void *aptr);
88 bool common_msleep_ (
const char *file,
int line,
const char *func,
unsigned msec);
98 # define common_system(command) common_system_(__FILE__,__LINE__,__FUNCTION__,(command))
99 # define common_popen(command, type) common_popen_(__FILE__,__LINE__,__FUNCTION__,(command),(type))
100 # define common_msleep(msec) common_msleep_(__FILE__,__LINE__,__FUNCTION__,(msec))
101 # define common_sleep(sec) common_msleep_(__FILE__,__LINE__,__FUNCTION__,(sec)*1000)
106 # define UID_UNKNOWN ((uid_t)-1)
void common_acquire_wakelock(const char *wakelock_name)
void common_send_hidden_modes_signal(void)
FILE * common_popen_(const char *file, int line, const char *func, const char *command, const char *type)
void common_send_available_modes_signal(void)
int common_valid_mode(const char *mode)
bool common_modename_is_internal(const char *modename)
bool common_modename_is_static(const char *modename)
void common_release_wakelock(const char *wakelock_name)
gchar * common_get_mode_list(mode_list_type_t type, uid_t uid)
int common_system_(const char *file, int line, const char *func, const char *command)
void common_send_supported_modes_signal(void)
bool common_msleep_(const char *file, int line, const char *func, unsigned msec)
void common_send_whitelisted_modes_signal(void)