blob: a27a7ac97a13e25999195132bb2105ea382b7175 [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:
29 int mNumConnections;
30 OlySocket* mSocket;
31
32 char* readCommand(int*);
33 void handleRequest(char* xml);
34 void handleDeliver(char* xml);
35 void sendData(const char* data, uint32_t length, char type);
36 void sendString(const char* string, int type) {sendData(string, strlen(string), type);}
37 void sendEvents();
38 void sendConfiguration();
39 void sendDefaults();
40 void sendCounters();
41 void writeConfiguration(char* xml);
42};
43
44#endif //__STREAMLINE_SETUP_H__