module:python:udpclientserver:udpclientserver02v03
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| module:python:udpclientserver:udpclientserver02v03 [2021/12/13 20:00] – [Hauptprogramm: CheckUdpClientServer.py] omdevelop | module:python:udpclientserver:udpclientserver02v03 [2022/09/13 11:58] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| ===== Benutzung ===== | ===== Benutzung ===== | ||
| - | + | PC-Python-Software: | |
| - | **...py** | + | {{: |
| - | < | + | |
| - | </ | + | |
| - | + | ||
| - | **...py** | + | |
| - | < | + | |
| - | </ | + | |
| - | + | ||
| - | **...py** | + | |
| - | < | + | |
| - | </ | + | |
| - | + | ||
| - | **...py** | + | |
| - | < | + | |
| - | </ | + | |
| Line 33: | Line 18: | ||
| ===== Hauptprogramm: | ===== Hauptprogramm: | ||
| <code python> | <code python> | ||
| + | # | ||
| + | # Syntax-Arguments: | ||
| + | # | ||
| + | # WindowsPC[192.168.178.33] <-> # WindowsPC[192.168.178.33]: | ||
| + | # WinPC: python CheckUdpClientServer.py Windows 4321 192.168.178.33 4321 | ||
| + | |||
| + | # WindowsPC[192.168.178.33] <-> UbuntuPC[192.168.178.48] | ||
| + | # WinPC: python CheckUdpClientServer.py Windows 5001 192.168.178.48 5000 | ||
| + | # LinPC: python CheckUdpClientServer.py Ubuntu | ||
| + | # | ||
| + | import sys | ||
| + | import time | ||
| + | import socket as SKT | ||
| + | # | ||
| + | import Thread as THR | ||
| + | import UdpClientServer as UCS | ||
| + | # | ||
| + | UDP_HEADERID = ' | ||
| + | # | ||
| + | # UDP - TxD - TransmitData | ||
| + | # | ||
| + | UDP_IPADDRESS_TX = ' | ||
| + | UDP_IPPORT_TX = 5001 | ||
| + | # | ||
| + | # | ||
| + | # UDP - RxD - ReceiveData | ||
| + | # | ||
| + | UDP_IPADDRESS_LOCAL = ' | ||
| + | UDP_IPPORT_RX = 5000 | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | def CBOnTxData(udpclientserver, | ||
| + | Line = ' | ||
| + | print(Line) | ||
| + | return | ||
| + | # | ||
| + | def CBOnRxData(udpclientserver, | ||
| + | Line = ' | ||
| + | print(Line) | ||
| + | return | ||
| + | # | ||
| + | def CBOnStart(udpclientserver): | ||
| + | # debug print(' | ||
| + | return | ||
| + | # | ||
| + | def CBOnBusy(udpclientserver): | ||
| + | # debug print(' | ||
| + | return | ||
| + | # | ||
| + | def CBOnAbort(udpclientserver): | ||
| + | # debug print(' | ||
| + | return | ||
| + | # | ||
| + | def CBOnEnd(udpclientserver): | ||
| + | # debug print(' | ||
| + | return | ||
| + | # | ||
| + | # | ||
| + | # Main | ||
| + | # | ||
| + | if (' | ||
| + | # | ||
| + | print(' | ||
| + | # if (5 <= len(sys.argv)): | ||
| + | # # Analyse Arguments für Tx/ | ||
| + | # | ||
| + | # # RX | ||
| + | # | ||
| + | # # TX | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | UdpCS = UCS.CUdpClientServer(UDP_HEADERID, | ||
| + | | ||
| + | | ||
| + | | ||
| + | # | ||
| + | print(' | ||
| + | | ||
| + | | ||
| + | print(' | ||
| + | | ||
| + | | ||
| + | UdpCS.Open() | ||
| + | while UdpCS.IsBusy(): | ||
| + | UdpCS.Transmit(' | ||
| + | time.sleep(3.0) | ||
| + | UdpCS.Close() | ||
| + | # | ||
| + | print(' | ||
| + | # | ||
| + | # | ||
| </ | </ | ||
| Line 154: | Line 233: | ||
| return | return | ||
| # | # | ||
| - | # | + | # |
| </ | </ | ||
| Line 206: | Line 285: | ||
| ===== Version ===== | ===== Version ===== | ||
| - | {{: | + | {{: |
| ----- | ----- | ||
module/python/udpclientserver/udpclientserver02v03.1639422015.txt.gz · Last modified: 2021/12/13 21:00 (external edit)