Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
pal/Test/Common/pal_socket_test_utils.cpp@0:06ee5f8a484a, 2017-03-18 (annotated)
- Committer:
- djmeyers
- Date:
- Sat Mar 18 22:37:16 2017 +0000
- Revision:
- 0:06ee5f8a484a
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| djmeyers | 0:06ee5f8a484a | 1 | /* |
| djmeyers | 0:06ee5f8a484a | 2 | * Copyright (c) 2016 ARM Limited. All rights reserved. |
| djmeyers | 0:06ee5f8a484a | 3 | * SPDX-License-Identifier: Apache-2.0 |
| djmeyers | 0:06ee5f8a484a | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
| djmeyers | 0:06ee5f8a484a | 5 | * not use this file except in compliance with the License. |
| djmeyers | 0:06ee5f8a484a | 6 | * You may obtain a copy of the License at |
| djmeyers | 0:06ee5f8a484a | 7 | * |
| djmeyers | 0:06ee5f8a484a | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| djmeyers | 0:06ee5f8a484a | 9 | * |
| djmeyers | 0:06ee5f8a484a | 10 | * Unless required by applicable law or agreed to in writing, software |
| djmeyers | 0:06ee5f8a484a | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| djmeyers | 0:06ee5f8a484a | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| djmeyers | 0:06ee5f8a484a | 13 | * See the License for the specific language governing permissions and |
| djmeyers | 0:06ee5f8a484a | 14 | * limitations under the License. |
| djmeyers | 0:06ee5f8a484a | 15 | */ |
| djmeyers | 0:06ee5f8a484a | 16 | |
| djmeyers | 0:06ee5f8a484a | 17 | #include "pal.h" |
| djmeyers | 0:06ee5f8a484a | 18 | #include "pal_network.h" |
| djmeyers | 0:06ee5f8a484a | 19 | #include "pal_socket_test_utils.h" |
| djmeyers | 0:06ee5f8a484a | 20 | #include "NetworkInterface.h" |
| djmeyers | 0:06ee5f8a484a | 21 | #include "EthernetInterface.h" |
| djmeyers | 0:06ee5f8a484a | 22 | |
| djmeyers | 0:06ee5f8a484a | 23 | #define TEST_PRINTF printf |
| djmeyers | 0:06ee5f8a484a | 24 | |
| djmeyers | 0:06ee5f8a484a | 25 | void* palTestGetNetWorkInterfaceContext() |
| djmeyers | 0:06ee5f8a484a | 26 | { |
| djmeyers | 0:06ee5f8a484a | 27 | palStatus_t result = PAL_SUCCESS; |
| djmeyers | 0:06ee5f8a484a | 28 | EthernetInterface* netInterface = new EthernetInterface(); |
| djmeyers | 0:06ee5f8a484a | 29 | if (NULL != netInterface) |
| djmeyers | 0:06ee5f8a484a | 30 | { |
| djmeyers | 0:06ee5f8a484a | 31 | TEST_PRINTF("new interface created\r\n"); |
| djmeyers | 0:06ee5f8a484a | 32 | result = netInterface->connect(); |
| djmeyers | 0:06ee5f8a484a | 33 | if (PAL_SUCCESS == result) |
| djmeyers | 0:06ee5f8a484a | 34 | { |
| djmeyers | 0:06ee5f8a484a | 35 | TEST_PRINTF("interface registered : OK \r\n"); |
| djmeyers | 0:06ee5f8a484a | 36 | } |
| djmeyers | 0:06ee5f8a484a | 37 | } |
| djmeyers | 0:06ee5f8a484a | 38 | return netInterface; |
| djmeyers | 0:06ee5f8a484a | 39 | } |