Files
wlan-cloud-ucentralgw/test_scripts/python/rtty_2_7_test.py
2022-10-24 10:04:13 -07:00

19 lines
570 B
Python
Executable File

import socket
import ssl
GW_HOSTNAME = 'ucentral.dpaas.arilia.com'
# Open TCP Connection
soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
soc.connect((GW_HOSTNAME, 5912))
# SSL
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
context.check_hostname = False
context.verify_mode = ssl.VerifyMode.CERT_NONE
rtty_socket = context.wrap_socket(soc, server_hostname=GW_HOSTNAME)
# Message type register to trigger call to 'RTTYS_Device_ConnectionHandler::do_msgTypeRegister'
buffer = b'\x00\x01\x04\x06\x00\x00\x00'
rtty_socket.send(buffer)
rtty_socket.send(buffer)