blob: d6d9a6ea29919db845ec5c4777c56b28698adda1 [file] [log] [blame]
Jon Medhurstaaf37a32013-06-11 12:10:56 +01001/**
2 * Copyright (C) ARM Limited 2010-2013. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __STREAMLINE_SETUP_H__
10#define __STREAMLINE_SETUP_H__
11
12#include "OlySocket.h"
13
14// Commands from Streamline
15enum {
16 COMMAND_REQUEST_XML = 0,
17 COMMAND_DELIVER_XML = 1,
18 COMMAND_APC_START = 2,
19 COMMAND_APC_STOP = 3,
20 COMMAND_DISCONNECT = 4,
21 COMMAND_PING = 5
22};
23
24class StreamlineSetup {
25public:
26 StreamlineSetup(OlySocket *socket);
27 ~StreamlineSetup();
28private:
Jon Medhurstaaf37a32013-06-11 12:10:56 +010029 OlySocket* mSocket;
30
31 char* readCommand(int*);
32 void handleRequest(char* xml);
33 void handleDeliver(char* xml);
34 void sendData(const char* data, uint32_t length, char type);
35 void sendString(const char* string, int type) {sendData(string, strlen(string), type);}
36 void sendEvents();
37 void sendConfiguration();
38 void sendDefaults();
39 void sendCounters();
40 void writeConfiguration(char* xml);
Jon Medhurst34d97692013-12-19 09:23:06 +000041
42 // Intentionally unimplemented
43 StreamlineSetup(const StreamlineSetup &);
44 StreamlineSetup &operator=(const StreamlineSetup &);
Jon Medhurstaaf37a32013-06-11 12:10:56 +010045};
46
47#endif //__STREAMLINE_SETUP_H__