newTweetusingWifi

Dependencies:   PIRSensorWithTwitter mbed

Committer:
ajeet3004
Date:
Thu Sep 28 08:52:17 2017 +0000
Revision:
1:c630ba74e621
Parent:
0:747d48010c29
Good

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ajeet3004 0:747d48010c29 1 /*
ajeet3004 0:747d48010c29 2 * Copyright (C) 2015 Wiznet, MIT License
ajeet3004 0:747d48010c29 3 *
ajeet3004 0:747d48010c29 4 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ajeet3004 0:747d48010c29 5 * and associated documentation files (the "Software"), to deal in the Software without restriction,
ajeet3004 0:747d48010c29 6 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ajeet3004 0:747d48010c29 7 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ajeet3004 0:747d48010c29 8 * furnished to do so, subject to the following conditions:
ajeet3004 0:747d48010c29 9 *
ajeet3004 0:747d48010c29 10 * The above copyright notice and this permission notice shall be included in all copies or
ajeet3004 0:747d48010c29 11 * substantial portions of the Software.
ajeet3004 0:747d48010c29 12 *
ajeet3004 0:747d48010c29 13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ajeet3004 0:747d48010c29 14 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ajeet3004 0:747d48010c29 15 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ajeet3004 0:747d48010c29 16 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ajeet3004 0:747d48010c29 17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ajeet3004 0:747d48010c29 18 */
ajeet3004 0:747d48010c29 19
ajeet3004 0:747d48010c29 20 #include <stdio.h>
ajeet3004 0:747d48010c29 21 #include "mbed.h"
ajeet3004 0:747d48010c29 22 #include "WizFi310Interface.h"
ajeet3004 0:747d48010c29 23
ajeet3004 0:747d48010c29 24
ajeet3004 0:747d48010c29 25 #define SECURE WizFi310::SEC_WPA2_MIXED
ajeet3004 0:747d48010c29 26 #define SSID "CDI"
ajeet3004 0:747d48010c29 27 #define PASS "Cdi*1717"
ajeet3004 0:747d48010c29 28 /*#define SSID "CDIWIZFI310TEST"
ajeet3004 0:747d48010c29 29 #define PASS "1234567890"*/
ajeet3004 0:747d48010c29 30
ajeet3004 0:747d48010c29 31 #if defined(TARGET_WIZwiki_W7500)
ajeet3004 0:747d48010c29 32 WizFi310Interface wizfi310(D1, D0, D7, D6, D8, NC, 115200);
ajeet3004 0:747d48010c29 33 Serial pc(USBTX, USBRX);
ajeet3004 0:747d48010c29 34 #endif
ajeet3004 0:747d48010c29 35
ajeet3004 0:747d48010c29 36
ajeet3004 0:747d48010c29 37 /**
ajeet3004 0:747d48010c29 38 * \brief Hello World
ajeet3004 0:747d48010c29 39 * \param none
ajeet3004 0:747d48010c29 40 * \return int
ajeet3004 0:747d48010c29 41 */
ajeet3004 0:747d48010c29 42 int main()
ajeet3004 0:747d48010c29 43 {
ajeet3004 0:747d48010c29 44 pc.baud(115200);
ajeet3004 0:747d48010c29 45
ajeet3004 0:747d48010c29 46 printf("WizFi310 STATION. \r\n");
ajeet3004 0:747d48010c29 47 wizfi310.init();
ajeet3004 0:747d48010c29 48 printf("After Initialisation. \r\n");
ajeet3004 0:747d48010c29 49
ajeet3004 0:747d48010c29 50 printf("After Set Address. \r\n");
ajeet3004 0:747d48010c29 51 if ( wizfi310.connect(SECURE, SSID, PASS, WizFi310::WM_STATION)) return -1;
ajeet3004 0:747d48010c29 52 printf("After Connect. \r\n");
ajeet3004 0:747d48010c29 53 printf("IP Address is %s\r\n", wizfi310.getIPAddress());
ajeet3004 0:747d48010c29 54 wizfi310.test_twitter();
ajeet3004 0:747d48010c29 55
ajeet3004 0:747d48010c29 56 //wizfi310.disconnect();
ajeet3004 0:747d48010c29 57 }