]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/arm-ds5-gator.git/blob - daemon/StreamlineSetup.h
Merge branch 'master' into android
[android-sdk/arm-ds5-gator.git] / daemon / StreamlineSetup.h
1 /**
2  * Copyright (C) ARM Limited 2010-2012. 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  */
9 #ifndef __STREAMLINE_SETUP_H__
10 #define __STREAMLINE_SETUP_H__
12 #include "OlySocket.h"
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 };
24 class StreamlineSetup {
25 public:
26         StreamlineSetup(OlySocket *socket);
27         ~StreamlineSetup();
28 private:
29         int mNumConnections;
30         OlySocket* mSocket;
31         char* mSessionXML;
33         char* readCommand(int*);
34         void handleRequest(char* xml);
35         void handleDeliver(char* xml);
36         void sendData(const char* data, int length, int type);
37         void sendString(const char* string, int type) {sendData(string, strlen(string), type);}
38         void sendProtocol();
39         void sendEvents();
40         void sendConfiguration();
41         void sendDefaults();
42         void sendCounters();
43         void writeConfiguration(char* xml);
44 };
46 #endif  //__STREAMLINE_SETUP_H__