Commit ffdd84d1 authored by Hynek Syrovátka's avatar Hynek Syrovátka 🇨🇿
Browse files

Methane quantity added

parent 7360e8d7
......@@ -10,7 +10,7 @@ See also: <https://www.iqrfalliance.org/techDocs/>
'Internal' : false,
'Versions' : [
{ 'Version' : 15, 'Notes' : [
'+ New quantities added (TimeSpan, Illuminance, NO2 (nitrogen dioxide), SO2 (sulfur dioxide), CO (carbon monoxide), O3 (ozone), Atmospheric Pressure, Color Temperature, TimeSpanLong, UV Index, Sound Pressure Level, Particulates PM2.5, Data Block, Altitude, Acceleration, pH, Ammonia[partly] ).',
'+ New quantities added (TimeSpan, Illuminance, NO2 (nitrogen dioxide), SO2 (sulfur dioxide), CO (carbon monoxide), O3 (ozone), Atmospheric Pressure, Color Temperature, TimeSpanLong, UV Index, Sound Pressure Level, Particulates PM2.5, Data Block, Altitude, Acceleration, pH, Ammonia, Methane ).',
'+ 4 bytes FRC added.',
'! Fixed negative numbers calculation for signed quantities.' ,
'! Fixed computation of Earth’s Magnetic Field value.' ,
......@@ -123,7 +123,6 @@ Ammonia sensor.
*/
iqrf.sensor.STD_SENSOR_TYPE_NH3 = 0x16;
/* Const: iqrf.sensor.STD_SENSOR_TYPE_METHANE
Methane. _Note: not fully implemented yet_
*/
iqrf.sensor.STD_SENSOR_TYPE_METHANE = 0x17;
......@@ -400,6 +399,15 @@ iqrf.sensor.SensorTypes[iqrf.sensor.STD_SENSOR_TYPE_NH3] =
decimalPlaces: 1,
frcs: [iqrf.sensor.STD_SENSOR_FRC_2BYTES]
};
iqrf.sensor.SensorTypes[iqrf.sensor.STD_SENSOR_TYPE_METHANE] =
{
id: 'METHANE',
name: 'Methane',
shortName: 'CH4',
unit: '%',
decimalPlaces: 3,
frcs: [iqrf.sensor.STD_SENSOR_FRC_2BYTES]
};
// 1 byte
iqrf.sensor.SensorTypes[iqrf.sensor.STD_SENSOR_TYPE_RELATIVE_HUMIDITY] =
......@@ -767,6 +775,7 @@ iqrf.sensor.ReadSensorsWithTypes_Response = function ( response, request )
case iqrf.sensor.STD_SENSOR_TYPE_MAINS_FREQUENCY:
case iqrf.sensor.STD_SENSOR_TYPE_NO2:
case iqrf.sensor.STD_SENSOR_TYPE_SO2:
case iqrf.sensor.STD_SENSOR_TYPE_METHANE:
sensorValue = responseData[index] + ( responseData[index + 1] * 0x100 );
sensorValue = sensorValue === 0xFfFf ? NaN : sensorValue / 1000.0;
break;
......@@ -1122,6 +1131,7 @@ iqrf.sensor.Frc_Response = function ( sensorType, frcCommand, responseFrcSend, r
case iqrf.sensor.STD_SENSOR_TYPE_MAINS_FREQUENCY:
case iqrf.sensor.STD_SENSOR_TYPE_NO2:
case iqrf.sensor.STD_SENSOR_TYPE_SO2:
case iqrf.sensor.STD_SENSOR_TYPE_METHANE:
value = ( frcValue - 4 ) / 1000.0;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment