RTC6 boards
Doc. Rev. 1.0.21 en-US
16 Appendix A: The RTC6 Ethernet Board
921
To Use C++ Remote Interface Wrapper:
(1) Create a derived class of NetworkAdapter.
(2) Create a datagram socket (UDP) with the
IP address of the desired RTC6 Ethernet Board
and port 63750
(1)
.
(3) Implement the platform specific socket
functionality in the virtual functions
send
/
recv
/
select
.
(4) Create an RTC object and pass
NetworkAdapter implementation.
89
See step 3 as well as explanations, page 920.
// // Pseudo code (not complete).
// Send the specified number of bytes.
// Should return 0, if successful. Otherwise, a negative error code.
virtual int32_t send(const char* buf, size_t len) = 0;
// Receive up to len bytes and write them into buf.
// Should return 0, if successful. Otherwise, a negative error code.
// If the answer should be discarded but the command should not exit with an error, return a
// positive value.
virtual int32_t recv(char* buf, size_t len) = 0;
// Determine the read status. Should return the number of read operations available.
// Should be blocking and return 0, if no data is available after timeout_us microseconds.
// Otherwise, should return a negative error code.
virtual int32_t select(long timeout_us) = 0;