/[H7]/branches/linux-serial/server/globalstorage.h
ViewVC logotype

Contents of /branches/linux-serial/server/globalstorage.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 67 - (show annotations) (download)
Tue Feb 6 23:37:39 2007 UTC (17 years, 3 months ago) by torben
File MIME type: text/plain
File size: 739 byte(s)
Added some more of the H7 linux server - now it basically works :)


1 #pragma once
2
3 #include <boost/thread/mutex.hpp>
4 #include <queue>
5 #include <cppsocket/tcpserver.h>
6
7 #include "../H7Serial.h"
8 #include "serialthread.h"
9
10 struct WriteCommand
11 {
12 WriteCommand(int t, int d) {target=t; data=d;}
13 unsigned char target;
14 unsigned char data;
15 };
16
17 //Singleton
18 class GlobalStorage
19 {
20 public:
21 static GlobalStorage* instance();
22
23 CH7Serial serialPort;
24 boost::mutex writeMutex;
25 std::queue<WriteCommand> commands;
26 CPPSocket::TCPServer server;
27 SerialThread serialThread;
28
29 bool led3,led4,led5,switch2,switch3;
30 int temp,potmeter;
31
32 protected:
33 GlobalStorage() {} //default constructor
34 GlobalStorage(const GlobalStorage&) {} //copy constructor
35 GlobalStorage& operator=(const GlobalStorage) {} //assignment operator
36 };

  ViewVC Help
Powered by ViewVC 1.1.20