endpoint including temperature and distance sensors
Dependencies: mbed mbedConnectorInterface mbedEndpointNetwork TrashSensors
Fork of TempAndDistTest by
resource/DistanceResource.h@7:939fdc8df95b, 2015-05-06 (annotated)
- Committer:
- coyotebush
- Date:
- Wed May 06 02:53:36 2015 +0000
- Revision:
- 7:939fdc8df95b
Add DistanceResource
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
coyotebush | 7:939fdc8df95b | 1 | #ifndef DISTANCE_RESOURCE_H |
coyotebush | 7:939fdc8df95b | 2 | #define DISTANCE_RESOURCE_H |
coyotebush | 7:939fdc8df95b | 3 | |
coyotebush | 7:939fdc8df95b | 4 | #include "DynamicResource.h" |
coyotebush | 7:939fdc8df95b | 5 | #include "hcsr04.h" |
coyotebush | 7:939fdc8df95b | 6 | |
coyotebush | 7:939fdc8df95b | 7 | class DistanceResource : public DynamicResource { |
coyotebush | 7:939fdc8df95b | 8 | public: |
coyotebush | 7:939fdc8df95b | 9 | DistanceResource(const Logger *logger, const char *name, HCSR04 *sensor, const bool observable = false) |
coyotebush | 7:939fdc8df95b | 10 | : DynamicResource(logger, name, "DistanceResource", SN_GRS_GET_ALLOWED, observable), sensor(sensor) |
coyotebush | 7:939fdc8df95b | 11 | {} |
coyotebush | 7:939fdc8df95b | 12 | |
coyotebush | 7:939fdc8df95b | 13 | virtual string get(); |
coyotebush | 7:939fdc8df95b | 14 | private: |
coyotebush | 7:939fdc8df95b | 15 | HCSR04 *sensor; |
coyotebush | 7:939fdc8df95b | 16 | }; |
coyotebush | 7:939fdc8df95b | 17 | |
coyotebush | 7:939fdc8df95b | 18 | #endif |