UDP Client
Embed:
(wiki syntax)
Show/hide line numbers
UsaClient.hpp
00001 #ifndef __USACLIENT_HPP__ 00002 #define __USACLIENT_HPP__ 00003 00004 #include "mbed.h" 00005 #include "EthernetInterface.h" 00006 00007 #define USACLIENT_BUFFER_MAX 1500 00008 00009 00010 class UsaClient 00011 { 00012 private: 00013 EthernetInterface* net; 00014 UDPSocket sock; 00015 struct buffer 00016 { 00017 uint32_t address; 00018 uint8_t rw; 00019 uint8_t option; 00020 uint16_t size; 00021 uint8_t data[USACLIENT_BUFFER_MAX]; 00022 }; 00023 buffer write_buffer; 00024 buffer read_buffer; 00025 public: 00026 SocketAddress socketAddress; 00027 00028 UsaClient(EthernetInterface* _net); 00029 UsaClient(EthernetInterface* _net, const char* ip, int port); 00030 int Write(int address, const void* data, int size); 00031 int Read(int address, const void* data, int size); 00032 }; 00033 00034 #endif
Generated on Mon Jul 18 2022 16:51:38 by
1.7.2