Skip to content

Commit 3355c9c

Browse files
authored
Merge pull request #1 from SlicingDice/feature/add-code-comments
Add code comments
2 parents 8d05f6f + d7fb983 commit 3355c9c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

SlicingDice.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ SlicingDice::SlicingDice(const char* apiUserKey, const char* customHost, int cus
1919
apiKey = apiUserKey;
2020
}
2121

22+
/* Index data on Slicing Dice API
23+
*
24+
* query - the query to send to Slicing Dice API
25+
*/
2226
void SlicingDice::index(JsonObject& query) {
2327
char queryConverted[query.measureLength() + 1];
2428
query.printTo(queryConverted, sizeof(queryConverted));
2529
makeRequest(queryConverted);
2630
}
2731

32+
/* Make a HTTP request to Slicing Dice API
33+
*
34+
* query - the query to send to Slicing Dice API
35+
*/
2836
void SlicingDice::makeRequest(const char* query){
2937
client.connect(host, port);
3038
while (!client.connected()) {
@@ -42,6 +50,7 @@ void SlicingDice::makeRequest(const char* query){
4250
client.stop();
4351
}
4452

53+
//Read response from HTTP request to Slicing Dice API
4554
void SlicingDice::readResponse(){
4655
response = " ";
4756
boolean currentLineIsBlank = true;

tests_and_examples/Simple.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void setup() {
99
while (!Serial) {
1010
}
1111

12-
// Arduino network settings
12+
// Arduino network settings, should match your internet connection properties
1313
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
1414
byte ip[] = { 192, 168, 1, 10 };
1515
byte gateway[] = { 192, 168, 1, 1 };
@@ -18,6 +18,7 @@ void setup() {
1818
Ethernet.begin(mac, ip, dnxs, gateway, subnet);
1919
}
2020

21+
// Send an indexation command to Slicing Dice API and print the result
2122
void loop() {
2223
StaticJsonBuffer<200> jsonBuffer;
2324
JsonObject& queryIndex = jsonBuffer.createObject();

0 commit comments

Comments
 (0)