summaryrefslogtreecommitdiffstats
path: root/bcm4751_gpsd.c
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-08-14 14:07:33 +0200
committerPaul Kocialkowski <contact@paulk.fr>2012-08-14 14:07:33 +0200
commitab49da9b22b81188a5cf4d3daa27de218d8cb2e0 (patch)
tree1ce2011e6f10f4abd7e0769de70f1a940385ce37 /bcm4751_gpsd.c
parent76f203a125733a30964c5696e4dcb60c152db675 (diff)
downloadbcm4751-ab49da9b22b81188a5cf4d3daa27de218d8cb2e0.tar.gz
bcm4751-ab49da9b22b81188a5cf4d3daa27de218d8cb2e0.tar.bz2
bcm4751-ab49da9b22b81188a5cf4d3daa27de218d8cb2e0.zip
GPSD: Switch protocol after patch upload and send the first unknown bytes
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'bcm4751_gpsd.c')
-rw-r--r--bcm4751_gpsd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/bcm4751_gpsd.c b/bcm4751_gpsd.c
index d7cdc9c..690433a 100644
--- a/bcm4751_gpsd.c
+++ b/bcm4751_gpsd.c
@@ -253,6 +253,22 @@ void bcm4751_read_dump(int fd)
}
}
+void bcm4751_switch_protocol(int fd)
+{
+ uint8_t data1[] = { 0xff, 0x00, 0xfd, 0x40, 0x00, 0x00, 0xe6, 0xfc };
+ uint8_t data2[] = { 0xfe, 0x00, 0xfd, 0x6f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0xfc };
+ uint8_t data3[] = { 0xfe, 0x00, 0xfd, 0x6f, 0x3a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x34, 0xfc };
+
+ sleep(1);
+
+ printf("Sending unknown bytes!\n");
+ bcm4751_serial_write(fd, data1, sizeof(data1));
+ bcm4751_serial_write(fd, data2, sizeof(data2));
+ bcm4751_serial_write(fd, data3, sizeof(data3));
+
+ bcm4751_read_dump(fd);
+}
+
int main(void)
{
int fd = -1;