summaryrefslogtreecommitdiff
path: root/libgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-05-26 03:31:10 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-05-26 03:31:10 +0000
commitcfa56298e82f1a68f3f1e752fc26724cedd96b6a (patch)
tree811879f99f6075eb74e5b93de6ac9235d5ea2294 /libgps.c
parent358bb84f5e6e0c4b31a3085c4690cd7c3e633d2c (diff)
downloadgpsd-cfa56298e82f1a68f3f1e752fc26724cedd96b6a.tar.gz
Change API so raw_hook takes a length argument; supports dumping binary packets.
Diffstat (limited to 'libgps.c')
-rw-r--r--libgps.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libgps.c b/libgps.c
index f60ed979..a1d03114 100644
--- a/libgps.c
+++ b/libgps.c
@@ -131,7 +131,8 @@ int gps_close(struct gps_data_t *gpsdata)
return retval;
}
-void gps_set_raw_hook(struct gps_data_t *gpsdata, void (*hook)(struct gps_data_t *, char *, int level))
+void gps_set_raw_hook(struct gps_data_t *gpsdata,
+ void (*hook)(struct gps_data_t *, char *, int len, int level))
{
gpsdata->raw_hook = hook;
}
@@ -425,9 +426,9 @@ static void gps_unpack(char *buf, struct gps_data_t *gpsdata)
}
if (gpsdata->raw_hook)
- gpsdata->raw_hook(gpsdata, buf, 1);
+ gpsdata->raw_hook(gpsdata, buf, strlen(buf), 1);
if (gpsdata->thread_hook)
- gpsdata->thread_hook(gpsdata, buf, 1);
+ gpsdata->thread_hook(gpsdata, buf, strlen(buf), 1);
}
/*
@@ -488,7 +489,7 @@ static void *poll_gpsd(void *args)
}
int gps_set_callback(struct gps_data_t *gpsdata,
- void (*callback)(struct gps_data_t *sentence, char *buf, int level),
+ void (*callback)(struct gps_data_t *sentence, char *buf, int len, int level),
pthread_t *handler)
/* set an asynchronous callback and launch a thread for it */
{