Skip to content

Commit

Permalink
added support for publish for MKR1000 boards
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoschwartz committed Dec 5, 2016
1 parent 685bc0b commit 0a9d267
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
40 changes: 34 additions & 6 deletions aREST.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License:
http://creativecommons.org/licenses/by-sa/4.0/
Version 2.4.1
Version 2.4.2
Changelog:
Version 2.4.2: Added publish() support for MKR1000
Version 2.4.1: Additional fixes for Pro plans
Version 2.4.0: Added support for aREST Pro & several fixes
Version 2.3.1: Fixed pin mapping for NodeMCU/Wemos boards
Expand Down Expand Up @@ -403,13 +404,13 @@ void handle(Adafruit_BLE_UART& serial) {
}
}

template <typename T>
void publish(Adafruit_BLE_UART& serial, String eventName, T value) {
// template <typename T>
// void publish(Adafruit_BLE_UART& serial, String eventName, T value) {

// Publish request
publish_proto(client, eventName, value);
// // Publish request
// publish_proto(client, eventName, value);

}
// }

// Handle request for the Arduino Ethernet shield
#elif defined(ethernet_h)
Expand Down Expand Up @@ -437,6 +438,25 @@ void publish(EthernetClient& client, String eventName, T value) {

}

// Handle request for the Cytron Clone ESP8266
#elif defined(_CYTRONWIFISERVER_H_)
void handle(ESP8266Client& client){

if (client.available()) {

// Handle request
handle_proto(client,true,0);

// Answer
sendBuffer(client,0,0);
client.stop();

// Reset variables for the next command
reset_status();

}
}

// Handle request for the ESP8266 chip
#elif defined(ESP8266)
void handle(WiFiClient& client){
Expand Down Expand Up @@ -502,6 +522,14 @@ void handle(WiFiClient& client){
}
}

template <typename T>
void publish(WiFiClient& client, String eventName, T value) {

// Publish request
publish_proto(client, eventName, value);

}

// Handle request for the Arduino WiFi shield
#elif defined(WiFi_h)
void handle(WiFiClient& client){
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=aREST
version=2.4.1
version=2.4.2
author=Marco Schwartz
maintainer=Marco Schwartz <[email protected]>
sentence=RESTful API for the Arduino platform.
Expand Down

0 comments on commit 0a9d267

Please sign in to comment.