summaryrefslogtreecommitdiffstats
path: root/meif.h
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-08-12 21:06:21 (GMT)
committerPaul Kocialkowski <contact@paulk.fr>2012-08-12 21:06:21 (GMT)
commitb153cbd84327b97c6d1f7eacad52dab79e0c2d7e (patch)
tree0750b710a83b3bfe810b8d49b091ff6268495af0 /meif.h
parente4f94e901b9b4c5fef5642ad9580863fc2bfe336 (diff)
downloadbcm4751-b153cbd84327b97c6d1f7eacad52dab79e0c2d7e.zip
bcm4751-b153cbd84327b97c6d1f7eacad52dab79e0c2d7e.tar.gz
bcm4751-b153cbd84327b97c6d1f7eacad52dab79e0c2d7e.tar.bz2
Created clean new BCM4751 gpsd code that works and prints the read data
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'meif.h')
-rw-r--r--meif.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/meif.h b/meif.h
new file mode 100644
index 0000000..f79b9b8
--- /dev/null
+++ b/meif.h
@@ -0,0 +1,67 @@
+/**
+ * This file is part of BCM4751 gpsd
+ *
+ * Copyright (C) 2011 Paul Kocialkowski <contact@oaulk.fr>
+ *
+ * BCM4751 gpsd is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * BCM4751 gpsd is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with BCM4751 gpsd. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#ifndef _MEIF_H_
+#define _MEIF_H_
+
+#define MEIF_START 0xA593
+#define MEIF_END 0xA568
+
+/*
+ * Commands
+ */
+
+#define MEIF_ACK_MSG 0x0000
+#define MEIF_NACK_MSG 0x0001
+//#define MEIF_ERROR_MSG 0x0002 or 0x0003
+#define MEIF_STATE_REPORT_MSG 0x0004
+#define MEIF_CONFIG_VALUES_MSG 0x0008
+
+/*
+ * Data
+ */
+
+/*
+ * Structures
+ */
+
+struct meif_message {
+ uint16_t command;
+ uint16_t length;
+ void *data;
+} __attribute__((__packed__));
+
+struct meif_config_values_report {
+ uint8_t unknown1[36];
+ char vendor[16];
+ char product[16];
+ uint8_t unknown2[2];
+} __attribute__((__packed__));
+
+/*
+ * Functions
+ */
+
+void meif_read_loop(int fd);
+
+#endif