M S / Mbed OS SISK-Ethernet

main.cpp

Committer:
szymek
Date:
2018-01-16
Revision:
0:2feffe098612

File content as of revision 0:2feffe098612:

#include "mbed.h"
#include "EthernetInterface.h"

EthernetInterface net;
TCPSocket socket;

int main() {
    net.connect();

    const char *ip = net.get_ip_address();
    
    socket.open(&net);
    socket.connect("sl3.postio.pl", 5000);

    char name[] = "name_set:qwerty";
    int scount = socket.send(name, sizeof name);
    
    char join[] = "room_join:eit";
    scount = socket.send(join, sizeof join);
    
    
    char send_c[] = "room_send:C";
    socket.send(send_c, sizeof send_c);
    
    socket.close();
    
    net.disconnect();
}