summaryrefslogtreecommitdiffstats
path: root/meif.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 /meif.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 'meif.c')
-rw-r--r--meif.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/meif.c b/meif.c
index 39e9f62..b0a5830 100644
--- a/meif.c
+++ b/meif.c
@@ -30,6 +30,8 @@
#include "meif.h"
+#define RC_SWITCH_PROTOCOL -4
+
/*
* Utils
*/
@@ -445,7 +447,7 @@ int meif_dispatch(struct meif_message *meif_message)
patch_send_stage = 3;
printf("Ready to switch protocol!\n");
- return -1;
+ return RC_SWITCH_PROTOCOL;
}
break;
case MEIF_NACK_MSG:
@@ -634,4 +636,10 @@ void meif_read_loop(int fd)
meif_message_free(meif_message);
}
}
+
+ switch(rc) {
+ case RC_SWITCH_PROTOCOL:
+ bcm4751_switch_protocol(fd);
+ break;
+ }
}