#include "yocto_api.h"
#include <cfloat>
#include <cmath>
#include <map>
Go to the source code of this file.
#define _Y_ISPRESENT_ENUM |
#define _Y_PROXIMITYREPORTMODE_ENUM |
typedef void(* YProximityValueCallback) (YProximity *func, const string &functionValue) |
Enumerator |
---|
Y_ISPRESENT_FALSE |
|
Y_ISPRESENT_TRUE |
|
Y_ISPRESENT_INVALID |
|
Definition at line 59 of file yocto_proximity.h.
Enumerator |
---|
Y_PROXIMITYREPORTMODE_NUMERIC |
|
Y_PROXIMITYREPORTMODE_PRESENCE |
|
Y_PROXIMITYREPORTMODE_PULSECOUNT |
|
Y_PROXIMITYREPORTMODE_INVALID |
|
Definition at line 67 of file yocto_proximity.h.
Retrieves a proximity sensor for a given identifier. The identifier can be specified using several formats:
-
FunctionLogicalName
-
ModuleSerialNumber.FunctionIdentifier
-
ModuleSerialNumber.FunctionLogicalName
-
ModuleLogicalName.FunctionIdentifier
-
ModuleLogicalName.FunctionLogicalName
This function does not require that the proximity sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method YProximity.isOnline() to test if the proximity sensor is indeed online at a given time. In case of ambiguity when looking for a proximity sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
- Parameters
-
func | : a string that uniquely characterizes the proximity sensor |
- Returns
- a YProximity object allowing you to drive the proximity sensor.
Definition at line 421 of file yocto_proximity.h.
Starts the enumeration of proximity sensors currently accessible. Use the method YProximity.nextProximity() to iterate on next proximity sensors.
- Returns
- a pointer to a YProximity object, corresponding to the first proximity sensor currently online, or a NULL pointer if there are none.
Definition at line 432 of file yocto_proximity.h.