Skip to content

Commit 39eddf7

Browse files
committed
Upgrade to PiCode library version v1.2
1 parent 57bd74b commit 39eddf7

File tree

11 files changed

+30
-9
lines changed

11 files changed

+30
-9
lines changed

src/picoder-convert.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#include "picoder-convert.h"
1010
#include <getopt.h>
1111

12+
typedef size_t rsize_t;
13+
#include <string.h>
14+
1215
#ifndef MAX_PULSES
1316
#define MAX_PULSES 255
1417
#endif

src/picoder-convert.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define PICODER_CONVERT_H
1111

1212
#include <PiCode.h>
13+
#include <stdio.h>
1314

1415
void convert_help(FILE* out = stdout);
1516

src/picoder-decode.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#include "picoder-decode.h"
1010
#include <getopt.h>
1111

12+
typedef size_t rsize_t;
13+
#include <string.h>
14+
1215
#ifndef MAX_PULSES
1316
#define MAX_PULSES 255
1417
#endif

src/picoder-decode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define PICODER_DECODE_H
1111

1212
#include <PiCode.h>
13+
#include <stdio.h>
1314

1415
void decode_help(FILE* out = stdout);
1516

src/picoder-encode.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int encode_cmd(int argc, char** argv){
7777
break;
7878
case 'j':
7979
if ((json == nullptr) && (json_data == nullptr)){
80-
if (json_validate(optarg)){
80+
if (cPiCode::json_validate(optarg)){
8181
json = optarg;
8282
}else{
8383
fprintf(stderr,"error: json '%s' invalid\n",optarg);
@@ -90,14 +90,14 @@ int encode_cmd(int argc, char** argv){
9090
break;
9191
case 'f':
9292
if ((json_data == nullptr) && (json == nullptr) && (protocol == nullptr)){
93-
if (json_validate(optarg)){
93+
if (cPiCode::json_validate(optarg)){
9494

9595
/* decode as root json */
96-
JsonNode* root_json = json_decode(optarg);
96+
cPiCode::JsonNode* root_json = cPiCode::json_decode(optarg);
9797
if (root_json != nullptr){
9898

9999
/* check for child */
100-
JsonNode* child_json = json_first_child(root_json);
100+
cPiCode::JsonNode* child_json = cPiCode::json_first_child(root_json);
101101
if (child_json != nullptr){
102102

103103
/* check for child key */
@@ -113,7 +113,7 @@ int encode_cmd(int argc, char** argv){
113113
fprintf(stderr, "error: protocol '%s' no encode support\n", child_json->key);
114114
error_flag--;
115115
}else{
116-
json_data = json_encode(child_json);
116+
json_data = cPiCode::json_encode(child_json);
117117
if (json_data != nullptr){
118118
json = json_data;
119119
}else{
@@ -126,12 +126,12 @@ int encode_cmd(int argc, char** argv){
126126
fprintf(stderr, "error: full json child no key\n");
127127
error_flag--;
128128
}
129-
json_delete(child_json);
129+
cPiCode::json_delete(child_json);
130130
}else{
131131
fprintf(stderr, "error: full json no child\n");
132132
error_flag--;
133133
}
134-
json_delete(root_json);
134+
cPiCode::json_delete(root_json);
135135
}else{
136136
fprintf(stderr, "error: full json decode fault\n");
137137
error_flag--;

src/picoder-encode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define PICODER_ENCODE_H
1111

1212
#include <PiCode.h>
13+
#include <stdio.h>
1314

1415
void encode_help(FILE* out = stdout);
1516

src/picoder-list.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#include "picoder-list.h"
1010
#include <getopt.h>
1111

12+
typedef size_t rsize_t;
13+
#include <string.h>
14+
1215
#define DEVTYPES 17
1316

1417
const char* devtype[DEVTYPES] = { "raw",

src/picoder-list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define PICODER_LIST_H
1111

1212
#include <PiCode.h>
13+
#include <stdio.h>
1314

1415
void list_help(FILE* out = stdout);
1516

src/picoder-show.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define PICODER_SHOW_H
1111

1212
#include <PiCode.h>
13+
#include <stdio.h>
1314

1415
void show_help(FILE* out = stdout);
1516

0 commit comments

Comments
 (0)