Digi LR54 User Manual page 748

Hide thumbs Also See for LR54:
Table of Contents

Advertisement

Applications
if __name__ == '__main__':
if len(sys.argv) > 1:
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. Select a device in Remote Manager that is configured to allow shell access to the admin user,
and click Actions > Open Console. Alternatively, log into the LR54 local 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.10.1 (default, May
[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:
LR54 User Guide
Releasing the LEDs to system control
9 2021, 22:49:59)
748

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tx64

Table of Contents