Tests for ESP8266Interface

Dependencies:   ESP8266Interface NSAPITests NetworkSocketAPI mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /* NetworkSocketAPI Example Program
00002  * Copyright (c) 2015 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "mbed.h"
00018 #include "ESP8266Interface.h"
00019 #include "NSAPITests.h"
00020 
00021 ESP8266Interface iface(D1, D0);
00022 
00023 int main()
00024 {
00025     int32_t result = iface.connect("ssid", "password");
00026 
00027     if (result) {
00028         printf("Interface failed to connect with code %d\r\n", result);
00029     } else {
00030         nsapi_tests("ESP8266Interface Tests", &iface, "0.0.0.0", 4000);
00031         iface.disconnect();
00032     }
00033     while(1);
00034 }