Skip to content

Commit c57fece

Browse files
authored
Merge pull request #5 from GT50-SRL/develop
Fixed warnings. Ready for v1.0.2
2 parents 27fcefb + 08ba7cd commit c57fece

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

AlgoIoT.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// algoiot.cpp
2-
// v20231205-1
2+
// v20240415-1
33

44
// Work in progress
55
// TODO:
@@ -34,7 +34,7 @@
3434
#include "bip39enwords.h" // BIP39 english words to convert Algorand private key from mnemonics
3535
#include "algoiot.h"
3636

37-
// #define LIB_DEBUGMODE
37+
#define LIB_DEBUGMODE
3838
#define DEBUG_SERIAL Serial
3939

4040

@@ -154,7 +154,7 @@ const char* AlgoIoT::getTransactionID()
154154
// Public methods to add values to be written in the blockchain
155155
// Strongly typed; this helps towards adding ARC-2/MessagePack in the future
156156

157-
int AlgoIoT::dataAddInt8Field(char* label, const int8_t value)
157+
int AlgoIoT::dataAddInt8Field(const char* label, const int8_t value)
158158
{
159159
int len = 0;
160160

@@ -183,7 +183,7 @@ int AlgoIoT::dataAddInt8Field(char* label, const int8_t value)
183183
return ALGOIOT_NO_ERROR;
184184
}
185185

186-
int AlgoIoT::dataAddUInt8Field(char* label, const uint8_t value)
186+
int AlgoIoT::dataAddUInt8Field(const char* label, const uint8_t value)
187187
{
188188
int len = 0;
189189

@@ -212,7 +212,7 @@ int AlgoIoT::dataAddUInt8Field(char* label, const uint8_t value)
212212
return ALGOIOT_NO_ERROR;
213213
}
214214

215-
int AlgoIoT::dataAddInt16Field(char* label, const int16_t value)
215+
int AlgoIoT::dataAddInt16Field(const char* label, const int16_t value)
216216
{
217217
int len = 0;
218218

@@ -241,7 +241,7 @@ int AlgoIoT::dataAddInt16Field(char* label, const int16_t value)
241241
return ALGOIOT_NO_ERROR;
242242
}
243243

244-
int AlgoIoT::dataAddUInt16Field(char* label, const uint16_t value)
244+
int AlgoIoT::dataAddUInt16Field(const char* label, const uint16_t value)
245245
{
246246
int len = 0;
247247

@@ -270,7 +270,7 @@ int AlgoIoT::dataAddUInt16Field(char* label, const uint16_t value)
270270
return ALGOIOT_NO_ERROR;
271271
}
272272

273-
int AlgoIoT::dataAddInt32Field(char* label, const int32_t value)
273+
int AlgoIoT::dataAddInt32Field(const char* label, const int32_t value)
274274
{
275275
int len = 0;
276276

@@ -299,7 +299,7 @@ int AlgoIoT::dataAddInt32Field(char* label, const int32_t value)
299299
return ALGOIOT_NO_ERROR;
300300
}
301301

302-
int AlgoIoT::dataAddUInt32Field(char* label, const uint32_t value)
302+
int AlgoIoT::dataAddUInt32Field(const char* label, const uint32_t value)
303303
{
304304
int len = 0;
305305

@@ -328,7 +328,7 @@ int AlgoIoT::dataAddUInt32Field(char* label, const uint32_t value)
328328
return ALGOIOT_NO_ERROR;
329329
}
330330

331-
int AlgoIoT::dataAddFloatField(char* label, const float value)
331+
int AlgoIoT::dataAddFloatField(const char* label, const float value)
332332
{
333333
int len = 0;
334334

@@ -357,7 +357,7 @@ int AlgoIoT::dataAddFloatField(char* label, const float value)
357357
return ALGOIOT_NO_ERROR;
358358
}
359359

360-
int AlgoIoT::dataAddShortStringField(char* label, char* shortCString)
360+
int AlgoIoT::dataAddShortStringField(const char* label, char* shortCString)
361361
{
362362
int len = 0;
363363

@@ -430,7 +430,7 @@ int AlgoIoT::submitTransactionToAlgorand()
430430
#ifdef LIB_DEBUGMODE
431431
DEBUG_SERIAL.println("\n Error initializing transaction MessagePack\n");
432432
#endif
433-
return NULL;
433+
return ALGOIOT_MESSAGEPACK_ERROR;
434434
}
435435
iErr = prepareTransactionMessagePack(msgPackTx, fv, fee, PAYMENT_AMOUNT_MICROALGOS, notes, (uint16_t)notesLen);
436436
if (iErr)

AlgoIoT.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// requires HTTPClient (ESP32)
88
// requires Base64 by Densaugeo https://github.com/Densaugeo/base64_arduino
99

10-
// v20231205-1
10+
// v20240415-1
1111

1212
// TODO:
1313
// API endpoint URL setter (AlgoNode may have to be replaced at some point)
@@ -201,28 +201,28 @@ class AlgoIoT
201201
// "label" not null and 31 chars max
202202

203203
// Return: error code (0 = OK)
204-
int dataAddInt8Field(char* label, const int8_t value);
204+
int dataAddInt8Field(const char* label, const int8_t value);
205205

206206
// Return: error code (0 = OK)
207-
int dataAddUInt8Field(char* label, const uint8_t value);
207+
int dataAddUInt8Field(const char* label, const uint8_t value);
208208

209209
// Return: error code (0 = OK)
210-
int dataAddInt16Field(char* label, const int16_t value);
210+
int dataAddInt16Field(const char* label, const int16_t value);
211211

212212
// Return: error code (0 = OK)
213-
int dataAddUInt16Field(char* label, const uint16_t value);
213+
int dataAddUInt16Field(const char* label, const uint16_t value);
214214

215215
// Return: error code (0 = OK)
216-
int dataAddInt32Field(char* label, const int32_t value);
216+
int dataAddInt32Field(const char* label, const int32_t value);
217217

218218
// Return: error code (0 = OK)
219-
int dataAddUInt32Field(char* label, const uint32_t value);
219+
int dataAddUInt32Field(const char* label, const uint32_t value);
220220

221221
// Return: error code (0 = OK)
222-
int dataAddFloatField(char* label, const float value);
222+
int dataAddFloatField(const char* label, const float value);
223223

224224
// Max 31 chars
225-
int dataAddShortStringField(char* label, char* shortCString);
225+
int dataAddShortStringField(const char* label, char* shortCString);
226226

227227
// Submit transaction to Algorand network
228228
// Return: error code (0 = OK)

bip39enwords.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2054,4 +2054,4 @@ const char* BIP39_EN_Wordlist[BIP39_EN_WORDS_NUM] = {
20542054
"zoo"
20552055
};
20562056

2057-
#endif _BIP39ENWORDS_H
2057+
#endif // _BIP39ENWORDS_H

0 commit comments

Comments
 (0)