diff --git a/.vscode/settings.json b/.vscode/settings.json index 33fe63f..3b6dbfc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,8 @@ { "python.linting.flake8Enabled": true, - "python.linting.enabled": true + "python.linting.enabled": true, + "python.analysis.extraPaths": [ + "./bridge/data", + "./bridge/data" + ] } \ No newline at end of file diff --git a/protocol/Arduino/protocol.cpp b/Sender protocols/Arduino/protocol.cpp similarity index 100% rename from protocol/Arduino/protocol.cpp rename to Sender protocols/Arduino/protocol.cpp diff --git a/protocol/Arduino/protocol.h b/Sender protocols/Arduino/protocol.h similarity index 100% rename from protocol/Arduino/protocol.h rename to Sender protocols/Arduino/protocol.h diff --git a/protocol/Arduino/protocol.ino b/Sender protocols/Arduino/protocol.ino similarity index 100% rename from protocol/Arduino/protocol.ino rename to Sender protocols/Arduino/protocol.ino diff --git a/Sender protocols/SocketProtocol.py b/Sender protocols/SocketProtocol.py new file mode 100644 index 0000000..1a67618 --- /dev/null +++ b/Sender protocols/SocketProtocol.py @@ -0,0 +1,28 @@ +from typing import Protocol +import protocol + + +class SocketCom: + """ + SocketCom is the single socket communication + """ + def __init__(self, remoteServer, port, beginTrigger=b'\xff', endTrigger=b'\xfe'): + inBuffer = Protocol(beginTrigger, endTrigger) + + +class ControllerFactory: + """ + It's our "Controller loop" in sockets. + It may be useful having a controller loop for the socket + communication too so that we can create SocketComs like a + factory pattern. + Why doing so? + If we need an high-throughput, we can + """ + + def __init__(self, remoteServer, portRange=[8000, 9000]): + """ + portRange is useful in case i want to decide on which ports + range i want my sockets to work on! + """ + pass diff --git a/bridge/handler/message_handler.py b/bridge/handler/message_handler.py index e6269b3..235400e 100644 --- a/bridge/handler/message_handler.py +++ b/bridge/handler/message_handler.py @@ -242,4 +242,4 @@ def write(self, bytesToSend, device_id=None): if __name__ == "__main__": hand = SocketHandler(None, 8080, "localhost") - SocketHandler.loop() + SocketHandler.loop() \ No newline at end of file