Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Gm.device_tree_get_compatibles(sysfs_root)¶
- Parameters:
sysfs_root (
str) – Path where /sys is mounted. Defaults to/sysifNoneis passed.- Raises:
- Returns:
compatible machine types or
None- Return type:
[
str]
Read compatible machine types from
sysfs_root/firmware/devicetree/base/compatibleon Linux. If the path doesn’t exist or host is not Linux returnNone.For debugging purposes
GMOBILE_DT_COMPATIBLEScan be set to a:separated list of compatibles which will be returned instead.Added in version 0.0.1.
- Gm.error_quark()¶
- Returns:
a #GQuark.
- Return type:
Gets the GM Error Quark.
Added in version 0.0.1.
- Gm.init()¶
Call this function to initialize the library explicitly. This makes the embedded device information available.
Added in version 0.0.1.
- Gm.list_devices()¶
-
List device tree names of known devices.
Added in version 0.2.2.
- Gm.mcc_to_iso(mcc)¶
-
Get the ISO 3316-1 country code based on a given mobile country code (MCC). It’s sufficient for the given string to have the MCC as prefix. In other words it is o.k. to pass an IMSI.
On error
NULLis returned anderroris set.Added in version 0.4.0.
- Gm.svg_path_get_bounding_box(path, x1, x2, y1, y2)¶
- Parameters:
- Raises:
- Returns:
TRUEwhen parsing was successful,FALSEotherwise.See https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths for path syntax introduction.
- Return type:
Returns the bounding box of an SVG path. As this is meant for display cutouts we operate on integer (whole pixel) values. When parsing fails,
FALSEis returned anderrorcontains the error information.Added in version 0.0.1.
- Gm.timeout_add_seconds_once(priority, seconds, function, *data)¶
- Parameters:
priority (
int) – the priority of the timeout source. Typically this will be in the range betweenGLib.PRIORITY_DEFAULTandGLib.PRIORITY_HIGH.seconds (
int) – the timeout in secondsfunction (
GLib.SourceOnceFunc) – function to call
- Returns:
the ID (greater than 0) of the event source or 0 in case of error.
- Return type:
Sets a function to be called after a timeout with priority priority. Correctly calculates the timeout even when the system is suspended in between.
The timeout given is in terms of
CLOCK_BOOTTIMEtime, it hence is also correct across suspend and resume. If that doesn’t matter useg_timeout_add_seconds_fullinstead.Note that glib’s
g_timeout_add_seconds()doesn’t take system suspend/resume into account: https://gitlab.gnome.org/GNOME/glib/-/issues/2739Changed in 0.3.0: Returns 0 when timer setup failed
Added in version 0.0.1.
- Gm.wakeup_timeout_add_seconds_once(priority, seconds, function, *data)¶
- Parameters:
priority (
int) – the priority of the timeout source. Typically this will be in the range betweenGLib.PRIORITY_DEFAULTandGLib.PRIORITY_HIGH.seconds (
int) – the timeout in secondsfunction (
GLib.SourceOnceFunc) – function to call
- Raises:
- Returns:
the ID (greater than 0) of the event source or 0 in case of error.
- Return type:
Sets a function to be called after a timeout with the default priority,
GLib.PRIORITY_DEFAULT. Correctly calculates the timeout even when the system is suspended in between. It will wake up the system when needed.If the process doesn’t have enough permissions to wake the system creating the timer will fail. On Linux at least
CAP_WAKE_ALARMcapabilities are needed.The timeout given is in terms of
CLOCK_BOOTTIME_ALARMtime, it hence is also correct across suspend and resume. If that doesn’t matter useg_timeout_add_secondsinstead.Note that glib’s
g_timeout_add_seconds()doesn’t take system suspend/resume into account: https://gitlab.gnome.org/GNOME/glib/-/issues/2739Added in version 0.3.0.