Added a GPIO to power on/off for external I2C sensor(s) (with LEDs)
Dependencies: UniGraphic mbed vt100
edge_sensor Class Reference
edge_sensor super class of each sensor manager class More...
#include <edge_sensor.h>
Inherited by edge_accel, edge_color, edge_pressure, and edge_temp.
Public Member Functions | |
| edge_sensor () | |
| constructor | |
| ~edge_sensor () | |
| destructor | |
| virtual void | reset (void) |
| reset reset property valuse of edge_sensor | |
| virtual void | setId (uint16_t id) |
| assign _id manually | |
| virtual void | enable (void) |
| enable the edge_sensor | |
| virtual void | disable (void) |
| disable the edge_sensor | |
| virtual bool | isEnabled (void) |
| test if the edge_sensor is enabled (or not) | |
| virtual void | prepare (void) |
| prepare the sensor for sampling | |
| virtual int | sample (void) |
| sample trigger sampling action of the sensor and acquire the data | |
| virtual int | deliver (void) |
| deliver the sampled data to the afero cloud via setAttributes | |
| virtual void | show (void) |
| show the value(s) to the display (TFT) | |
| virtual void | toJson (char *buf) |
| toJson convert sampled data to json format | |
| virtual void | displayTime (int32_t ts) |
| display timestamp in human readable format ts int32_t timestamp value to display | |
| void | setInterval (uint16_t interval) |
| setInterval assign sampling interval time (in sec) | |
| uint16_t | getInterval (void) |
| getInterval get sampling interval time (in sec) | |
| int | getStatus (void) |
| getStatus get current status of the state machine | |
| int | advanceStatus (void) |
| advanceStatus proceed status into the next state | |
| virtual int | runStateMachine (void) |
| runStateMachine run the statemachine for single cycle | |
Detailed Description
edge_sensor super class of each sensor manager class
Definition at line 12 of file edge_sensor.h.
Constructor & Destructor Documentation
| edge_sensor | ( | ) |
constructor
Definition at line 11 of file edge_sensor.cpp.
| ~edge_sensor | ( | ) |
destructor
Definition at line 22 of file edge_sensor.cpp.
Member Function Documentation
| int advanceStatus | ( | void | ) |
advanceStatus proceed status into the next state
- Returns:
- advanced status
| int deliver | ( | void | ) | [virtual] |
deliver the sampled data to the afero cloud via setAttributes
Reimplemented in edge_accel, edge_color, edge_pressure, and edge_temp.
Definition at line 58 of file edge_sensor.cpp.
| void disable | ( | void | ) | [virtual] |
disable the edge_sensor
Definition at line 36 of file edge_sensor.cpp.
| void displayTime | ( | int32_t | ts ) | [virtual] |
display timestamp in human readable format ts int32_t timestamp value to display
Definition at line 70 of file edge_sensor.cpp.
| void enable | ( | void | ) | [virtual] |
enable the edge_sensor
Definition at line 31 of file edge_sensor.cpp.
| uint16_t getInterval | ( | void | ) |
getInterval get sampling interval time (in sec)
- Returns:
- the interval time in uint16_t
Definition at line 103 of file edge_sensor.cpp.
| int getStatus | ( | void | ) |
getStatus get current status of the state machine
- Returns:
- current status as int
Definition at line 108 of file edge_sensor.cpp.
| bool isEnabled | ( | void | ) | [virtual] |
test if the edge_sensor is enabled (or not)
- Returns:
- true: the sensor is enabled false: the sensor is disabled
Definition at line 41 of file edge_sensor.cpp.
| void prepare | ( | void | ) | [virtual] |
prepare the sensor for sampling
Reimplemented in edge_color, edge_pressure, and edge_temp.
Definition at line 46 of file edge_sensor.cpp.
| void reset | ( | void | ) | [virtual] |
reset reset property valuse of edge_sensor
Reimplemented in edge_accel, edge_color, edge_pressure, and edge_temp.
Definition at line 26 of file edge_sensor.cpp.
| int runStateMachine | ( | void | ) | [virtual] |
runStateMachine run the statemachine for single cycle
- Returns:
- the result status
Definition at line 122 of file edge_sensor.cpp.
| int sample | ( | void | ) | [virtual] |
sample trigger sampling action of the sensor and acquire the data
- Returns:
- 0:success non-0:failure
Reimplemented in edge_accel, edge_color, edge_pressure, and edge_temp.
Definition at line 51 of file edge_sensor.cpp.
| virtual void setId | ( | uint16_t | id ) | [virtual] |
assign _id manually
Definition at line 32 of file edge_sensor.h.
| void setInterval | ( | uint16_t | interval ) |
setInterval assign sampling interval time (in sec)
- Parameters:
-
interval uint16_t the value to assign
Definition at line 98 of file edge_sensor.cpp.
| void show | ( | void | ) | [virtual] |
show the value(s) to the display (TFT)
Reimplemented in edge_accel, edge_color, edge_pressure, and edge_temp.
Definition at line 65 of file edge_sensor.cpp.
| void toJson | ( | char * | buf ) | [virtual] |
toJson convert sampled data to json format
- Parameters:
-
buf char* string buf to store the json string
Definition at line 93 of file edge_sensor.cpp.
Generated on Wed Jul 13 2022 12:25:10 by
1.7.2
La Suno