W3AIBO Class Reference

#include <W3AIBO.h>

List of all members.

Public Member Functions

 W3AIBO ()
virtual ~W3AIBO ()
virtual OStatus DoInit (const OSystemEvent &event)
virtual OStatus DoStart (const OSystemEvent &event)
virtual OStatus DoStop (const OSystemEvent &event)
virtual OStatus DoDestroy (const OSystemEvent &event)
void NotifyImage (const ONotifyEvent &event)
void ListenCont (ANTENVMSG msg)
void ReceiveCont (ANTENVMSG msg)
void SendHeaderCont (ANTENVMSG msg)
void SendImageCont (ANTENVMSG msg)
void SendErrorCont (ANTENVMSG msg)
void CloseCont (ANTENVMSG msg)

Public Attributes

OSubject * subject [numOfSubject]
OObserver * observer [numOfObserver]

Private Member Functions

OStatus InitTCPConnection (int index)
OStatus Listen (int index)
OStatus Receive (int index)
OStatus SendHeader (int index)
OStatus SendImage (int index)
OStatus SendError (int index)
OStatus Close (int index)
void ProcessHTTPRequest (int index)
void HTTPResponse (int index, HTTPStatus st)

Private Attributes

antStackRef ipstackRef
HTTP http
JPEGEncoder jpegEncoder
TCPConnection connection [W3AIBO_CONNECTION_MAX]

Static Private Attributes

const int W3AIBO_CONNECTION_MAX = JPEGEncoder::NUM_JPEG_BUF
const size_t W3AIBO_HTTP_BUFSIZE = 4096


Constructor & Destructor Documentation

W3AIBO::W3AIBO  ) 
 

Definition at line 24 of file W3AIBO.cc.

virtual W3AIBO::~W3AIBO  )  [inline, virtual]
 

Definition at line 27 of file W3AIBO.h.


Member Function Documentation

OStatus W3AIBO::Close int  index  )  [private]
 

Definition at line 429 of file W3AIBO.cc.

References connection, CONNECTION_CLOSED, ipstackRef, and TCPConnection::state.

Referenced by ListenCont(), ReceiveCont(), SendErrorCont(), SendHeaderCont(), and SendImageCont().

void W3AIBO::CloseCont ANTENVMSG  msg  ) 
 

Definition at line 448 of file W3AIBO.cc.

References connection, Listen(), and TCPConnection::state.

OStatus W3AIBO::DoDestroy const OSystemEvent &  event  )  [virtual]
 

Definition at line 74 of file W3AIBO.cc.

OStatus W3AIBO::DoInit const OSystemEvent &  event  )  [virtual]
 

Definition at line 29 of file W3AIBO.cc.

References JPEGEncoder::Init(), InitTCPConnection(), ipstackRef, and jpegEncoder.

OStatus W3AIBO::DoStart const OSystemEvent &  event  )  [virtual]
 

Definition at line 52 of file W3AIBO.cc.

References Listen().

OStatus W3AIBO::DoStop const OSystemEvent &  event  )  [virtual]
 

Definition at line 65 of file W3AIBO.cc.

void W3AIBO::HTTPResponse int  index,
HTTPStatus  st
[private]
 

Definition at line 521 of file W3AIBO.cc.

References connection, HTTP::HeaderField(), http, HTTP_CONTENT_TYPE, HTTP_HEADER_END, HTTP_SERVER, TCPConnection::sendData, SendError(), SendHeader(), TCPConnection::sendSize, and HTTP::Status().

Referenced by NotifyImage(), and ProcessHTTPRequest().

OStatus W3AIBO::InitTCPConnection int  index  )  [private]
 

Definition at line 81 of file W3AIBO.cc.

References byte, connection, TCPConnection::httpReq, TCPConnection::httpReqLen, TCPConnection::imageRequested, ipstackRef, TCPConnection::jpegData, TCPConnection::jpegSize, TCPConnection::layer, TCPConnection::quality, TCPConnection::reconstruction, TCPConnection::recvBuffer, TCPConnection::recvData, TCPConnection::recvSize, TCPConnection::sendBuffer, TCPConnection::sendData, TCPConnection::sendSize, TCPConnection::state, and W3AIBO_HTTP_BUFSIZE.

Referenced by DoInit().

OStatus W3AIBO::Listen int  index  )  [private]
 

Definition at line 176 of file W3AIBO.cc.

References connection, TCPConnection::endpoint, IP_ADDR_ANY(), ipstackRef, TCPConnection::state, W3AIBO_HTTP_BUFSIZE, and W3AIBO_PORT.

Referenced by CloseCont(), and DoStart().

void W3AIBO::ListenCont ANTENVMSG  msg  ) 
 

Definition at line 213 of file W3AIBO.cc.

