blob: b380f46b98f0df912ff7abb685d2d804a0094e1c [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001/**
2 * Copyright (C) ARM Limited 2010-2014. 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 <stdint.h>
13#include <string.h>
14
15class OlySocket;
16
17// Commands from Streamline
18enum {
19 COMMAND_REQUEST_XML = 0,
20 COMMAND_DELIVER_XML = 1,
21 COMMAND_APC_START = 2,
22 COMMAND_APC_STOP = 3,
23 COMMAND_DISCONNECT = 4,
24 COMMAND_PING = 5
25};
26
27class StreamlineSetup {
28public:
29 StreamlineSetup(OlySocket *socket);
30 ~StreamlineSetup();
31private:
32 OlySocket* mSocket;
33
34 char* readCommand(int*);
35 void handleRequest(char* xml);
36 void handleDeliver(char* xml);
37 void sendData(const char* data, uint32_t length, char type);
38 void sendString(const char* string, int type) {sendData(string, strlen(string), type);}
39 void sendEvents();
40 void sendConfiguration();
41 void sendDefaults();
42 void sendCounters();
43 void writeConfiguration(char* xml);
44
45 // Intentionally unimplemented
46 StreamlineSetup(const StreamlineSetup &);
47 StreamlineSetup &operator=(const StreamlineSetup &);
48};
49
50#endif //__STREAMLINE_SETUP_H__