This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Minimal example: send and receive RS485 bytes over TCP via an Ethernet-to-RS485 | |
| // adapter (e.g. Waveshare). The adapter is transparent, bytes written to the TCP | |
| // socket go out on the RS485 bus, and bytes received on RS485 arrive via TCP. | |
| // | |
| // Build: g++-14 -std=c++23 -o tcp_example tcp_example.cpp | |
| // Usage: ./tcp_example 192.168.1.200 4196 | |
| #include <array> | |
| #include <cstdint> | |
| #include <cstdlib> |