更新MINI的固件,包括(绘制指针,网络SSL,DS18X20,知心,BLE-NOT)

This commit is contained in:
dahanzimin
2024-09-27 21:45:58 +08:00
parent 1d2957442b
commit 284d8150c0
11 changed files with 631 additions and 152 deletions

View File

@@ -43,7 +43,7 @@ def request(method, url, data=None, json=None, headers={}, stream=None, parse_he
if proto == "http:":
port = 80
elif proto == "https:":
import ussl
import ssl
port = 443
else:
raise ValueError("Unsupported protocol: " + proto)
@@ -63,7 +63,7 @@ def request(method, url, data=None, json=None, headers={}, stream=None, parse_he
try:
s.connect(ai[-1])
if proto == "https:":
s = ussl.wrap_socket(s, server_hostname=host)
s = ssl.wrap_socket(s, server_hostname=host)
s.write(b"%s /%s HTTP/1.0\r\n" % (method, path))
if not "Host" in headers:
s.write(b"Host: %s\r\n" % host)