added a lot of enums for SMP parameters
This commit is contained in:
@@ -13,18 +13,27 @@ pw = "123mzsmp"
|
||||
|
||||
|
||||
def print_tn(tn_response):
|
||||
"""
|
||||
Prints the given TN response, decoding it if necessary.
|
||||
|
||||
Args:
|
||||
tn_response (bytes or str): The TN response to print.
|
||||
|
||||
Returns:
|
||||
None
|
||||
"""
|
||||
if isinstance(tn_response, bytes):
|
||||
print(tn_response.decode("ascii").rstrip())
|
||||
else:
|
||||
print(str(tn_response).rstrip())
|
||||
|
||||
|
||||
def run_cmd(tn, cmd, timeout=1):
|
||||
tn.write(cmd)
|
||||
out = tn.read_until_non_empty_line()
|
||||
def run_cmd(telnet_con, cmd, _timeout=1):
|
||||
telnet_con.write(cmd)
|
||||
out = telnet_con.read_until_non_empty_line()
|
||||
res = out
|
||||
while out is not None and out != "":
|
||||
out = tn.read_until_non_empty_line()
|
||||
out = telnet_con.read_until_non_empty_line()
|
||||
print(out)
|
||||
res += out
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user