NetworkSocketAPI

Dependencies:   DnsQuery

Dependents:   HelloWizFi250Interface

Fork of NetworkSocketAPI by NetworkSocketAPI

Committer:
geky
Date:
Fri Apr 15 16:06:01 2016 +0000
Revision:
71:9c351e105812
Parent:
60:0360cb987da3
Added CellularInterface for Cellular devices

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Christopher Haster 23:1e86d9fb3d86 1 /* NetworkInterface Base Class
Christopher Haster 23:1e86d9fb3d86 2 * Copyright (c) 2015 ARM Limited
Christopher Haster 23:1e86d9fb3d86 3 *
Christopher Haster 23:1e86d9fb3d86 4 * Licensed under the Apache License, Version 2.0 (the "License");
Christopher Haster 23:1e86d9fb3d86 5 * you may not use this file except in compliance with the License.
Christopher Haster 23:1e86d9fb3d86 6 * You may obtain a copy of the License at
Christopher Haster 23:1e86d9fb3d86 7 *
Christopher Haster 23:1e86d9fb3d86 8 * http://www.apache.org/licenses/LICENSE-2.0
Christopher Haster 23:1e86d9fb3d86 9 *
Christopher Haster 23:1e86d9fb3d86 10 * Unless required by applicable law or agreed to in writing, software
Christopher Haster 23:1e86d9fb3d86 11 * distributed under the License is distributed on an "AS IS" BASIS,
Christopher Haster 23:1e86d9fb3d86 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Christopher Haster 23:1e86d9fb3d86 13 * See the License for the specific language governing permissions and
Christopher Haster 23:1e86d9fb3d86 14 * limitations under the License.
Christopher Haster 23:1e86d9fb3d86 15 */
Christopher Haster 23:1e86d9fb3d86 16
Christopher Haster 23:1e86d9fb3d86 17 #include "NetworkInterface.h"
geky 31:7f15b95f2a1d 18 #include "DnsQuery.h"
Christopher Haster 23:1e86d9fb3d86 19
Christopher Haster 23:1e86d9fb3d86 20
geky 30:3cc78f5db99d 21 bool NetworkInterface::isConnected()
geky 30:3cc78f5db99d 22 {
Christopher Haster 23:1e86d9fb3d86 23 return getIPAddress() != 0;
Christopher Haster 23:1e86d9fb3d86 24 }
Christopher Haster 23:1e86d9fb3d86 25
geky 31:7f15b95f2a1d 26 int32_t NetworkInterface::getHostByName(const char *name, char *ip)
geky 31:7f15b95f2a1d 27 {
geky 56:19c9e332c0f1 28 return dnsQuery(this, name, ip);
geky 31:7f15b95f2a1d 29 }