Skip to content

Commit 3ec7545

Browse files
committed
Change decodePulseTrain uint8_t length to uint16_t
1 parent a5cc4e9 commit 3ec7545

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/PiCode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ int PiCode::stringToPulseTrain(const char* data, uint32_t* pulses, size_t maxlen
253253
}
254254

255255
/* Decode from array of pulses to json as dynamic char*. Must be free() after use */
256-
char* PiCode::decodePulseTrain(uint32_t* pulses, uint8_t length, const char* indent){
256+
char* PiCode::decodePulseTrain(uint32_t* pulses, uint16_t length, const char* indent){
257257
size_t matches = 0;
258258

259259
char *result = nullptr;
@@ -325,7 +325,7 @@ char* PiCode::decodeString(const char* pilight_string){
325325
if (pilight_string != nullptr){
326326
n_pulses = stringToPulseTrain(pilight_string, pulses, 255);
327327
if (n_pulses > 0){
328-
result = decodePulseTrain(pulses, (uint8_t)n_pulses);
328+
result = decodePulseTrain(pulses, (uint16_t)n_pulses);
329329
if (result!=nullptr){
330330
if (strlen(result) < 4){ // emply json []
331331
free(result);

src/PiCode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class PiCode {
6161
int stringToPulseTrain(const char* data, uint32_t* pulses, size_t maxlength);
6262

6363
/* Decode from array of pulses to json as dynamic char*. Must be free() after use */
64-
char* decodePulseTrain(uint32_t* pulses, uint8_t length, const char* indent = " ");
64+
char* decodePulseTrain(uint32_t* pulses, uint16_t length, const char* indent = " ");
6565

6666
/* Decode from pilight string. Must be free() after use */
6767
char* decodeString(const char* pilight_string);

0 commit comments

Comments
 (0)