Cayenne-LPP avec NFC

Dependents:   er4_2022

Files at this revision

API Documentation at this revision

Comitter:
superphil06
Date:
Tue Feb 08 09:03:59 2022 +0000
Parent:
7:8509fb453a2e
Commit message:
add addVEHICLE function

Changed in this revision

README.md Show annotated file Show diff for this revision Revisions of this file
src/CayenneLPP.cpp Show annotated file Show diff for this revision Revisions of this file
src/CayenneLPP.h Show annotated file Show diff for this revision Revisions of this file
diff -r 8509fb453a2e -r 2b94df050b00 README.md
--- a/README.md	Fri Mar 12 08:12:27 2021 +0000
+++ b/README.md	Tue Feb 08 09:03:59 2022 +0000
@@ -1,4 +1,5 @@
 # Cayenne Low Power Payload
+# 8_2_2022 add addVEHICLE () function to send 8 ascii character representing Vehicle ID
 Payload builder library
 
 
diff -r 8509fb453a2e -r 2b94df050b00 src/CayenneLPP.cpp
--- a/src/CayenneLPP.cpp	Fri Mar 12 08:12:27 2021 +0000
+++ b/src/CayenneLPP.cpp	Tue Feb 08 09:03:59 2022 +0000
@@ -124,6 +124,17 @@
     return cursor;
 }
 
+uint8_t CayenneLPP::addVEHICLE(uint8_t channel, char * VEH)
+{
+    int index;
+    buffer[cursor++] = channel;
+    for (index=0; index <4; index++) {
+        buffer[cursor++]=VEH[index]  ;
+    }
+    return cursor;
+}
+
+
 
 uint8_t CayenneLPP::addTemperature(uint8_t channel, float celsius)
 {
diff -r 8509fb453a2e -r 2b94df050b00 src/CayenneLPP.h
--- a/src/CayenneLPP.h	Fri Mar 12 08:12:27 2021 +0000
+++ b/src/CayenneLPP.h	Tue Feb 08 09:03:59 2022 +0000
@@ -60,6 +60,7 @@
         uint8_t addGyrometer(uint8_t channel, float x, float y, float z);
         uint8_t addGPS(uint8_t channel, float latitude, float longitude, float meters);
         uint8_t addNFC(uint8_t channel, char * NFC);
+        uint8_t addVEHICLE(uint8_t channel, char * VEH);
     
     private:
         uint8_t *buffer;