mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-16 08:42:06 +02:00
Fix Typo
This commit is contained in:
@ -127,7 +127,7 @@ RESPONSES_STRUCT responses[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void text(uint8_t * payload, size_t length){
|
void text(uint8_t * payload, size_t length){
|
||||||
// Convert mesage to something usable
|
// Convert message to something usable
|
||||||
char msgch[length];
|
char msgch[length];
|
||||||
for (unsigned int i = 0; i < length; i++)
|
for (unsigned int i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +79,7 @@ def version_checker(name, vdev, vapp):
|
|||||||
class WsOtaHandler (threading.Thread):
|
class WsOtaHandler (threading.Thread):
|
||||||
"""Thread handling ota update
|
"""Thread handling ota update
|
||||||
|
|
||||||
Runing ota directly from message would kill WS
|
Running ota directly from message would kill WS
|
||||||
as message bus would timeout.
|
as message bus would timeout.
|
||||||
"""
|
"""
|
||||||
def __init__(self, name, message, websocket):
|
def __init__(self, name, message, websocket):
|
||||||
@ -177,7 +177,7 @@ async def _state(websocket, message):
|
|||||||
await websocket.send(json.dumps(response))
|
await websocket.send(json.dumps(response))
|
||||||
|
|
||||||
|
|
||||||
async def _unhandleld(websocket, msg):
|
async def _unhandled(websocket, msg):
|
||||||
Logger.info("Unhandled message from device: %s", str(msg))
|
Logger.info("Unhandled message from device: %s", str(msg))
|
||||||
response = {'type': 'response', 'state': 'nok'}
|
response = {'type': 'response', 'state': 'nok'}
|
||||||
await websocket.send(json.dumps(response))
|
await websocket.send(json.dumps(response))
|
||||||
@ -206,7 +206,7 @@ async def message_received(websocket, message) -> None:
|
|||||||
|
|
||||||
type_ = msg_json.get('type')
|
type_ = msg_json.get('type')
|
||||||
name = msg_json.get('name')
|
name = msg_json.get('name')
|
||||||
func = switcher.get(type_, _unhandleld)
|
func = switcher.get(type_, _unhandled)
|
||||||
Logger.debug("Client(%s)said: %s", name, type_)
|
Logger.debug("Client(%s)said: %s", name, type_)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -225,7 +225,7 @@ async def ws_server(websocket, path) -> None:
|
|||||||
async def main():
|
async def main():
|
||||||
"""Server starter
|
"""Server starter
|
||||||
|
|
||||||
Normal user can bind only port nubers greater than 1024
|
Normal user can bind only port numbers greater than 1024
|
||||||
"""
|
"""
|
||||||
async with websockets.serve(ws_server, "10.0.1.5", 8081):
|
async with websockets.serve(ws_server, "10.0.1.5", 8081):
|
||||||
await asyncio.Future() # run forever
|
await asyncio.Future() # run forever
|
||||||
|
Reference in New Issue
Block a user