This example codes uses the wolfssl library to get hastags from Twitter by using the FRDM-K64F board from Freescale
Dependencies: EthernetInterface-FRDM HTTPClient mbed-rtos mbed wolfSSL WDT_K64F
Fork of SimpleHTTPSClient by
Diff: main.cpp
- Revision:
- 7:dceeeeca2741
- Parent:
- 5:4d53cdfe94c4
--- a/main.cpp Thu Aug 06 00:09:19 2015 +0000 +++ b/main.cpp Thu Aug 06 00:39:07 2015 +0000 @@ -1,10 +1,12 @@ #include "mbed.h" #include "EthernetInterface.h" #include "HTTPClient.h" +#include "Watchdog.h" EthernetInterface eth; HTTPClient http; DigitalOut led1(LED1); +Watchdog wdt; char recvBuff[1024*40]; @@ -44,7 +46,9 @@ char createDate[11] = {0}; unsigned long long dataTime = 0; unsigned long long lastdataTime = 1438467674; - + + wdt.kick(60); //init the watchdog for a 60 second timeout + eth.init(); //Use DHCP printf("HTTPS Client, Starting,...\n\r") ; @@ -69,6 +73,7 @@ if (lastdataTime < dataTime) { //Give the candy here!! + printf("\n\rGiving a candy!!\n\r"); led1 = 0; lastdataTime = dataTime; wait(1); @@ -77,7 +82,8 @@ } else { printf("Error - ret = %d - HTTP return code = %d\n\r", ret, http.getHTTPResponseCode()); } - wait(30); + wait(15); + wdt.kick(); //kick the watchdog before 60 seconds is up } eth.disconnect(); }