Merge tag 'v3.10.17' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git] / tools / gator / daemon / Sender.h
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 __SENDER_H__
10 #define __SENDER_H__
11
12 #include <stdio.h>
13 #include <pthread.h>
14
15 class OlySocket;
16
17 enum {
18         RESPONSE_XML = 1,
19         RESPONSE_APC_DATA = 3,
20         RESPONSE_ACK = 4,
21         RESPONSE_NAK = 5,
22         RESPONSE_ERROR = 0xFF
23 };
24
25 class Sender {
26 public:
27         Sender(OlySocket* socket);
28         ~Sender();
29         void writeData(const char* data, int length, int type);
30         void createDataFile(char* apcDir);
31 private:
32         OlySocket* mDataSocket;
33         FILE* mDataFile;
34         char* mDataFileName;
35         pthread_mutex_t mSendMutex;
36 };
37
38 #endif  //__SENDER_H__