Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
[matches/MCTX3420.git] / server / sensor.c
index 8115a3b..2e0749e 100644 (file)
@@ -12,7 +12,7 @@
 
 /** Array of sensors, initialised by Sensor_Init **/
 static Sensor g_sensors[NUMSENSORS]; //global to this file
 
 /** Array of sensors, initialised by Sensor_Init **/
 static Sensor g_sensors[NUMSENSORS]; //global to this file
-static const char * g_sensor_names[] = {"analog_test0","analog_test1","digital_test0"};
+static const char * g_sensor_names[] = {"analog_test0","analog_test1","digital_test0","digital_test1"};
 /**
  * Read a data value from a sensor; block until value is read
  * @param sensor_id - The ID of the sensor
 /**
  * Read a data value from a sensor; block until value is read
  * @param sensor_id - The ID of the sensor
@@ -195,7 +195,7 @@ Sensor * Sensor_Identify(const char * id_str)
                return NULL;
        }
        // Bounds check
                return NULL;
        }
        // Bounds check
-       if (id < 0 || id > NUMSENSORS)
+       if (id < 0 || id >= NUMSENSORS)
                return NULL;
 
 
                return NULL;
 
 

UCC git Repository :: git.ucc.asn.au