summaryrefslogtreecommitdiff
path: root/garmin.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2006-09-27 01:27:32 +0000
committerGary E. Miller <gem@rellim.com>2006-09-27 01:27:32 +0000
commit9838bb9cb6e66c2a000881c1f7461c699e6b5af0 (patch)
treee862d1f7c0930447f78c06cb2777e252834f04d5 /garmin.c
parent7a0d4835d204b36b056a02d04ee75c1da2392c55 (diff)
downloadgpsd-9838bb9cb6e66c2a000881c1f7461c699e6b5af0.tar.gz
Fix Garmin USB as broken by recent Garmin Serial Binary changes
Diffstat (limited to 'garmin.c')
-rw-r--r--garmin.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/garmin.c b/garmin.c
index 27834430..50f61afa 100644
--- a/garmin.c
+++ b/garmin.c
@@ -232,7 +232,7 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id
cpo_sat_data *sats = NULL;
cpo_pvt_data *pvt = NULL;
- gpsd_report(4, "PrintSERParse(, %#02x, %02x, )\n", pkt_id, pkt_len);
+ gpsd_report(4, "PrintSERParse(, %#02x, %#02x, )\n", pkt_id, pkt_len);
switch( pkt_id ) {
case GARMIN_PKTID_L001_COMMAND_DATA:
@@ -432,7 +432,7 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id
, pkt_id, pkt_len);
break;
}
- gpsd_report(3, "PrintSERParse(, %#02x, %02x, ) = %#02x\n"
+ gpsd_report(3, "PrintSERParse(, %#02x, %#02x, ) = %#02x\n"
, pkt_id, pkt_len, mask);
return mask;
}
@@ -485,7 +485,8 @@ static gps_mask_t PrintUSBPacket(struct gps_device_t *session, Packet_t *pkt)
case GARMIN_LAYERID_APPL:
/* raw data transport, shared with Garmin Serial Driver */
- mask = PrintSERPacket(session, pkt->mPacketId, mDataSize, buf );
+ mask = PrintSERPacket(session, (unsigned char)pkt->mPacketId
+ , (int)mDataSize, pkt->mData.uchars );
break;
case 75:
@@ -588,6 +589,11 @@ static int GetPacket (struct gps_device_t *session )
gpsd_report(4, "GetPacket()\n");
+//delay.tv_sec = 0;
+//delay.tv_nsec = 33300000L;
+//while (nanosleep(&delay, &rem) < 0)
+// continue;
+
for( cnt = 0 ; cnt < 10 ; cnt++ ) {
// Read async data until the driver returns less than the
// max async data size, which signifies the end of a packet
@@ -712,7 +718,8 @@ static bool garmin_probe(struct gps_device_t *session)
buffer = (uint8_t *)session->driver.garmin.Buffer;
thePacket = (Packet_t*)buffer;
- // set Mode 0
+ // set Mode 1, mode 0 is broken somewhere past 2.6.14
+ // but how?
set_int32(buffer, GARMIN_LAYERID_PRIVATE);
set_int32(buffer+4, PRIV_PKTID_SET_MODE);
set_int32(buffer+8, 4); // data length 4