JSN-SR04_Gen3_RK
|
Structure passed to the callback when the distance has been retrieved. More...
#include <JSN-SR04_Gen3_RK.h>
Public Types | |
enum class | Status : int { SUCCESS = 0 , ERROR , RANGE_ERROR , BUSY , IN_PROGRESS , ENTER_ALARM , EXIT_ALARM } |
Status of the call. More... | |
Public Member Functions | |
Status | getStatus () const |
Get the Status value for this result. More... | |
bool | success () const |
Helper function to return true if the Status is SUCCESS. More... | |
Public Member Functions inherited from JSN_SR04_Gen3::Distance | |
Distance () | |
Construct a new Distance object with a distance of 0. | |
Distance (double valueM) | |
Construct a new Distance object with a distance in meters. More... | |
Distance (const Distance &value) | |
Construct a new Distance object from another Distance object. More... | |
Distance & | operator= (const Distance &value) |
Copy the distance value from another Distance object. More... | |
void | setDistanceM (double distanceM) |
Set the Distance in meters. More... | |
double | getDistanceM () const |
Get the Distance in meters. More... | |
void | cm (double cm) |
Set the distance in centimeters. More... | |
double | cm () const |
Get the value of the Distance in centimeters. More... | |
void | mm (double mm) |
Set the distance in millimeter. More... | |
double | mm () const |
Get the value of the Distance in millimeters. More... | |
void | inch (double inch) |
Set the distance in inches. More... | |
double | inch () const |
Get the value of the Distance in inches. More... | |
Data Fields | |
Status | status = Status::ERROR |
Current status value. | |
Data Fields inherited from JSN_SR04_Gen3::Distance | |
double | distanceM = 0.0 |
The value of the distance in meters. | |
Structure passed to the callback when the distance has been retrieved.
This includes a Status enum for the result status, and optionally a distance as this class is derived from class Distance. Thus you can use the inherited methods such as cm(), mm(), and inch() to get the distance in centimeters, millimeters, or inches, for example.
|
strong |
Status of the call.
|
inline |
Get the Status value for this result.
|
inline |
Helper function to return true if the Status is SUCCESS.