aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-03-05 09:45:38 -0500
committercnlohr <lohr85@gmail.com>2017-03-05 09:45:38 -0500
commit19d18fef008792e8918d4ded2dd7fa015bb2fedb (patch)
tree551ebefeab4d14937b3d5a22ebb67cc63721dceb
parent8967c5c82e6282bc1daeaca79619695da64b6dc5 (diff)
downloadlibsurvive-19d18fef008792e8918d4ded2dd7fa015bb2fedb.tar.gz
libsurvive-19d18fef008792e8918d4ded2dd7fa015bb2fedb.tar.bz2
Set max sensor # so it doesn't get confusd with -1 data.
-rw-r--r--src/survive_data.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/survive_data.c b/src/survive_data.c
index e55b640..ac640c6 100644
--- a/src/survive_data.c
+++ b/src/survive_data.c
@@ -11,7 +11,14 @@ void handle_lightcap( struct SurviveObject * so, struct LightcapElement * le )
struct SurviveContext * ctx = so->ctx;
//int32_t deltat = (uint32_t)le->timestamp - (uint32_t)so->last_master_time;
-// printf( "%s %d %d %d %d %d\n", so->codename, le->sensor_id, le->type, le->length, le->timestamp, le->timestamp-so->tsl );
+ //if( so->codename[0] != 'H' )
+ //printf( "*** %s %d %d %d %d %d\n", so->codename, le->sensor_id, le->type, le->length, le->timestamp, le->timestamp-so->tsl );
+
+ if( le->sensor_id > SENSORS_PER_OBJECT )
+ {
+ return;
+ }
+
so->tsl = le->timestamp;
if( le->length < 20 ) return; ///Assuming 20 is an okay value for here.