Skip to content

Commit a56d05f

Browse files
Version 1.1.3 update
1 parent a71b352 commit a56d05f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+8520
-120
lines changed

README.adoc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Temboo Library for Arduino =
22

3-
This library allows an Arduino Yun to connect to the Temboo service.
3+
This library allows an Arduino to connect to the Temboo service.
44

55
== License ==
66

@@ -17,3 +17,13 @@ software distributed under the License is distributed on an
1717
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
1818
either express or implied. See the License for the specific
1919
language governing permissions and limitations under the License.
20+
21+
--------------------------------------------------------------
22+
23+
This library includes elements of the Paho MQTT client, used
24+
with permission under the Eclipse Public License - v1.0
25+
(http://www.eclipse.org/legal/epl-v10.html) and the Eclipse Distribution
26+
License v1.0 (http://www.eclipse.org/org/documents/edl-v10.php).
27+
28+
The Eclipse MQTT Paho client source is available here:
29+
http://www.eclipse.org/paho/

extras/readme.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

keywords.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
#######################################
88

99
Temboo KEYWORD1
10+
TembooMQTTEdgeDevice KEYWORD1
11+
TembooCoAPEdgeDevice KEYWORD1
1012

1113
#######################################
1214
# Datatypes (KEYWORD2)
1315
#######################################
1416

1517
TembooChoreo KEYWORD2
18+
TembooCoAPChoreo KEYWORD2
19+
TembooMQTTChoreo KEYWORD2
1620

1721
#######################################
1822
# Methods and Functions (KEYWORD2)
@@ -29,3 +33,4 @@ addInput KEYWORD2
2933
addOutputFilter KEYWORD2
3034
setSettingsFileToWrite KEYWORD2
3135
setSettingsFileToRead KEYWORD2
36+
setGatewayAddress KEYWORD2

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ paragraph=Use this library to connect your Arduino board to Temboo, making it si
66
category=Communication
77
url=http://www.temboo.com/arduino
88
architectures=*
9-
version=1.1.2
9+
version=1.1.3
1010
core-dependencies=arduino (>=1.5.0)

src/Temboo.cpp

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -24,60 +24,9 @@
2424
#if defined (ARDUINO_AVR_YUN) || defined (ARDUINO_AVR_TRE)
2525

2626
///////////////////////////////////////////////////////
27-
// BEGIN ARDUINO YUN AND TRE SUPPORT
27+
// ARDUINO YUN AND TRE SUPPORT IN HEADER FILE
2828
///////////////////////////////////////////////////////
2929

30-
#include <Temboo.h>
31-
32-
void TembooChoreo::begin() {
33-
Process::begin("temboo");
34-
}
35-
36-
void TembooChoreo::setAccountName(const String& accountName) {
37-
addParameter("-a" + accountName);
38-
}
39-
40-
void TembooChoreo::setAppKeyName(const String& appKeyName) {
41-
addParameter("-u" + appKeyName);
42-
}
43-
44-
void TembooChoreo::setAppKey(const String& appKey) {
45-
addParameter("-p" + appKey);
46-
}
47-
48-
void TembooChoreo::setChoreo(const String& choreo) {
49-
addParameter("-c" + choreo);
50-
}
51-
52-
void TembooChoreo::setCredential(const String& credentialName) {
53-
addParameter("-e" + credentialName);
54-
}
55-
56-
void TembooChoreo::setSavedInputs(const String& savedInputsName) {
57-
addParameter("-e" + savedInputsName);
58-
}
59-
60-
void TembooChoreo::setProfile(const String& profileName) {
61-
addParameter("-e" + profileName);
62-
}
63-
64-
void TembooChoreo::addInput(const String& inputName, const String& inputValue) {
65-
addParameter("-i" + inputName + ":" + inputValue);
66-
}
67-
68-
void TembooChoreo::addOutputFilter(const String& outputName, const String& filterPath, const String& variableName) {
69-
addParameter("-o" + outputName + ":" + filterPath + ":" + variableName);
70-
}
71-
72-
void TembooChoreo::setSettingsFileToWrite(const String& filePath) {
73-
addParameter("-w" + filePath);
74-
}
75-
76-
void TembooChoreo::setSettingsFileToRead(const String& filePath) {
77-
addParameter("-r" + filePath);
78-
}
79-
80-
8130
#else //ARDUINO_AVR_YUN
8231

8332
///////////////////////////////////////////////////////
@@ -241,6 +190,10 @@ int TembooChoreo::run(uint16_t timeoutSecs) {
241190
return run(INADDR_NONE, 80, timeoutSecs);
242191
}
243192

193+
int TembooChoreo::run(IPAddress addr, uint16_t port) {
194+
return run(addr, port, TEMBOO_CHOREO_DEFAULT_TIMEOUT_SECS);
195+
}
196+
244197
int TembooChoreo::run(IPAddress addr, uint16_t port, uint16_t timeoutSecs) {
245198

246199
m_nextChar = NULL;
@@ -351,7 +304,11 @@ int TembooChoreo::peek() {
351304
// If we're still sending the HTTP response code,
352305
// return the next character in that sequence.
353306
if (m_nextChar != NULL) {
354-
return (int)*m_nextChar;
307+
if(m_nextState != HTTP_CODE_VALUE) {
308+
return (int)pgm_read_byte(m_nextChar);
309+
} else {
310+
return (int)*m_nextChar;
311+
}
355312
}
356313

357314
// Otherwise, return whatever is in the client buffer.

src/Temboo.h

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,20 @@
3535
class TembooChoreo : public Process {
3636

3737
public:
38-
void begin();
39-
void setAccountName(const String& accountName);
40-
void setAppKeyName(const String& appKeyName);
41-
void setAppKey(const String& appKey);
42-
void setChoreo(const String& choreo);
43-
void setCredential(const String& credentialName);
44-
void setSavedInputs(const String& saveInputsName);
45-
void setProfile(const String& profileName);
46-
void addInput(const String& inputName, const String& inputValue);
47-
void addOutputFilter(const String& filterName, const String& filterPath, const String& variableName);
48-
void setSettingsFileToWrite(const String& filePath);
49-
void setSettingsFileToRead(const String& filePath);
38+
void begin() {Process::begin("temboo");}
39+
void setAccountName(const String& accountName) { addParameter("-a" + accountName);}
40+
void setAppKeyName(const String& appKeyName) { addParameter("-u" + appKeyName);}
41+
void setAppKey(const String& appKey) { addParameter("-p" + appKey);}
42+
void setChoreo(const String& choreo) { addParameter("-c" + choreo);}
43+
void setCredential(const String& credentialName) { addParameter("-e" + credentialName);}
44+
void setSavedInputs(const String& savedInputsName) { addParameter("-e" + savedInputsName);}
45+
void setProfile(const String& profileName) { addParameter("-e" + profileName);}
46+
void addInput(const String& inputName, const String& inputValue) { addParameter("-i" + inputName + ":" + inputValue);}
47+
void addOutputFilter(const String& filterName, const String& filterPath, const String& variableName) { addParameter("-o" + filterName + ":" + filterPath + ":" + variableName);}
48+
void setSettingsFileToWrite(const String& filePath) { addParameter("-w" + filePath);}
49+
void setSettingsFileToRead(const String& filePath) { addParameter("-r" + filePath);}
50+
unsigned int setGatewayAddress(const String& addr) { addParameter("-s" + addr);}
51+
5052

5153
};
5254

@@ -134,10 +136,11 @@ class TembooChoreo : public Stream {
134136

135137
// run the choreo using the current input info
136138
int run();
137-
138-
// run the choreo on the Temboo server at the given IP address and port
139-
// (used only when instructed by Temboo customer support.)
139+
// run the choreo with a user specified timeout
140140
int run(uint16_t timeoutSecs);
141+
142+
// run the choreo on the Temboo server at the given IP address and port
143+
int run(IPAddress addr, uint16_t port);
141144
int run(IPAddress addr, uint16_t port, uint16_t timeoutSecs);
142145

143146
void close();

0 commit comments

Comments
 (0)