티스토리 뷰
Sample Source Code
void b_Send2IFTTT(String EventValue){
Serial.print("Connecting to ");
Serial.println(IFTTTAddress);
WiFiClient client;
const int httpPort = 80;
if(!client.connect(IFTTTAddress, httpPort)){
Serial.println("Connection to IFTTT Failed");
return;
}
//String urlString = String(IFTTTAddress) + "/trigger/";
String urlString = "/trigger/";
urlString += EventValue;
urlString += "/with/key/";
urlString += IFTTTKey;
String mJson = String("{\"value1\":\"") + "Bilient\"}";
Serial.print("[URL]");
Serial.println(urlString);
client.println(String("POST ") + urlString + " HTTP/1.1");
client.println(String("Host: ") + String(IFTTTAddress));
client.println("Content-Type: application/json");
client.print("Content-Length: ");
client.println(mJson.length());
client.println();
client.println(mJson);
while(client.connected()){
if(client.available()){
String line = client.readStringUntil('\r');
Serial.print(line);
}else{
delay(50);
}
}
Serial.println();
Serial.println("cloing connection");
client.stop();
}
Reference : https://maker.ifttt.com
반응형
'SWDesk > Firmware' 카테고리의 다른 글
[BMS] Command Process for Master (0) | 2020.07.19 |
---|---|
[BPM] Firmware Source for Master (0) | 2020.06.15 |
[BMS] Firmware for Measurement Device (0) | 2020.04.29 |
[BMS] Firmware for WiFi Device (0) | 2020.04.28 |
[BMS] Firmware for Wireless Device (0) | 2020.04.27 |
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 심심풀이
- Innovation&Hurdles
- arduino
- Innovations
- BSC
- Innovations&Hurdles
- Hurdles
- 전압
- 치매방지
- 절연형
- 허들
- 오블완
- 심심풀이치매방지기
- Decorator
- 빌리언트
- 혁신과허들
- 둎
- DYOV
- 혁신
- 치매
- 아두이노
- 전류
- bilient
- 전압전류모니터링
- Video
- image
- 배프
- 티스토리챌린지
- ServantClock
- badp
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
글 보관함