void addSensor(int thing_id, char *sensor_name, int period, int sensing_period, float power_consumption, float operating_voltage)
Add a sensor to a thing
thing_id - Thing number to add
sensor_name - Sensor name to add
period - Sensor operation period
sensing_period - Sensing minimum period
power_consumption - Sensing power consumption (mW)
operating_voltage - Operating voltage(V)
void newSensor(int thing_id, char *sensor_name, int period, int sensing_period, float power_consumption, float operating_voltage)
Generate sensor information
thing_id - Thing number to add
sensor_name - Sensor name to add
period - Sensor operation period
sensing_period - Sensing minimum period
power_consumption - Sensing power consumption(mW)
operating_voltage - Operating voltage(V)
void initSensorList(TCB *tcb)
Initialize sensor list
tcb - TCB of sensor list to initialize
struct _sensor* getSensor(int thing_id)
Return a list of sensors that a thing has
thing_id - Thing number
RETURN - Sensor list of a thing
void setName(int thing_id, char *sensor_name)
Set sensor name
thing_id - Thing number
sensor_name - Sensor name to set
void setPeriod(int thing_id, int period)
Set sensor period
thing_id - Thing number
period - Period to set
void setSeonsorPowerConsumption(int thing_id, int power_consumption)
Set sensor power consumption
thing_id - Thing number
power_consumption - Power consumption to set
int getSeonsorPowerConsumption(int thing_id)
Return power consumption of sensor
thing_id - Thing number
RETURN - Power consumption
int getSensorValue(int thing_id, char *sensor_name)
Return sensing data
thing_id - Thing number
sensor_name - Sensor name to operate
RETURN - Sensing data or -1(no sensor)
int operateSensor(struct _sensor *sensor, int thing_id)
Operate sensor
sensor - Sensor list
thing_id - Thing number
RETURN - Sensing data or -1(no sensor)
struct _sensor* findSensor(struct _sensor *sensor, char *sensor_name)
Verify that the sensor is in the sensor list
sensor - Sensor list
sensor_name - Sensor name to find
RETURN - Sensor information or NULL
void freeSensor()
Free sensor resource
void printSensorList(int thing_id)
Print sensor list
thing_id - Thing number