Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: PwmIn IONMcMotor MPU6050 Eigen ROVER
Fork of Hyfliers_Completo_testato by
Ethernet_tcp_comunication/Eth_tcp.h
- Committer:
- anfontanelli
- Date:
- 2019-11-06
- Revision:
- 3:fc26045926d9
File content as of revision 3:fc26045926d9:
#ifndef ETH_TCP_H
#define ETH_TCP_H
#include "mbed.h"
#include "EthernetInterface.h"
#include "TCPServer.h"
#include "TCPSocket.h"
#include "MyBuffer.h"
//DigitalOut led1(LED1);
class Eth_tcp
{
public:
Eth_tcp(int port_, int sock_timeout_);
int recv_int(int time_out);
char recv_char(int time_out);
char* recv_cmd(int time_out);
bool recv_pkt(char& cmd, MyBuffer <int> &values, int& n_of_int);
bool is_connected();
void send_vec_of_int(MyBuffer <int> vec_of_int);
void sendAck(char c);
void connect();
void reset_connection();
private:
Timer comunicationTimer;
void StuffIntIntoChar4(char* pIntoChar4, int32_t val);
EthernetInterface eth;
TCPServer srv;
TCPSocket clt_sock;
SocketAddress clt_addr;
int port;
int sock_timeout;
};
#endif
