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.
irc.h
- Committer:
- NickRyder
- Date:
- 2014-08-02
- Revision:
- 0:b8fb2df56652
File content as of revision 0:b8fb2df56652:
#ifndef __mbed_irc_h__
#define __mbed_irc_h__
#include "mbed.h"
#include "EthernetInterface.h"
#include <vector>
class IrcMessage {
public:
IrcMessage();
IrcMessage(char *, char *, char *);
char from[32], to[32], msg[256];
};
class MessageHandler {
public:
MessageHandler() {};
virtual IrcMessage handle(IrcMessage msg) {return IrcMessage();}
};
class Irc {
public:
Irc(char *, char *, int, char *);
void connect();
void disconnect();
void add(MessageHandler *);
void identify(char *);
void join(char *);
bool read();
private:
void handle(IrcMessage);
void parse();
void send(char *);
Serial pc;
TCPSocketConnection sock;
char network[64];
char channel[64];
int port;
char nickname[64];
char password[64];
bool ident, connected, setup, joined;
char readbuffer[512];
char parsebuffer[512];
int parseindex;
vector<MessageHandler *> handlers;
};
#endif