Kapitel 15 GPIO
This commit is contained in:
3
teil15/network/__init__.py
Normal file
3
teil15/network/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .const import __ADDRESSLOCAL__
|
||||
#from .const import __ADDRESSREMOTE__
|
||||
|
BIN
teil15/network/__pycache__/__init__.cpython-39.pyc
Normal file
BIN
teil15/network/__pycache__/__init__.cpython-39.pyc
Normal file
Binary file not shown.
BIN
teil15/network/__pycache__/const.cpython-39.pyc
Normal file
BIN
teil15/network/__pycache__/const.cpython-39.pyc
Normal file
Binary file not shown.
10
teil15/network/code.py
Normal file
10
teil15/network/code.py
Normal file
@@ -0,0 +1,10 @@
|
||||
def receive(conn):
|
||||
msg = conn.recv(64).decode('utf-8')
|
||||
|
||||
return msg
|
||||
|
||||
def send(client, msg):
|
||||
message = msg.encode('utf-8')
|
||||
client.send(message)
|
||||
|
||||
|
19
teil15/network/const.py
Normal file
19
teil15/network/const.py
Normal file
@@ -0,0 +1,19 @@
|
||||
#network/const.py
|
||||
|
||||
import socket
|
||||
|
||||
# TCP Port
|
||||
__PORT__ = 6554
|
||||
|
||||
#Server-IP
|
||||
# für den Server (immer localhost)
|
||||
__SERVERLOCAL__ = socket.gethostbyname(socket.gethostname())
|
||||
|
||||
#für Server auf einem Remote-Pi
|
||||
#__SERVERREMOTE__ = socket.gethostbyname('gabbo')
|
||||
|
||||
# Server-Adresse (IP,Port)
|
||||
#lokal
|
||||
__ADDRESSLOCAL__ = (__SERVERLOCAL__,__PORT__)
|
||||
#remote
|
||||
#__ADDRESSREMOTE__ = (__SERVERREMOTE__,__PORT__)
|
Reference in New Issue
Block a user