Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Latest commit

 

History

History
50 lines (31 loc) · 1001 Bytes

CayenneLPPDecode.md

File metadata and controls

50 lines (31 loc) · 1001 Bytes

API Reference

The CayenneLPPDecode class enables Arduino devices to decode data with the Cayenne Low Power Payload (LPP). Read more about Cayenne LPP

Class: CayenneLPPDecode

Include and instantiate the CayenneLPPDecode class. The constructor takes the size of the allocated buffer.

#include <CayenneLPPDecode.h>

CayenneLPPDecode lppd;
CayenneLPPDecode lppd(uint8_t size);
  • uint8_t size: The maximum payload size to send, default 64.

Method: reset

Resets the buffer.

void reset(void);

Method: write

Writes binary data to the buffer.

size_t write(val);
size_t write(buf, len);

Method: decode

Decode buffer to the JsonObject root, check ArduinoJson library.

void decode(JsonObject &root);

Method: isValid

This function checks if the buffer is a CayenneLPP valid payload.

bool isValid();