DeviceDetector¶
-
class
sitchlib.
DeviceDetector
[source]¶ Interrogate all USB TTY ports.
-
gsm_radios
¶ list – This is a list of GSM radios, represented in dict type objects.
-
gps_devices
¶ list – This is a list of GPS devices. Just strings like ‘/dev/ttyUSB0’.
-
classmethod
find_gps_radios
(usbtty_ports)[source]¶ Interrogate USB TTY ports, return a list of GPS devices.
-
classmethod
get_gsm_modem_info
(port)[source]¶ Get modem information.
Parameters: port (str) – Device/port to interrogate. Returns: - metadata describing modem manufacturer, model, revision,
- and serial.
Return type: dict
-
classmethod
interrogate_gsm_modem
(port, command)[source]¶ Issue command on port, return output.
Parameters: - port (str) – Port/device to interrogate.
- commmand (str) – Command to be issued.
Returns: - Response from device, if any. If none, returns an empty
string.
Return type: str
-
classmethod
interrogator
(match_list, port, test_command=None)[source]¶ Interrogate serial port, and attempt to match output.
Parameters: - match_list (list) – List of strings that positively identify a device of a specific type.
- port (str) – Port to be interrogated.
- test_command (str) – Command to trigger output to match against match_list.
Returns: True if the device is a positive match, False if not.
Return type: bool
-