]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/arm-ds5-gator.git/blobdiff - daemon/Sender.h
gator-daemon: ARM DS-5.7 Streamline gator daemon sources
[android-sdk/arm-ds5-gator.git] / daemon / Sender.h
diff --git a/daemon/Sender.h b/daemon/Sender.h
new file mode 100644 (file)
index 0000000..9584c10
--- /dev/null
@@ -0,0 +1,36 @@
+/**
+ * Copyright (C) ARM Limited 2010-2011. 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 "OlySocket.h"
+
+enum {
+       RESPONSE_END = 0, // unused
+       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* dataSocket;
+       FILE* dataFile;
+       char* dataFileName;
+};
+
+#endif         //__SENDER_H__