xref: /haiku/src/apps/serialconnect/SerialApp.h (revision 6c4a44e36ba846c54467103f884d65dfa13e7fcb)
1 /*
2  * Copyright 2012, Adrien Destugues, pulkomandy@gmail.com
3  * Distributed under the terms of the MIT licence.
4  */
5 
6 
7 #include <Application.h>
8 #include <SerialPort.h>
9 
10 
11 class SerialWindow;
12 
13 
14 class SerialApp: public BApplication
15 {
16 	public:
17 		SerialApp();
18 		void ReadyToRun();
19 		void MessageReceived(BMessage* message);
20 
21 	private:
22 		BSerialPort fSerialPort;
23 		sem_id fSerialLock;
24 		SerialWindow* fWindow;
25 
26 		static status_t PollSerial(void*);
27 
28 		static const char* kApplicationSignature;
29 };
30 
31 
32 enum messageConstants {
33 	kMsgOpenPort  = 'open',
34 	kMsgDataRead  = 'dare',
35 	kMsgDataWrite = 'dawr',
36 };
37 
38