HSS1394  Release1.00
HSS1394.h
Go to the documentation of this file.
1 //
21 //-----------------------------------------------------------------------------
36 
37 #ifndef _HSS1394_
38 #define _HSS1394_
39 
40 
41 #if defined(_WIN32)
42 #if defined(HSS1394_EXPORT_DLL)
43 #define HSS1394_CLASS_CONVENTION __declspec(dllexport)
44 #elif defined(HSS1394_IMPORT_DLL)
45 #define HSS1394_CLASS_CONVENTION __declspec(dllimport)
46 #else
47 #define HSS1394_CLASS_CONVENTION // static import
48 #endif
49 
50 #else // _WIN32
51 
52 #define HSS1394_CLASS_CONVENTION // static import
53 
54 #endif // _WIN32
55 
56 
57 //*** Includes
58 //*****************************************************************************
59 #include <string> // STL string class
60 #include "HSS1394Types.h"
61 
62 
63 //*** Types
64 //*****************************************************************************
66 namespace hss1394 {
67 
68  // TNodeInfo
70  //-------------------------------------------------------------------------
71  typedef struct {
72  std::string sName;
75  }TNodeInfo;
76 };
77 
78 
79 //*** Class declarations
80 //*****************************************************************************
81 namespace hss1394 {
82 
83  // Listener::
87  //-----------------------------------------------------------------------------
89  public:
91  virtual void Do(void) = 0;
92  };
93 
94 
95  // ChannelListener::
97  //-----------------------------------------------------------------------------
99  public:
100  // :: Process is called when data has arrived. The arguments present
104  virtual void Process(const uint8 *pBuffer, uint uBufferSize) { }
105 
106  // ::Disconnected is called when the node attached to this channel becomes
108  virtual void Disconnected(void) { }
109 
110  // ::Reconnected is called when the node attached to this channel becomes
112  virtual void Reconnected(void) { }
113  };
114 
115 
116  // Channel::
119  //-----------------------------------------------------------------------------
121  public:
124  virtual void Stop(void) = 0;
125 
127  virtual void Restart(void) = 0;
128 
130  virtual void Flush(void) = 0;
131 
134  virtual void GetNodeInfo(TNodeInfo &tNodeInfo) = 0;
135 
140  virtual uint SendChannelBytes(const uint8 *pBuffer, uint uBufferSize, bool bForce = true) = 0;
141 
144  virtual uint SendChannelEcho(const uint8 *pBuffer, uint uBufferSize) = 0;
145 
148  virtual uint GetRetries(void) = 0;
149 
154  virtual uint ReceiveChannelBytes(uint8 *pBuffer, uint uBufferSize) = 0;
155 
163  virtual bool InstallChannelListener(ChannelListener *pListener) = 0;
164 
167  virtual bool ChannelListenerExists(void) = 0;
168 
173  virtual uint SendUserControl(uint8 uUserTag, const uint8 *pUserData, uint uDataBytes) = 0;
174  };
175 
176 
177  // Node::
179  //-----------------------------------------------------------------------------
181  protected:
182  static Node *mspInstance;
183 
184  // Dispose of class and reclaim all resources. Closes all channels.
185  // All channel objects created by the interface will be destroyed. It
186  // is up to the caller to clean up any pointers remaining to channel
187  // objects.
188  virtual ~Node() { };
189 
190  public:
193  static Node *Instance(void);
194 
196  static void Shutdown(void);
197 
203  virtual void InstallConnectionListener(Listener *pListener) = 0;
204 
206  virtual uint GetNodeCount(void) = 0;
207 
216  virtual bool GetNodeInfo(TNodeInfo &tNodeInfo, uint uNode, bool *pbAvailable = NULL, bool *pbInstalled = NULL) = 0;
217 
220  virtual Channel *OpenChannel(uint uNode) = 0;
221 
225  virtual bool ReleaseChannel(Channel *pChannel) = 0;
226  };
227 
228 
229 }; // namespace hss1394
230 
231 
232 #endif // _HSS1394_
233 
234 
virtual void Reconnected(void)
available again.
Definition: HSS1394.h:112
#define NULL
Definition: HSS1394Types.h:31
HSS1394 namespace encapsulates all HSS1394 functionality.
Definition: HSS1394.h:66
64-bit unsigned integer
Definition: HSS1394Types.h:109
unsigned short uint16
16-bit unsigned int
Definition: HSS1394Types.h:74
uint64 uGUID
Node 1394 Global Unique ID.
Definition: HSS1394.h:73
virtual void Disconnected(void)
unavailable.
Definition: HSS1394.h:108
Callback object for an incomming data channel.
Definition: HSS1394.h:98
static Node * mspInstance
Singleton instance of class.
Definition: HSS1394.h:182
std::string sName
Textual name of node.
Definition: HSS1394.h:72
unsigned int uint
Machine native unsigned int.
Definition: HSS1394Types.h:72
uint16 uProtocolVersion
HSS1394 protocol code for this node.
Definition: HSS1394.h:74
Definition: HSS1394.h:88
Definition: HSS1394.h:120
Singleton High-speed serial over 1394 host node interface.
Definition: HSS1394.h:180
Contains information about a discovered HSS1394 node on the 1394 net.
Definition: HSS1394.h:71
virtual void Process(const uint8 *pBuffer, uint uBufferSize)
Definition: HSS1394.h:104
unsigned char uint8
8-bit unsigned int
Definition: HSS1394Types.h:73
#define HSS1394_CLASS_CONVENTION
Definition: HSS1394.h:52