-
Notifications
You must be signed in to change notification settings - Fork 1
Building in Arduino IDE
Using the Arduino IDEs built-in Library Manager, install the IoTeX-Client library
Using the Arduino IDEs built-in Library Manager, also install the following libraries:
Include the IoTeX-Client main header in your Arduino Sketch:
#include <IoTeXClient.h>
Create the Connection
object, passing the connection details:
const char ip[] = "gateway.iotexlab.io";
const char baseUrl[] = "iotexapi.APIService";
const int port = 10000;
Connection<Api> connection(ip, port, baseUrl);
You can find examples of most of the library methods under the examples directory
Debug logs are disabled by default. Follow the instructions below to enable them
The log level can be set at runtime using the IotexHelpers
global object
You can set the log level for a specific module. The existent log modules are:
- "GENERAL"
- "HTTP"
- "CONTRACT"
Simply call the following method on the IotexHelpers
global object:
void setModuleLogLevel(const std::string& module, IotexLogLevel level)
Eg. This will set the HTTP log level to DEBUG
:
IotexHelpers.setModuleLogLevel("HTTP", IotexLogLevel::DEBUG);
You can also set the log level globally for all modules.
Simply call the following method on the IotexHelpers
global object:
void setGlobalLogLevel(IotexLogLevel level)
Eg. This will set the log level globally to DEBUG
:
IotexHelpers.setGlobalLogLevel(IotexLogLevel::DEBUG);