Skip to content

Commit ea0a60e

Browse files
committed
boolean->bool
1 parent 312b11e commit ea0a60e

File tree

8 files changed

+76
-76
lines changed

8 files changed

+76
-76
lines changed

src/BytebeamArduino.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void BytebeamArduino::initActionHandlerArray() {
111111
this->actionFuncsHandlerIdx = -1;
112112
}
113113

114-
boolean BytebeamArduino::subscribe(const char* topic, uint8_t qos) {
114+
bool BytebeamArduino::subscribe(const char* topic, uint8_t qos) {
115115
//
116116
// skipping the connection checking here as we are not calling this function directly
117117
//
@@ -125,7 +125,7 @@ boolean BytebeamArduino::subscribe(const char* topic, uint8_t qos) {
125125
}
126126
}
127127

128-
boolean BytebeamArduino::unsubscribe(const char* topic) {
128+
bool BytebeamArduino::unsubscribe(const char* topic) {
129129
//
130130
// skipping the connection checking here as we are not calling this function directly
131131
//
@@ -139,7 +139,7 @@ boolean BytebeamArduino::unsubscribe(const char* topic) {
139139
}
140140
}
141141

142-
boolean BytebeamArduino::publish(const char* topic, const char* payload) {
142+
bool BytebeamArduino::publish(const char* topic, const char* payload) {
143143
//
144144
// skipping the connection checking here as we are not calling this function directly
145145
//
@@ -153,7 +153,7 @@ boolean BytebeamArduino::publish(const char* topic, const char* payload) {
153153
}
154154
}
155155

156-
boolean BytebeamArduino::subscribeToActions() {
156+
bool BytebeamArduino::subscribeToActions() {
157157
// before going ahead make sure you are connected
158158
if(!PubSubClient::connected()) {
159159
BytebeamLogger::Error(__FILE__, __func__, "subscribe to actions failed, bytebeam client is not connected to the cloud");
@@ -177,7 +177,7 @@ boolean BytebeamArduino::subscribeToActions() {
177177
return subscribe(topic, qos);
178178
}
179179

180-
boolean BytebeamArduino::unsubscribeToActions() {
180+
bool BytebeamArduino::unsubscribeToActions() {
181181
// before going ahead make sure you are connected
182182
if(!PubSubClient::connected()) {
183183
BytebeamLogger::Error(__FILE__, __func__, "unsubscribe to actions abort, bytebeam client is not connected to the cloud");
@@ -199,7 +199,7 @@ boolean BytebeamArduino::unsubscribeToActions() {
199199
return unsubscribe(topic);
200200
}
201201

202-
boolean BytebeamArduino::publishActionStatus(char* actionId, int progressPercentage, char* status, char* error) {
202+
bool BytebeamArduino::publishActionStatus(char* actionId, int progressPercentage, char* status, char* error) {
203203
//
204204
// skipping the connection checking here as we are not calling this function directly
205205
//
@@ -247,7 +247,7 @@ boolean BytebeamArduino::publishActionStatus(char* actionId, int progressPercent
247247
}
248248

249249
#ifdef BYTEBEAM_ARDUINO_ARCH_SUPPORTS_FS
250-
boolean BytebeamArduino::readDeviceConfigFile() {
250+
bool BytebeamArduino::readDeviceConfigFile() {
251251

252252
/* This file system pointer will store the address of the selected file system, So after begin and end operations
253253
* we can utilize this file system pointer to do the file operations.
@@ -413,7 +413,7 @@ boolean BytebeamArduino::publishActionStatus(char* actionId, int progressPercent
413413
}
414414
#endif
415415

416-
boolean BytebeamArduino::parseDeviceConfigFile() {
416+
bool BytebeamArduino::parseDeviceConfigFile() {
417417
// before going ahead make sure you are parsing something
418418
if(this->deviceConfigStr == NULL) {
419419
BytebeamLogger::Error(__FILE__, __func__, "device config file is empty");
@@ -468,7 +468,7 @@ boolean BytebeamArduino::parseDeviceConfigFile() {
468468
return true;
469469
}
470470

471-
boolean BytebeamArduino::setupBytebeamClient() {
471+
bool BytebeamArduino::setupBytebeamClient() {
472472

473473
/* Setting up the bytebeam secure wifi client based on the architecture and before this make sure you have
474474
* the same secure wifi client object inside the class defination.
@@ -565,7 +565,7 @@ void BytebeamArduino::clearBytebeamClient() {
565565
BytebeamLogger::Info(__FILE__, __func__, "DISCONNECTED");
566566
}
567567

568-
boolean BytebeamArduino::initSDK() {
568+
bool BytebeamArduino::initSDK() {
569569
// It's much better to pump up architecture inforamtion in the very beginning
570570
printArchitectureInfo();
571571

@@ -624,7 +624,7 @@ boolean BytebeamArduino::initSDK() {
624624
return true;
625625
}
626626

627-
boolean BytebeamArduino::isInitialized() {
627+
bool BytebeamArduino::isInitialized() {
628628
// return the client status i.e initialized or de-initialized
629629
return this->isClientActive;
630630
}
@@ -664,7 +664,7 @@ BytebeamArduino::~BytebeamArduino() {
664664
}
665665

666666
#ifdef BYTEBEAM_ARDUINO_USE_WIFI
667-
boolean BytebeamArduino::begin( const deviceConfigFileSystem fileSystem,
667+
bool BytebeamArduino::begin( const deviceConfigFileSystem fileSystem,
668668
const char* fileName,
669669
BytebeamLogger::DebugLevel level) {
670670
// set the device config file system
@@ -700,7 +700,7 @@ BytebeamArduino::~BytebeamArduino() {
700700
#endif
701701

702702
#ifdef BYTEBEAM_ARDUINO_USE_MODEM
703-
boolean BytebeamArduino::begin( TinyGsm* modem,
703+
bool BytebeamArduino::begin( TinyGsm* modem,
704704
const deviceConfigFileSystem fileSystem,
705705
const char* fileName,
706706
BytebeamLogger::DebugLevel level) {
@@ -745,7 +745,7 @@ BytebeamArduino::~BytebeamArduino() {
745745
}
746746
#endif
747747

748-
boolean BytebeamArduino::loop() {
748+
bool BytebeamArduino::loop() {
749749
// client should be initialized and if not just log the info to serial and abort :)
750750
if(!isInitialized()) {
751751
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -795,7 +795,7 @@ boolean BytebeamArduino::loop() {
795795
}
796796
}
797797

798-
boolean BytebeamArduino::isConnected() {
798+
bool BytebeamArduino::isConnected() {
799799
// client should be initialized and if not just log the info to serial and abort :)
800800
if(!isInitialized()) {
801801
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -806,7 +806,7 @@ boolean BytebeamArduino::isConnected() {
806806
return PubSubClient::connected();
807807
}
808808

809-
boolean BytebeamArduino::handleActions(char* actionReceivedStr) {
809+
bool BytebeamArduino::handleActions(char* actionReceivedStr) {
810810
// client should be initialized and if not just log the info to serial and abort :)
811811
if(!isInitialized()) {
812812
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -938,7 +938,7 @@ boolean BytebeamArduino::handleActions(char* actionReceivedStr) {
938938
return true;
939939
}
940940

941-
boolean BytebeamArduino::addActionHandler(int (*funcPtr)(char* args, char* actionId), char* actionName) {
941+
bool BytebeamArduino::addActionHandler(int (*funcPtr)(char* args, char* actionId), char* actionName) {
942942
// client should be initialized and if not just log the info to serial and abort :)
943943
if(!isInitialized()) {
944944
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -965,7 +965,7 @@ boolean BytebeamArduino::addActionHandler(int (*funcPtr)(char* args, char* actio
965965
return true;
966966
}
967967

968-
boolean BytebeamArduino::removeActionHandler(char* actionName) {
968+
bool BytebeamArduino::removeActionHandler(char* actionName) {
969969
// client should be initialized and if not just log the info to serial and abort :)
970970
if(!isInitialized()) {
971971
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -997,7 +997,7 @@ boolean BytebeamArduino::removeActionHandler(char* actionName) {
997997
}
998998
}
999999

1000-
boolean BytebeamArduino::updateActionHandler(int (*newFuncPtr)(char* args, char* actionId), char* actionName) {
1000+
bool BytebeamArduino::updateActionHandler(int (*newFuncPtr)(char* args, char* actionId), char* actionName) {
10011001
// client should be initialized and if not just log the info to serial and abort :)
10021002
if(!isInitialized()) {
10031003
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1022,7 +1022,7 @@ boolean BytebeamArduino::updateActionHandler(int (*newFuncPtr)(char* args, char*
10221022
}
10231023
}
10241024

1025-
boolean BytebeamArduino::isActionHandlerThere(char* actionName) {
1025+
bool BytebeamArduino::isActionHandlerThere(char* actionName) {
10261026
// client should be initialized and if not just log the info to serial and abort :)
10271027
if(!isInitialized()) {
10281028
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1047,7 +1047,7 @@ boolean BytebeamArduino::isActionHandlerThere(char* actionName) {
10471047
}
10481048
}
10491049

1050-
boolean BytebeamArduino::printActionHandlerArray() {
1050+
bool BytebeamArduino::printActionHandlerArray() {
10511051
// client should be initialized and if not just log the info to serial and abort :)
10521052
if(!isInitialized()) {
10531053
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1069,7 +1069,7 @@ boolean BytebeamArduino::printActionHandlerArray() {
10691069
return true;
10701070
}
10711071

1072-
boolean BytebeamArduino::resetActionHandlerArray() {
1072+
bool BytebeamArduino::resetActionHandlerArray() {
10731073
// client should be initialized and if not just log the info to serial and abort :)
10741074
if(!isInitialized()) {
10751075
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1081,7 +1081,7 @@ boolean BytebeamArduino::resetActionHandlerArray() {
10811081
return true;
10821082
}
10831083

1084-
boolean BytebeamArduino::publishActionCompleted(char* actionId) {
1084+
bool BytebeamArduino::publishActionCompleted(char* actionId) {
10851085
// client should be initialized and if not just log the info to serial and abort :)
10861086
if(!isInitialized()) {
10871087
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1103,7 +1103,7 @@ boolean BytebeamArduino::publishActionCompleted(char* actionId) {
11031103
}
11041104
}
11051105

1106-
boolean BytebeamArduino::publishActionFailed(char* actionId) {
1106+
bool BytebeamArduino::publishActionFailed(char* actionId) {
11071107
// client should be initialized and if not just log the info to serial and abort :)
11081108
if(!isInitialized()) {
11091109
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1125,7 +1125,7 @@ boolean BytebeamArduino::publishActionFailed(char* actionId) {
11251125
}
11261126
}
11271127

1128-
boolean BytebeamArduino::publishActionProgress(char* actionId, int progressPercentage) {
1128+
bool BytebeamArduino::publishActionProgress(char* actionId, int progressPercentage) {
11291129
// client should be initialized and if not just log the info to serial and abort :)
11301130
if(!isInitialized()) {
11311131
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1147,7 +1147,7 @@ boolean BytebeamArduino::publishActionProgress(char* actionId, int progressPerce
11471147
}
11481148
}
11491149

1150-
boolean BytebeamArduino::publishToStream(char* streamName, const char* payload) {
1150+
bool BytebeamArduino::publishToStream(char* streamName, const char* payload) {
11511151
// client should be initialized and if not just log the info to serial and abort :)
11521152
if(!isInitialized()) {
11531153
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1176,7 +1176,7 @@ boolean BytebeamArduino::publishToStream(char* streamName, const char* payload)
11761176
return publish(topic, payload);
11771177
}
11781178

1179-
boolean BytebeamArduino::end() {
1179+
bool BytebeamArduino::end() {
11801180
// client should be initialized and if not just log the info to serial and abort :)
11811181
if(!isInitialized()) {
11821182
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1254,7 +1254,7 @@ boolean BytebeamArduino::end() {
12541254
}
12551255
}
12561256

1257-
boolean BytebeamArduino::enableOTA() {
1257+
bool BytebeamArduino::enableOTA() {
12581258
// client should be initialized and if not just log the info to serial and abort :)
12591259
if(!isInitialized()) {
12601260
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1284,7 +1284,7 @@ boolean BytebeamArduino::end() {
12841284
return true;
12851285
}
12861286

1287-
boolean BytebeamArduino::isOTAEnabled() {
1287+
bool BytebeamArduino::isOTAEnabled() {
12881288
// client should be initialized and if not just log the info to serial and abort :)
12891289
if(!isInitialized()) {
12901290
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");
@@ -1295,7 +1295,7 @@ boolean BytebeamArduino::end() {
12951295
return this->isOTAEnable;
12961296
}
12971297

1298-
boolean BytebeamArduino::disableOTA() {
1298+
bool BytebeamArduino::disableOTA() {
12991299
// client should be initialized and if not just log the info to serial and abort :)
13001300
if(!isInitialized()) {
13011301
BytebeamLogger::Error(__FILE__, __func__, "Bytebeam Client is not Initialized.");

src/BytebeamArduino.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -88,56 +88,56 @@ class BytebeamArduino : private PubSubClient,
8888

8989
// public functions
9090
#ifdef BYTEBEAM_ARDUINO_USE_WIFI
91-
boolean begin( const deviceConfigFileSystem fileSystem = DEVICE_CONFIG_FILE_SYSTEM,
91+
bool begin( const deviceConfigFileSystem fileSystem = DEVICE_CONFIG_FILE_SYSTEM,
9292
const char* fileName = DEVICE_CONFIG_FILE_NAME,
9393
BytebeamLogger::DebugLevel level = BytebeamLogger::LOG_WARN);
9494
#endif
9595

9696
#ifdef BYTEBEAM_ARDUINO_USE_MODEM
97-
boolean begin( TinyGsm* modem,
97+
bool begin( TinyGsm* modem,
9898
const deviceConfigFileSystem fileSystem = DEVICE_CONFIG_FILE_SYSTEM,
9999
const char* fileName = DEVICE_CONFIG_FILE_NAME,
100100
BytebeamLogger::DebugLevel level = BytebeamLogger::LOG_WARN);
101101
#endif
102102

103-
boolean loop();
104-
boolean isConnected();
105-
boolean handleActions(char* actionReceivedStr);
106-
boolean addActionHandler(int (*funcPtr)(char* args, char* actionId), char* actionName);
107-
boolean removeActionHandler(char* actionName);
108-
boolean updateActionHandler(int (*newFuncPtr)(char* args, char* actionId), char* actionName);
109-
boolean isActionHandlerThere(char* actionName);
110-
boolean printActionHandlerArray();
111-
boolean resetActionHandlerArray();
112-
boolean publishActionCompleted(char* actionId);
113-
boolean publishActionFailed(char* actionId);
114-
boolean publishActionProgress(char* actionId, int progressPercentage);
115-
boolean publishToStream(char* streamName, const char* payload);
103+
bool loop();
104+
bool isConnected();
105+
bool handleActions(char* actionReceivedStr);
106+
bool addActionHandler(int (*funcPtr)(char* args, char* actionId), char* actionName);
107+
bool removeActionHandler(char* actionName);
108+
bool updateActionHandler(int (*newFuncPtr)(char* args, char* actionId), char* actionName);
109+
bool isActionHandlerThere(char* actionName);
110+
bool printActionHandlerArray();
111+
bool resetActionHandlerArray();
112+
bool publishActionCompleted(char* actionId);
113+
bool publishActionFailed(char* actionId);
114+
bool publishActionProgress(char* actionId, int progressPercentage);
115+
bool publishToStream(char* streamName, const char* payload);
116116

117117
#if BYTEBEAM_OTA_ENABLE
118-
boolean enableOTA();
119-
boolean isOTAEnabled();
120-
boolean disableOTA();
118+
bool enableOTA();
119+
bool isOTAEnabled();
120+
bool disableOTA();
121121
#endif
122122

123-
boolean end();
123+
bool end();
124124

125125
private:
126126
// private functions
127127
void printArchitectureInfo();
128128
void initActionHandlerArray();
129-
boolean subscribe(const char* topic, uint8_t qos);
130-
boolean unsubscribe(const char* topic);
131-
boolean publish(const char* topic, const char* payload);
132-
boolean subscribeToActions();
133-
boolean unsubscribeToActions();
134-
boolean publishActionStatus(char* actionId, int progressPercentage, char* status, char* error);
135-
boolean readDeviceConfigFile();
136-
boolean parseDeviceConfigFile();
137-
boolean setupBytebeamClient();
129+
bool subscribe(const char* topic, uint8_t qos);
130+
bool unsubscribe(const char* topic);
131+
bool publish(const char* topic, const char* payload);
132+
bool subscribeToActions();
133+
bool unsubscribeToActions();
134+
bool publishActionStatus(char* actionId, int progressPercentage, char* status, char* error);
135+
bool readDeviceConfigFile();
136+
bool parseDeviceConfigFile();
137+
bool setupBytebeamClient();
138138
void clearBytebeamClient();
139-
boolean initSDK();
140-
boolean isInitialized();
139+
bool initSDK();
140+
bool isInitialized();
141141

142142
// private variables
143143
int mqttPort;

src/BytebeamLog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void BytebeamLog::logPrintf(bytebeamLogLevel_t level, const char* tag, const cha
8787
logPrint(level, tag, msgStr);
8888
}
8989

90-
boolean BytebeamLog::logPublish(const char* level, const char* tag, const char* message) {
90+
bool BytebeamLog::logPublish(const char* level, const char* tag, const char* message) {
9191
//
9292
// Publish the log info to cloud :)
9393
//
@@ -147,7 +147,7 @@ void BytebeamLog::enableCloudLogging() {
147147
this->isCloudLoggingEnable = true;
148148
}
149149

150-
boolean BytebeamLog::isCloudLoggingEnabled() {
150+
bool BytebeamLog::isCloudLoggingEnabled() {
151151
return this->isCloudLoggingEnable;
152152
}
153153

src/BytebeamLog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class BytebeamLog {
3636

3737
// public functions
3838
void enableCloudLogging();
39-
boolean isCloudLoggingEnabled();
39+
bool isCloudLoggingEnabled();
4040
void disableCloudLogging();
4141

4242
void setLogStream(char* stream);
@@ -74,7 +74,7 @@ protected :
7474
void logPrint(bytebeamLogLevel_t level, const char* tag, const char* message);
7575
void logPrintln(bytebeamLogLevel_t level, const char* tag, const char* message);
7676
void logPrintf(bytebeamLogLevel_t level, const char* tag, const char* fmt, va_list args);
77-
boolean logPublish(const char* level, const char* tag, const char* message);
77+
bool logPublish(const char* level, const char* tag, const char* message);
7878

7979
// private variables
8080
BytebeamTime* Time;

0 commit comments

Comments
 (0)