Tests for LWIPInterface
Dependencies: LWIPInterface NSAPITests NetworkSocketAPI mbed-rtos mbed
main.cpp@2:9181decb4d5c, 2016-03-09 (annotated)
- Committer:
- sam_grove
- Date:
- Wed Mar 09 07:04:37 2016 +0000
- Revision:
- 2:9181decb4d5c
- Parent:
- 0:5290cb128aed
- Child:
- 3:50ac0af2ea9c
update dependencies
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bridadan | 0:5290cb128aed | 1 | /* NetworkSocketAPI Example Program |
bridadan | 0:5290cb128aed | 2 | * Copyright (c) 2015 ARM Limited |
bridadan | 0:5290cb128aed | 3 | * |
bridadan | 0:5290cb128aed | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
bridadan | 0:5290cb128aed | 5 | * you may not use this file except in compliance with the License. |
bridadan | 0:5290cb128aed | 6 | * You may obtain a copy of the License at |
bridadan | 0:5290cb128aed | 7 | * |
bridadan | 0:5290cb128aed | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
bridadan | 0:5290cb128aed | 9 | * |
bridadan | 0:5290cb128aed | 10 | * Unless required by applicable law or agreed to in writing, software |
bridadan | 0:5290cb128aed | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
bridadan | 0:5290cb128aed | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
bridadan | 0:5290cb128aed | 13 | * See the License for the specific language governing permissions and |
bridadan | 0:5290cb128aed | 14 | * limitations under the License. |
bridadan | 0:5290cb128aed | 15 | */ |
bridadan | 0:5290cb128aed | 16 | |
bridadan | 0:5290cb128aed | 17 | #include "mbed.h" |
bridadan | 0:5290cb128aed | 18 | #include "LWIPInterface.h" |
bridadan | 0:5290cb128aed | 19 | #include "NSAPITests.h" |
sam_grove | 2:9181decb4d5c | 20 | |
bridadan | 0:5290cb128aed | 21 | LWIPInterface iface; |
sam_grove | 2:9181decb4d5c | 22 | |
bridadan | 0:5290cb128aed | 23 | int main() |
bridadan | 0:5290cb128aed | 24 | { |
bridadan | 0:5290cb128aed | 25 | int32_t result = iface.connect(); |
sam_grove | 2:9181decb4d5c | 26 | |
bridadan | 0:5290cb128aed | 27 | if (result) { |
sam_grove | 2:9181decb4d5c | 28 | printf("Interface failed to connect with code %d\r\n", result); |
bridadan | 0:5290cb128aed | 29 | } else { |
bridadan | 0:5290cb128aed | 30 | nsapi_tests("BSDInterface Tests", &iface, "0.0.0.0", 4000); |
bridadan | 0:5290cb128aed | 31 | iface.disconnect(); |
bridadan | 0:5290cb128aed | 32 | } |
sam_grove | 2:9181decb4d5c | 33 | while(1); |
bridadan | 0:5290cb128aed | 34 | } |