Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 1 | /** |
| 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 |
| 15 | enum { |
| 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 | |
| 24 | class StreamlineSetup { |
| 25 | public: |
| 26 | StreamlineSetup(OlySocket *socket); |
| 27 | ~StreamlineSetup(); |
| 28 | private: |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 29 | 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 Medhurst | 34d9769 | 2013-12-19 09:23:06 +0000 | [diff] [blame^] | 41 | |
| 42 | // Intentionally unimplemented |
| 43 | StreamlineSetup(const StreamlineSetup &); |
| 44 | StreamlineSetup &operator=(const StreamlineSetup &); |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | #endif //__STREAMLINE_SETUP_H__ |