Module device.generic.device
Generic device abstraction.
This module defines stubs for common methods.
Functions
Device:performHapticFeedback (type) | Device specific method for performing haptic feedback. |
Device:canExecuteScript (filename) | Returns true if the file is a script we allow running Basically a helper method to check a specific list of file extensions for executable scripts |
Device:unpackArchive (archive, extract_to, with_stripped_root) | Unpack an archive. |
Issues
Device:performHapticFeedback-todo2 | : Build an IPv6 variant of getDefaultRoute that parses /proc/net/ipv6_route |
Functions
- Device:performHapticFeedback (type)
-
Device specific method for performing haptic feedback.
Parameters:
- type string Type of haptic feedback. See https://developer.android.com/reference/android/view/HapticFeedbackConstants.html.
- Device:canExecuteScript (filename)
-
Returns true if the file is a script we allow running
Basically a helper method to check a specific list of file extensions for executable scripts
Parameters:
- filename string
Returns:
-
boolean
- Device:unpackArchive (archive, extract_to, with_stripped_root)
-
Unpack an archive.
Extract the contents of an archive, detecting its format by
filename extension. Inspired by luarocks archive_unpack()
Parameters:
- archive string: Filename of archive.
- extract_to string: Destination directory.
- with_stripped_root boolean: true if root directory in archive should be stripped
Returns:
-
boolean or (boolean, string): true on success, false and an error message on failure.