Skip to content

Commit 3244a7b

Browse files
Merge pull request #6 from arduino-libraries/release1.1.6
Support Yun shield
2 parents 3d66087 + da5212c commit 3244a7b

File tree

4 files changed

+61
-3
lines changed

4 files changed

+61
-3
lines changed

keywords.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Temboo KEYWORD1
1010
TembooMQTTEdgeDevice KEYWORD1
1111
TembooCoAPEdgeDevice KEYWORD1
12+
TembooYunShield KEYWORD1
1213

1314
#######################################
1415
# Datatypes (KEYWORD2)
@@ -17,6 +18,7 @@ TembooCoAPEdgeDevice KEYWORD1
1718
TembooChoreo KEYWORD2
1819
TembooCoAPChoreo KEYWORD2
1920
TembooMQTTChoreo KEYWORD2
21+
TembooYunShieldChoreo KEYWORD2
2022

2123
#######################################
2224
# Methods and Functions (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 or Genuino board to Temboo, m
66
category=Communication
77
url=http://www.temboo.com/arduino
88
architectures=*
9-
version=1.1.4
9+
version=1.1.6
1010
core-dependencies=arduino (>=1.5.0)

src/TembooYunShield.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
###############################################################################
3+
#
4+
# Temboo Arduino library
5+
#
6+
# Copyright 2015, Temboo Inc.
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing,
15+
# software distributed under the License is distributed on an
16+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17+
# either express or implied. See the License for the specific
18+
# language governing permissions and limitations under the License.
19+
#
20+
###############################################################################
21+
*/
22+
23+
#ifndef TEMBOOYUNSHIELD_H_
24+
#define TEMBOOYUNSHIELD_H_
25+
26+
#include <Arduino.h>
27+
28+
///////////////////////////////////////////////////////
29+
// BEGIN ARDUINO YUN SHIELD SUPPORT
30+
///////////////////////////////////////////////////////
31+
32+
#include <Process.h>
33+
34+
class TembooYunShieldChoreo : public Process {
35+
36+
public:
37+
void begin() {Process::begin("temboo");}
38+
void setAccountName(const String& accountName) { addParameter("-a" + accountName);}
39+
void setAppKeyName(const String& appKeyName) { addParameter("-u" + appKeyName);}
40+
void setAppKey(const String& appKey) { addParameter("-p" + appKey);}
41+
void setChoreo(const String& choreo) { addParameter("-c" + choreo);}
42+
void setCredential(const String& credentialName) { addParameter("-e" + credentialName);}
43+
void setSavedInputs(const String& savedInputsName) { addParameter("-e" + savedInputsName);}
44+
void setProfile(const String& profileName) { addParameter("-e" + profileName);}
45+
void addInput(const String& inputName, const String& inputValue) { addParameter("-i" + inputName + ":" + inputValue);}
46+
void addOutputFilter(const String& filterName, const String& filterPath, const String& variableName) { addParameter("-o" + filterName + ":" + filterPath + ":" + variableName);}
47+
void setSettingsFileToWrite(const String& filePath) { addParameter("-w" + filePath);}
48+
void setSettingsFileToRead(const String& filePath) { addParameter("-r" + filePath);}
49+
void setGatewayAddress(const String& addr) { addParameter("-s" + addr);}
50+
51+
};
52+
53+
54+
55+
#endif //TEMBOOYUNSHIELD_H_

src/utility/TembooSession.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ int TembooSession::executeChoreo(
8585
uint32toa((uint32_t)TembooSession::getTime(), buffer);
8686

8787
uint16_t contentLength = getAuth(fmt, appKeyValue, buffer, auth);
88-
89-
m_client.stop();
88+
if (m_client.connected()) {
89+
m_client.stop();
90+
}
9091
m_client.flush();
9192

9293
int connected = 0;

0 commit comments

Comments
 (0)