diff options
| author | Yuval Adam <_@yuv.al> | 2017-08-30 08:25:59 +0000 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2017-08-30 08:25:59 +0000 |
| commit | 8e4bff4cab0ddac6060645b0715210484d02ff40 (patch) | |
| tree | 3a5c3024371a04692a3a6d9974d001cdff8ebf84 /tools/gator/daemon/Sender.h | |
Diffstat (limited to 'tools/gator/daemon/Sender.h')
| -rw-r--r-- | tools/gator/daemon/Sender.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tools/gator/daemon/Sender.h b/tools/gator/daemon/Sender.h new file mode 100644 index 00000000..5aa91171 --- /dev/null +++ b/tools/gator/daemon/Sender.h @@ -0,0 +1,42 @@ +/** + * Copyright (C) ARM Limited 2010-2014. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __SENDER_H__ +#define __SENDER_H__ + +#include <stdio.h> +#include <pthread.h> + +class OlySocket; + +enum { + RESPONSE_XML = 1, + RESPONSE_APC_DATA = 3, + RESPONSE_ACK = 4, + RESPONSE_NAK = 5, + RESPONSE_ERROR = 0xFF +}; + +class Sender { +public: + Sender(OlySocket* socket); + ~Sender(); + void writeData(const char* data, int length, int type); + void createDataFile(char* apcDir); +private: + OlySocket* mDataSocket; + FILE* mDataFile; + char* mDataFileName; + pthread_mutex_t mSendMutex; + + // Intentionally unimplemented + Sender(const Sender &); + Sender &operator=(const Sender &); +}; + +#endif //__SENDER_H__ |
