31 int result = WSAStartup(MAKEWORD(2, 2), &wsa_data);
63 mainSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
64 beaconSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
66 if (INVALID_SOCKET == mainSocket)
73 memset(&serverDefinition, 0,
sizeof(serverDefinition));
74 serverDefinition.sin_addr.s_addr = inet_addr(targetIP.c_str());
75 serverDefinition.sin_family = AF_INET;
76 serverDefinition.sin_port = htons(targetPort);
87 int result = recv(sock, buf, count, 0);
A class that acts as a logging sink. The intent is that someone could make their own derived class of...
static void critical(const std::string &logText)
Logs a string to the log sink with Critical severity. Wraps sink_CAN_stack_log.
void close() override
Closes the connection.
bool write_frame(const isobus::HardwareInterfaceCANFrame &canFrame) override
Writes a frame to the bus (synchronous)
void open() override
Connects to the server.
const std::string get_connected_ip_address() const
Returns the IP that the plugin is connected to.
SocketCANdNetworkInterface(std::string deviceName)
Constructor for the socket CAN driver.
bool read_frame(isobus::HardwareInterfaceCANFrame &canFrame) override
Returns a frame from the hardware (synchronous), or false if no frame can be read.
bool get_is_valid() const override
Returns if the connection is valid.
void initialize()
Initializes some class variables.
std::string get_device_name() const
Returns the device name the driver is using.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...
A windows hardware plugin for connecting to and using a socketcand server.