Applications
Use the Human Interface Device (HID) module
TX54 User Guide
716
dest = sys.argv[1]
else:
dest = '+15005550006'
my_callback = Callback(sms_test_callback, metadata=True)
send_sms(dest, 'Hello World!')
print("Please send an SMS message now.")
print("Execution halted until a message is received or 60 seconds have
passed.")
# acquire the semaphore and wait until a callback occurs
COND.acquire()
try:
COND.wait(60.0)
except Exception as err:
print("exception occured while waiting")
print(err)
COND.release()
my_callback.unregister_callback()
Use the Human Interface Device (HID) module
The Python
hid
module provides a programmatic access to a USB Human Interface Device (HID) from
within a Python script.
For example, to determine information about a USB-connected keyboard:
1. Log into the TX54 command line as a user with shell access.
Depending on your device configuration, you may be presented with an
Access selection
menu
. Type
shell
to access the device shell.
2. At the shell prompt, use the
python
command with no parameters to enter an interactive
Python session:
# python
Python 3.6.13 (default, May
9 2021, 22:49:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
3. Import the
hid
module:
>>> import hid
>>>
4. Use the enumerate() function to return information about the keyboard:
>>> hid.enumerate()
This returns the following:
[{'path': b'/dev/hidraw0', 'vendor_id': 1008, 'product_id': 36, 'serial_
number': '', 'release_number': 768,
'manufacturer_string': 'CHICONY', 'product_string': 'Basic USB Keyboard',
'usage_page': 18432, 'usage': 17481,
'interface_number': 0}]
Содержание TX54
Страница 1: ...TX54 User Guide Firmware version 22 2 ...
Страница 190: ...Interfaces Bridging TX54 User Guide 190 ...
Страница 293: ...Hotspot Hotspot configuration TX54 User Guide 293 ...
Страница 332: ...Hotspot Show hotspot status and statistics TX54 User Guide 332 ...
Страница 584: ...Services Simple Network Management Protocol SNMP TX54 User Guide 584 4 Click Download ...
Страница 1069: ...Command line interface Command line reference TX54 User Guide 1069 reboot Reboot the system Parameters None ...