Wifi controlled robot that uses ESP8266 wifi chip.

Dependencies:   Motordriver Servo mbed-dev mbed-rtos

Fork of ESP8266_wifi_robot by Kairi Kozuma

ESP8266.h

Committer:
K2Silver
Date:
2016-10-29
Revision:
0:df754b773321

File content as of revision 0:df754b773321:

#ifndef ESP8266_H
#define ESP8266_H

#include "mbed.h"

#define SND_BUF_SIZE 1024

class ESP8266 
{
private:
    char _ssid[32];
    char _pwd[32];
    char _snd[SND_BUF_SIZE];
    RawSerial _esp;
    DigitalOut _reset;
    
public:
    ESP8266(PinName tx, PinName rx, PinName reset, char * SSID, char * password); 
    void send();
    void send(char * command);
    void setup();
    void reset();
    void baud(int baudrate);
    void getMAC();
    void getIP();
    
    int putc(int c);
    int getc();
    int readable();
    int writeable();
    void attach(Callback< void()> func, SerialBase::IrqType type);
};

#endif