-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDev_THSensor.h
49 lines (42 loc) · 1.23 KB
/
Dev_THSensor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* @file Dev_THSensor.h
*
* THSensor API of IoTgo (iotgo.iteadstudio.com)
*
* @author Wu Pengfei (email:<[email protected]>)
* @date 2014/11/17
* @copyright
* Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
#ifndef __DEV_THSENSOR_H__
#define __DEV_THSENSOR_H__
#include "IoTgo.h"
#include "Dev_THSensorInterface.h"
/**
* @addtogroup THSensor
* @{
*/
/**
* THSensor, subclass of IoTgo, provides simple methods to read temperature and
* humidity from devices.
*/
class THSensor: public IoTgo
{
public: /* public methods */
THSensor(NetInterface *net, THSensorInterface *sensor);
int32_t begin(void);
int32_t end(void);
int32_t sync(void);
int32_t getTemperatureC(float *temp_c);
int32_t getTemperatureF(float *temp_f);
int32_t getHumidity(float *hum);
int32_t getAll(float *temp_c, float *temp_f, float *hum);
private: /* private data */
THSensorInterface *sensor;
};
/** @} */
#endif /* #ifndef __DEV_THSENSOR_H__ */