Mercurial > hg > beaglert
annotate include/UdpClient.h @ 70:f3251851c718
Brought UdpClient files over from ultra-staging branch (with include fix), and updated Makefile accordingly
author | andrewm |
---|---|
date | Fri, 17 Jul 2015 17:50:54 +0100 |
parents | |
children | 3068421c0737 c42a6b4dc2d4 |
rev | line source |
---|---|
andrewm@70 | 1 /* |
andrewm@70 | 2 * udpClient.h |
andrewm@70 | 3 * |
andrewm@70 | 4 * Created on: 19 May 2015 |
andrewm@70 | 5 * Author: giulio moro |
andrewm@70 | 6 */ |
andrewm@70 | 7 |
andrewm@70 | 8 #ifndef UDPCLIENT_H_ |
andrewm@70 | 9 #define UDPCLIENT_H_ |
andrewm@70 | 10 |
andrewm@70 | 11 #include <sys/types.h> |
andrewm@70 | 12 #include <sys/socket.h> |
andrewm@70 | 13 #include <netinet/in.h> |
andrewm@70 | 14 #include <arpa/inet.h> |
andrewm@70 | 15 #include <netdb.h> |
andrewm@70 | 16 #include <stdio.h> |
andrewm@70 | 17 #include <stdlib.h> |
andrewm@70 | 18 #include <unistd.h> |
andrewm@70 | 19 #include <string.h> |
andrewm@70 | 20 |
andrewm@70 | 21 class UdpClient{ |
andrewm@70 | 22 private: |
andrewm@70 | 23 int port; |
andrewm@70 | 24 int enabled; |
andrewm@70 | 25 int outSocket; |
andrewm@70 | 26 bool isSetPort; |
andrewm@70 | 27 bool isSetServer; |
andrewm@70 | 28 struct sockaddr_in destinationServer; |
andrewm@70 | 29 public: |
andrewm@70 | 30 UdpClient(); |
andrewm@70 | 31 UdpClient(int aPort, const char* aServerName); |
andrewm@70 | 32 ~UdpClient(); |
andrewm@70 | 33 void setPort(int aPort); |
andrewm@70 | 34 void setServer(const char* aServerName); |
andrewm@70 | 35 int send(void* message, int size); |
andrewm@70 | 36 }; |
andrewm@70 | 37 |
andrewm@70 | 38 |
andrewm@70 | 39 |
andrewm@70 | 40 #endif /* UDPCLIENT_H_ */ |