src/Sensor.cpp
/// <summary>
/// Sends the specific action to start/stop/get/onChange the sensor using a delta and interval.
/// </summary>
/// <param name="sensorAction">The sensor action.</param>
/// <param name="delta">The delta.</param>
/// <param name="interval">The interval.</param>
/// <returns>int.</returns>

Sends the specific action to start/stop/get/onChange the sensor using a delta and interval.
Sends the specific action to start / stop / get / onChange the sensor using a delta and interval .
int Sensor::sensorAction(SensorAction sensorAction, double delta, long interval) const {
#ifdef debugSerial
	if (sensorAction > 0)
	{
		Serial.print("starting...");
	}
#endif
	const char sensorTypeSet[2] = { sensorType, '\0' };
	EPtr eptr2 = EPtr(sensorTypeSet, static_cast<int>(sensorAction));
	eptr2.keyIsMem = true;
	EPtr none = EPtr(None);
	EPtr eptrs[] = {
		EPtr(ArrayStart, SENSORS),
		eptr2,
		delta > 0 ? EPtr(DELTA, delta) : none,
		interval > 0 ? EPtr(INTERVAL, interval) : none,
		EPtr(ArrayEnd)
	};
	int id = this->shield.writeAll(SERVICE_SENSORS, eptrs, 5);
#ifdef debugSerial
	if (sensorAction < 2)
	{
		Serial.print("stopping...");
	}
#endif
	return id;
}
int Sensor :: sensorAction ( SensorAction sensorAction , double delta , long interval ) const { #ifdef debugSerial if ( sensorAction > 0 ) { Serial . print ( " " ) ; } #endif const char sensorTypeSet [ 2 ] = { sensorType , ' \0 ' } ; EPtr eptr2 = EPtr ( sensorTypeSet , static_cast < int > ( sensorAction ) ) ; eptr2 . keyIsMem = true ; EPtr none = EPtr ( None ) ; EPtr eptrs [ ] = { EPtr ( ArrayStart , SENSORS ) , eptr2 , delta > 0 ? EPtr ( DELTA , delta ) : none , interval > 0 ? EPtr ( INTERVAL , interval ) : none , EPtr ( ArrayEnd ) } ; int id = this -> shield . writeAll ( SERVICE_SENSORS , eptrs , 5 ) ; #ifdef debugSerial if ( sensorAction < 2 ) { Serial . print ( " " ) ; } #endif return id ; }
<summary>
Sends the specific action to start/stop/get/onChange the sensor using a delta and interval.
<summary > Sends the specific action to start / stop / get / onChange the sensor using a delta and interval .