repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / serialconnect / SerialApp.h
blob31da080e0857425c6d8808866634e0270ffc1e5f
1 /*
2 * Copyright 2012-2017, Adrien Destugues, pulkomandy@gmail.com
3 * Distributed under the terms of the MIT licence.
4 */
7 #ifndef _SERIALAPP_H_
8 #define _SERIALAPP_H_
11 #include <Application.h>
12 #include <PropertyInfo.h>
13 #include <SerialPort.h>
14 #include <String.h>
16 #include "FileSender.h"
17 #include "XModem.h"
20 class BFile;
21 class SerialWindow;
24 class SerialApp: public BApplication
26 public:
27 SerialApp();
28 ~SerialApp();
29 void ReadyToRun();
30 void MessageReceived(BMessage* message);
31 bool QuitRequested();
33 status_t GetSupportedSuites(BMessage* message);
34 BHandler* ResolveSpecifier(BMessage*, int32, BMessage*, int32,
35 const char*);
37 const BString& GetPort();
39 private:
40 void LoadSettings();
41 void SaveSettings();
43 private:
44 BSerialPort fSerialPort;
45 sem_id fSerialLock;
46 SerialWindow* fWindow;
47 BFile* fLogFile;
48 BString fPortPath;
50 FileSender* fFileSender;
52 static status_t PollSerial(void*);
54 static const BPropertyInfo kScriptingProperties;
55 static const char* kApplicationSignature;
59 enum messageConstants {
60 kMsgCustomBaudrate = 'cust',
61 kMsgDataRead = 'dard',
62 kMsgDataWrite = 'dawr',
63 kMsgLogfile = 'logf',
64 kMsgOpenPort = 'open',
65 kMsgProgress = 'prog',
66 kMsgSettings = 'stty',
67 kMsgSendFile = 'sndf',
70 #endif