/* * Ivy League * * OBEX protocol * * Copyright 2000 * Centre d'Etudes de la Navigation Aerienne (CENA) * * by Stephane Chatty * * $Id$ * */ #ifndef ObexStream_H_ #define ObexStream_H_ #include "ivl/cplus_bugs.h" #include "Stream.h" class IvlAddress; #include "ivl/List.h" #include "Trigger.h" #include "Scheduler.h" #include "BufStream.h" #include "Event.h" class IvlObexStream : public IvlStream { public: IvlTrigger NewAgents; IvlObexStream (IvlAddress*, IvlBaseScheduler* = IvlScd); ~IvlObexStream (); IvlChannel* Copy () const; void HandleRead (); }; class IvlObexHeader; class IvlObexObject; class IvlObexAgent : public IvlBufStream { private: IvlObexStream* MyLink; void* CurObj; IvlListOf OutHeaders; void HandleRead (); void ParseConnect (sword, bool); void ParseDisconnect (sword, bool); void ParseAbort (sword, bool); void ParsePut (sword, bool); void ParseGet (sword, bool); void ParseSetPath (sword, bool); void ParseHeaders (sword, bool); void SendResponse (); void SendHeader (byte, byte, const char*); public: IvlObexAgent (int, IvlObexStream*); IvlObexAgent (IvlAddress*, IvlObexStream*); ~IvlObexAgent (); void SendObject (IvlObexObject&); }; class IvlObexAgentEvent : public IvlEvent { public: static IvlEventType* ObexNewAgent, *ObexAgentBye; protected: IvlObexAgent* Agent; public: IvlObexAgentEvent (IvlObexAgent*, IvlEventType*); ~IvlObexAgentEvent (); inline IvlObexAgent* GetAgent () const { return Agent;} }; class IvlObexObject { friend class IvlObexAgent; protected: IvlString Name; IvlString Description; IvlString Body; // should not be a text string, actually lword Class; public: IvlObexObject (); ~IvlObexObject (); void SetName (const char*); void SetDescription (const char*); void SetBody (const char*); void SetClass (lword); }; #endif /* ObexStream_H_ */