diff --git a/API.md b/API.md index 7cf8960..1772f9f 100644 --- a/API.md +++ b/API.md @@ -148,7 +148,7 @@ uint8_t addEnergy(uint8_t channel, float value); // in kWh (3 decimals) uint8_t addDirection(uint8_t channel, float value); // in degrees uint8_t addSwitch(uint8_t channel, uint32_t value); // 0 or 1 -uint8_t CayenneLPP::addConentration(uint8_t channel, uint32_t value); // 1 PPM unsigned - PPM means Parts per million 1PPM = 1 * 10 ^-6 = 0.000 001 +uint8_t CayenneLPP::addConcentration(uint8_t channel, uint32_t value); // 1 PPM unsigned - PPM means Parts per million 1PPM = 1 * 10 ^-6 = 0.000 001 uint8_t CayenneLPP::addColour(uint8_t channel, uint8_t r, uint8_t g, uint8_t b); // R: 255 G: 255 B: 255 ``` diff --git a/decoders/decoder.js b/decoders/decoder.js index 8cb16dc..11ebe45 100644 --- a/decoders/decoder.js +++ b/decoders/decoder.js @@ -28,7 +28,7 @@ * Frequency 3318 118 76 4 1 Hz Unsigned MSB * Percentage 3320 120 78 1 1% Unsigned * Altitude 3321 121 79 2 1m Signed MSB - * Conentration 3325 125 7D 2 1 PPM unsigned : 1pmm = 1 * 10 ^-6 = 0.000 001 + * Concentration 3325 125 7D 2 1 PPM unsigned : 1pmm = 1 * 10 ^-6 = 0.000 001 * Power 3328 128 80 2 1 W Unsigned MSB * Distance 3330 130 82 4 0.001m Unsigned MSB * Energy 3331 131 83 4 0.001kWh Unsigned MSB @@ -60,7 +60,7 @@ function lppDecode(bytes) { 118: {'size': 4, 'name': 'frequency', 'signed': false, 'divisor': 1}, 120: {'size': 1, 'name': 'percentage', 'signed': false, 'divisor': 1}, 121: {'size': 2, 'name': 'altitude', 'signed': true, 'divisor': 1}, - 125: {'size': 2, 'name': 'conentration', 'signed': false, 'divisor': 1}, + 125: {'size': 2, 'name': 'concentration', 'signed': false, 'divisor': 1}, 128: {'size': 2, 'name': 'power', 'signed': false, 'divisor': 1}, 130: {'size': 4, 'name': 'distance', 'signed': false, 'divisor': 1000}, 131: {'size': 4, 'name': 'energy', 'signed': false, 'divisor': 1000}, diff --git a/examples/Decode/Decode.ino b/examples/Decode/Decode.ino index ad60725..aae09da 100644 --- a/examples/Decode/Decode.ino +++ b/examples/Decode/Decode.ino @@ -47,7 +47,7 @@ void setup() lpp.addDirection(1 , 90); lpp.addSwitch(1 , 0); - lpp.addConentration(1 , 512); + lpp.addConcentration(1 , 512); lpp.addColour(1 , 64, 128, 255); diff --git a/examples/DecodeTTN/DecodeTTN.ino b/examples/DecodeTTN/DecodeTTN.ino index fbbc360..c8e5b7f 100644 --- a/examples/DecodeTTN/DecodeTTN.ino +++ b/examples/DecodeTTN/DecodeTTN.ino @@ -47,7 +47,7 @@ void setup() lpp.addDirection(1 , 90); lpp.addSwitch(1 , 0); - lpp.addConentration(1 , 512); + lpp.addConcentration(1 , 512); lpp.addColour(1 , 64, 128, 255); diff --git a/keywords.txt b/keywords.txt index 4765102..ed328c1 100644 --- a/keywords.txt +++ b/keywords.txt @@ -44,7 +44,7 @@ addEnergy KEYWORD2 addDirection KEYWORD2 addSwitch KEYWORD2 -addConentration KEYWORD2 +addConcentration KEYWORD2 addColour KEYWORD2 getTypeName KEYWORD2 diff --git a/src/CayenneLPP.cpp b/src/CayenneLPP.cpp index 4c9944f..a683b76 100644 --- a/src/CayenneLPP.cpp +++ b/src/CayenneLPP.cpp @@ -66,7 +66,7 @@ bool CayenneLPP::isType(uint8_t type) { if (LPP_GYROMETER == type) return true; if (LPP_GPS == type) return true; if (LPP_SWITCH == type) return true; - if (LPP_CONENTRATION == type) return true; + if (LPP_CONCENTRATION == type) return true; if (LPP_COLOUR == type) return true; return false; } @@ -96,7 +96,7 @@ const char * CayenneLPP::getTypeName(uint8_t type) { if (LPP_GYROMETER == type) return "gyrometer"; if (LPP_GPS == type) return "gps"; if (LPP_SWITCH == type) return "switch"; - if (LPP_CONENTRATION == type) return "conentration"; + if (LPP_CONCENTRATION == type) return "concentration"; if (LPP_COLOUR == type) return "colour"; return 0; } @@ -126,7 +126,7 @@ uint8_t CayenneLPP::getTypeSize(uint8_t type) { if (LPP_GYROMETER == type) return LPP_GYROMETER_SIZE; if (LPP_GPS == type) return LPP_GPS_SIZE; if (LPP_SWITCH == type) return LPP_SWITCH_SIZE; - if (LPP_CONENTRATION == type) return LPP_CONENTRATION_SIZE; + if (LPP_CONCENTRATION == type) return LPP_CONCENTRATION_SIZE; if (LPP_COLOUR == type) return LPP_COLOUR_SIZE; return 0; } @@ -155,7 +155,7 @@ uint32_t CayenneLPP::getTypeMultiplier(uint8_t type) { if (LPP_UNIXTIME == type) return LPP_UNIXTIME_MULT; if (LPP_GYROMETER == type) return LPP_GYROMETER_MULT; if (LPP_SWITCH == type) return LPP_SWITCH_MULT; - if (LPP_CONENTRATION == type) return LPP_CONENTRATION_MULT; + if (LPP_CONCENTRATION == type) return LPP_CONCENTRATION_MULT; if (LPP_COLOUR == type) return LPP_COLOUR_MULT; return 0; } @@ -306,8 +306,8 @@ uint8_t CayenneLPP::addSwitch(uint8_t channel, uint32_t value) { return addField(LPP_SWITCH, channel, value); } -uint8_t CayenneLPP::addConentration(uint8_t channel, uint32_t value) { - return addField(LPP_CONENTRATION, channel, value); +uint8_t CayenneLPP::addConcentration(uint8_t channel, uint32_t value) { + return addField(LPP_CONCENTRATION, channel, value); } uint8_t CayenneLPP::addColour(uint8_t channel, uint8_t r, uint8_t g, uint8_t b) diff --git a/src/CayenneLPP.h b/src/CayenneLPP.h index a4aa582..33e750a 100644 --- a/src/CayenneLPP.h +++ b/src/CayenneLPP.h @@ -25,7 +25,7 @@ #define LPP_FREQUENCY 118 // 4 bytes 1Hz unsigned #define LPP_PERCENTAGE 120 // 1 byte 1-100% unsigned #define LPP_ALTITUDE 121 // 2 byte 1m signed -#define LPP_CONENTRATION 125 // 2 bytes, 1 ppm unsigned +#define LPP_CONCENTRATION 125 // 2 bytes, 1 ppm unsigned #define LPP_POWER 128 // 2 byte, 1W, unsigned #define LPP_DISTANCE 130 // 4 byte, 0.001m, unsigned #define LPP_ENERGY 131 // 4 byte, 0.001kWh, unsigned @@ -61,7 +61,7 @@ #define LPP_GYROMETER_SIZE 6 #define LPP_GPS_SIZE 9 #define LPP_SWITCH_SIZE 1 -#define LPP_CONENTRATION_SIZE 2 +#define LPP_CONCENTRATION_SIZE 2 #define LPP_COLOUR_SIZE 3 // Multipliers @@ -90,7 +90,7 @@ #define LPP_GPS_LAT_LON_MULT 10000 #define LPP_GPS_ALT_MULT 100 #define LPP_SWITCH_MULT 1 -#define LPP_CONENTRATION_MULT 1 +#define LPP_CONCENTRATION_MULT 1 #define LPP_COLOUR_MULT 1 #define LPP_ERROR_OK 0 @@ -142,7 +142,7 @@ class CayenneLPP { uint8_t addEnergy(uint8_t channel, float value); uint8_t addDirection(uint8_t channel, float value); uint8_t addSwitch(uint8_t channel, uint32_t value); - uint8_t addConentration(uint8_t channel, uint32_t value); + uint8_t addConcentration(uint8_t channel, uint32_t value); uint8_t addColour(uint8_t channel, uint8_t r, uint8_t g, uint8_t b); protected: diff --git a/test/aunit/main.cpp b/test/aunit/main.cpp index c176ff0..690676d 100644 --- a/test/aunit/main.cpp +++ b/test/aunit/main.cpp @@ -197,8 +197,8 @@ testF(EncoderTest, Altitude) { compare(sizeof(expected), expected); } -testF(EncoderTest, Conentration) { - lpp->addConentration(4, 4079); +testF(EncoderTest, Concentration) { + lpp->addConcentration(4, 4079); uint8_t expected[] = {0x05,0x7D,0x0F,0xEF}; compare(sizeof(expected), expected); }