08.02.2010 - version 0.1.2
This commit is contained in:
10
piethernet.h
10
piethernet.h
@@ -38,12 +38,12 @@
|
||||
|
||||
#define BUFFER_SIZE 4096
|
||||
|
||||
typedef bool (*EthernetFunc)(void * , char * , int );
|
||||
typedef bool (*EthernetFunc)(void * , uchar * , int );
|
||||
|
||||
class PIEthernet: public PIThread
|
||||
{
|
||||
public:
|
||||
// slot is any function format "bool <func>(void*, char*, int)"
|
||||
// slot is any function format "bool <func>(void*, uchar*, int)"
|
||||
PIEthernet(PIString ip = "", int port = 0, void * data = 0, EthernetFunc slot = 0);
|
||||
~PIEthernet();
|
||||
|
||||
@@ -53,13 +53,13 @@ public:
|
||||
void setSendAddress(PIString ip, int port) {ip_s = ip; port_s = port;}
|
||||
|
||||
bool send(PIString ip, int port, char * data, int size);
|
||||
bool send(char * data, int size);
|
||||
bool send(uchar * data, int size);
|
||||
bool init();
|
||||
bool initSend();
|
||||
bool receiverInitialized() const {return sock != -1;}
|
||||
bool senderInitialized() const {return sock_s != -1;}
|
||||
void terminate();
|
||||
const char * buffer() const {return buffer_;}
|
||||
const uchar * buffer() const {return buffer_;}
|
||||
|
||||
private:
|
||||
void begin();
|
||||
@@ -71,7 +71,7 @@ private:
|
||||
PIString ip_, ip_s;
|
||||
EthernetFunc ret_func;
|
||||
void * data;
|
||||
char buffer_[BUFFER_SIZE];
|
||||
uchar buffer_[BUFFER_SIZE];
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user