This is an example for sending queries to IFTTT using WIZwiki-W7500.
Dependencies: IFTTT WIZnetInterface mbed
Revision 0:0d7ef0c464ff, committed 2015-07-22
- Comitter:
- jehoon
- Date:
- Wed Jul 22 12:03:28 2015 +0000
- Commit message:
- This is an example for sending queries to IFTTT(If This Then That) using WIZwiki-W7500 platform.;
Changed in this revision
diff -r 000000000000 -r 0d7ef0c464ff IFTTT.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IFTTT.lib Wed Jul 22 12:03:28 2015 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/mbedAustin/code/IFTTT/#15c6c9f87c32
diff -r 000000000000 -r 0d7ef0c464ff WIZnetInterface.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WIZnetInterface.lib Wed Jul 22 12:03:28 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/WIZnet/code/WIZnetInterface/#7d7553e0578e
diff -r 000000000000 -r 0d7ef0c464ff main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jul 22 12:03:28 2015 +0000 @@ -0,0 +1,45 @@ +#include "mbed.h" +#include "EthernetInterface.h" +#include "TCPSocketConnection.h" +#include "ifttt.h" + +EthernetInterface eth; +Serial pc(USBTX, USBRX); // tx, rx + +int main() +{ + int phy_link; + pc.baud(115200); + + printf("Wait a second...\r\n"); + uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0x00, 0x01, 0x02}; + eth.init(mac_addr); //Use DHCP + eth.connect(); + + do{ + phy_link = eth.ethernet_link(); + printf("..."); + wait(2); + }while(!phy_link); + printf("\r\nIP Address is %s \r\n", eth.getIPAddress()); + TCPSocketConnection sock; + + // Initialize ifttt object, add up to 3 optional values, trigger event. + IFTTT ifttt("YourEventName","ChangeToYourSecretKey", &sock); // EventName, Secret Key, socket to use + ifttt.addIngredients("this is awesome","test-ing","data!!!"); // 3 optional Values to send along with trigger. + ifttt.trigger(); + + // Send data using GET + ifttt.addIngredients("Sending","GET","data"); + ifttt.trigger(IFTTT_GET); + + // Send Data using POST + ifttt.addIngredients("Sending","POST","things"); + ifttt.trigger(IFTTT_POST); + + sock.close(); + eth.disconnect(); + + while(1) { + } +} \ No newline at end of file
diff -r 000000000000 -r 0d7ef0c464ff mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jul 22 12:03:28 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 \ No newline at end of file