References Close(), connection, Receive(), and TCPConnection::state.

void W3AIBO::NotifyImage const ONotifyEvent &  event  ) 
 

Definition at line 153 of file W3AIBO.cc.

References connection, JPEGEncoder::GetJPEG(), HTTP_OK, HTTPResponse(), TCPConnection::imageRequested, jpegEncoder, and observer.

void W3AIBO::ProcessHTTPRequest int  index  )  [private]
 

Definition at line 460 of file W3AIBO.cc.

References connection, http, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTPResponse(), TCPConnection::imageRequested, TCPConnection::layer, HTTP::Parse(), TCPConnection::reconstruction, W3AIBO_DEFAULT_URI, W3AIBO_LAYER_H_URI, W3AIBO_LAYER_HR_URI, W3AIBO_LAYER_L_URI, W3AIBO_LAYER_LR_URI, W3AIBO_LAYER_M_URI, and W3AIBO_LAYER_MR_URI.

Referenced by ReceiveCont().

OStatus W3AIBO::Receive int  index  )  [private]
 

Definition at line 234 of file W3AIBO.cc.

References connection, CONNECTION_CONNECTED, TCPConnection::httpReqLen, ipstackRef, TCPConnection::recvSize, and TCPConnection::state.

Referenced by ListenCont(), and ReceiveCont().

void W3AIBO::ReceiveCont ANTENVMSG  msg  ) 
 

Definition at line 256 of file W3AIBO.cc.

References Close(), connection, TCPConnection::httpReq, TCPConnection::httpReqLen, memcpy(), ProcessHTTPRequest(), and Receive().

OStatus W3AIBO::SendError int  index  )  [private]
 

Definition at line 386 of file W3AIBO.cc.

References connection, ipstackRef, TCPConnection::sendSize, and TCPConnection::state.

Referenced by HTTPResponse().

void W3AIBO::SendErrorCont ANTENVMSG  msg  ) 
 

Definition at line 409 of file W3AIBO.cc.

References Close(), connection, and TCPConnection::state.

OStatus W3AIBO::SendHeader int  index  )  [private]
 

Definition at line 298 of file W3AIBO.cc.

References connection, ipstackRef, TCPConnection::sendSize, and TCPConnection::state.

Referenced by HTTPResponse().

void W3AIBO::SendHeaderCont ANTENVMSG  msg  ) 
 

Definition at line 321 of file W3AIBO.cc.

References Close(), connection, SendImage(), and TCPConnection::state.

OStatus W3AIBO::SendImage int  index  )  [private]
 

Definition at line 341 of file W3AIBO.cc.

References connection, ipstackRef, and TCPConnection::state.

Referenced by SendHeaderCont().

void W3AIBO::SendImageCont ANTENVMSG  msg  ) 
 

Definition at line 364 of file W3AIBO.cc.

References Close(), connection, JPEGEncoder::FreeJPEG(), jpegEncoder, and TCPConnection::state.


Member Data Documentation

TCPConnection W3AIBO::connection[W3AIBO_CONNECTION_MAX] [private]
 

Definition at line 64 of file W3AIBO.h.

Referenced by Close(), CloseCont(), HTTPResponse(), InitTCPConnection(), Listen(), ListenCont(), NotifyImage(), ProcessHTTPRequest(), Receive(), ReceiveCont(), SendError(), SendErrorCont(), SendHeader(), SendHeaderCont(), SendImage(), and SendImageCont().

HTTP W3AIBO::http [private]
 

Definition at line 62 of file W3AIBO.h.

Referenced by HTTPResponse(), and ProcessHTTPRequest().

antStackRef W3AIBO::ipstackRef [private]
 

Definition at line 61 of file W3AIBO.h.

Referenced by Close(), DoInit(), InitTCPConnection(), Listen(), Receive(), SendError(), SendHeader(), and SendImage().

JPEGEncoder W3AIBO::jpegEncoder [private]
 

Definition at line 63 of file W3AIBO.h.

Referenced by DoInit(), NotifyImage(), and SendImageCont().

OObserver* W3AIBO::observer[numOfObserver]
 

Definition at line 30 of file W3AIBO.h.

Referenced by NotifyImage().

OSubject* W3AIBO::subject[numOfSubject]
 

Definition at line 29 of file W3AIBO.h.

const int W3AIBO::W3AIBO_CONNECTION_MAX = JPEGEncoder::NUM_JPEG_BUF [static, private]
 

Definition at line 47 of file W3AIBO.h.

const size_t W3AIBO::W3AIBO_HTTP_BUFSIZE = 4096 [static, private]
 

Definition at line 48 of file W3AIBO.h.

Referenced by InitTCPConnection(), and Listen().


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 23:04:35 2007 for openSDK by  doxygen 1.3.9.1