From ab49da9b22b81188a5cf4d3daa27de218d8cb2e0 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Tue, 14 Aug 2012 14:07:33 +0200 Subject: GPSD: Switch protocol after patch upload and send the first unknown bytes Signed-off-by: Paul Kocialkowski --- meif.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'meif.c') 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; + } } -- cgit v1.2.3