X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fsensor.h;h=a2590365ecf3f484bdef615c9e4ca505ed4a9a40;hb=519940987ceb9e379c91645daba84dc87680ffb8;hp=4009e5ade58b06a58ca175416d0fd0239b0f3622;hpb=7ca215713fa73c84ba0b46c9e7299386bd5cf5b8;p=matches%2FMCTX3420.git diff --git a/server/sensor.h b/server/sensor.h index 4009e5a..a259036 100644 --- a/server/sensor.h +++ b/server/sensor.h @@ -20,7 +20,7 @@ typedef struct { /** Time at which data was taken **/ - float time; + struct timeval time_stamp; //TODO: Consider; use float instead? /** Value of data **/ float value; } DataPoint; @@ -29,7 +29,7 @@ typedef struct typedef struct { /** ID number of the sensor **/ - enum {SENSOR_TEST0=0, SENSOR_TEST1=1, SENSOR_NONE} id; + enum {SENSOR_TEST0=0, SENSOR_TEST1=1} id; /** Buffer to store data from the sensor **/ DataPoint buffer[SENSOR_DATABUFSIZ]; /** Index of last point written in the data buffer **/ @@ -46,10 +46,10 @@ typedef struct } Sensor; -/** Array of Sensors **/ -extern Sensor g_sensors[]; -extern void Sensor_Init(Sensor * s, int id); // Initialise sensor + +extern void Sensor_Spawn(); // Initialise sensor +extern void Sensor_Join(); //Join sensor threads extern void * Sensor_Main(void * args); // main loop for sensor thread; pass a Sensor* cast to void* extern int Sensor_Query(Sensor * s, DataPoint * buffer, int bufsiz); // fill buffer with sensor data