Example of HTTPServer with additional features: * SNTPClient, DST rules * Link status indication * Local or SDCard-based WebServer * RPC-able class * Static and Dynamic HTML page

Dependencies:   mbed

Committer:
iva2k
Date:
Tue Jan 12 07:41:55 2010 +0000
Revision:
2:360fda42fefd
Parent:
0:886e4b3119ad

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
iva2k 0:886e4b3119ad 1 #include "TCPItem.h"
iva2k 0:886e4b3119ad 2
iva2k 0:886e4b3119ad 3 using namespace std;
iva2k 0:886e4b3119ad 4 using namespace mbed;
iva2k 0:886e4b3119ad 5
iva2k 0:886e4b3119ad 6 void TCPItem::abort() const {
iva2k 0:886e4b3119ad 7 tcp_abort(this->_pcb);
iva2k 0:886e4b3119ad 8 }
iva2k 0:886e4b3119ad 9
iva2k 0:886e4b3119ad 10 void TCPItem::release_callbacks() const {
iva2k 0:886e4b3119ad 11 tcp_arg(this->_pcb, NULL);
iva2k 0:886e4b3119ad 12 tcp_sent(this->_pcb, NULL);
iva2k 0:886e4b3119ad 13 tcp_recv(this->_pcb, NULL);
iva2k 0:886e4b3119ad 14 tcp_poll(this->_pcb, NULL, 255);
iva2k 0:886e4b3119ad 15 tcp_accept(this->_pcb, NULL);
iva2k 0:886e4b3119ad 16 tcp_err(this->_pcb, NULL);
iva2k 0:886e4b3119ad 17 }
iva2k 0:886e4b3119ad 18
iva2k 0:886e4b3119ad 19 err_t TCPItem::close() {
iva2k 0:886e4b3119ad 20 err_t err = tcp_close(this->_pcb);
iva2k 0:886e4b3119ad 21 this->_pcb = NULL;
iva2k 0:886e4b3119ad 22 return err;
iva2k 0:886e4b3119ad 23 }
iva2k 0:886e4b3119ad 24
iva2k 0:886e4b3119ad 25 void TCPItem::open() {
iva2k 0:886e4b3119ad 26 if(!this->_pcb) {
iva2k 0:886e4b3119ad 27 this->_pcb = tcp_new();
iva2k 0:886e4b3119ad 28 tcp_arg(this->_pcb, this);
iva2k 0:886e4b3119ad 29 }
iva2k 0:886e4b3119ad 30 }