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

PM1, PM4, PM10 standard sensors added

parent 117f1d9a
......@@ -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, Methane ).',
'+ 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 PM1+PM2.5+PM4+PM10, 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.' ,
......@@ -127,6 +127,18 @@ iqrf.sensor.STD_SENSOR_TYPE_METHANE = 0x17;
Short length sensor.
*/
iqrf.sensor.STD_SENSOR_TYPE_SHORT_LENGTH = 0x18;
/* Const: iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM1
Particulates PM1 sensor.
*/
iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM1 = 0x19;
/* Const: iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM4
Particulates PM4 sensor.
*/
iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM4 = 0x1A;
/* Const: iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM10
Particulates PM10 sensor.
*/
iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM10 = 0x1B;
// 1 byte
/* Const: iqrf.sensor.STD_SENSOR_TYPE_RELATIVE_HUMIDITY
......@@ -419,6 +431,33 @@ iqrf.sensor.SensorTypes[iqrf.sensor.STD_SENSOR_TYPE_SHORT_LENGTH] =
decimalPlaces: 3,
frcs: [iqrf.sensor.STD_SENSOR_FRC_2BYTES]
};
iqrf.sensor.SensorTypes[iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM1] =
{
id: 'PARTICULATES_PM1',
name: 'Particulates PM1',
shortName: 'PM1',
unit: 'µg/m3',
decimalPlaces: 2,
frcs: [iqrf.sensor.STD_SENSOR_FRC_2BYTES]
};
iqrf.sensor.SensorTypes[iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM4] =
{
id: 'PARTICULATES_PM4',
name: 'Particulates PM4',
shortName: 'PM4',
unit: 'µg/m3',
decimalPlaces: 2,
frcs: [iqrf.sensor.STD_SENSOR_FRC_2BYTES]
};
iqrf.sensor.SensorTypes[iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM10] =
{
id: 'PARTICULATES_PM10',
name: 'Particulates PM10',
shortName: 'PM10',
unit: 'µg/m3',
decimalPlaces: 2,
frcs: [iqrf.sensor.STD_SENSOR_FRC_2BYTES]
};
// 1 byte
iqrf.sensor.SensorTypes[iqrf.sensor.STD_SENSOR_TYPE_RELATIVE_HUMIDITY] =
......@@ -813,6 +852,9 @@ iqrf.sensor.ReadSensorsWithTypes_Response = function ( response, request )
break;
case iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM25:
case iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM1:
case iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM4:
case iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM10:
sensorValue = responseData[index] + ( responseData[index + 1] * 0x100 );
sensorValue = sensorValue === 0x8000 ? NaN : sensorValue / 4.0;
break;
......@@ -1157,6 +1199,9 @@ iqrf.sensor.Frc_Response = function ( sensorType, frcCommand, responseFrcSend, r
case iqrf.sensor.STD_SENSOR_TYPE_POWER:
case iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM25:
case iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM1:
case iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM4:
case iqrf.sensor.STD_SENSOR_TYPE_PARTICULATES_PM10:
value = ( frcValue - 4 ) / 4.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