Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ethernet_api.h Source File

ethernet_api.h

00001 
00002 /** \addtogroup hal */
00003 /** @{*/
00004 /* mbed Microcontroller Library
00005  * Copyright (c) 2006-2013 ARM Limited
00006  * SPDX-License-Identifier: Apache-2.0
00007  *
00008  * Licensed under the Apache License, Version 2.0 (the "License");
00009  * you may not use this file except in compliance with the License.
00010  * You may obtain a copy of the License at
00011  *
00012  *     http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  * Unless required by applicable law or agreed to in writing, software
00015  * distributed under the License is distributed on an "AS IS" BASIS,
00016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017  * See the License for the specific language governing permissions and
00018  * limitations under the License.
00019  */
00020 #ifndef MBED_ETHERNET_API_H
00021 #define MBED_ETHERNET_API_H
00022 
00023 #include "device.h"
00024 #include "platform/mbed_toolchain.h"
00025 
00026 #if DEVICE_ETHERNET
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 // Connection constants
00033 MBED_DEPRECATED(
00034     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00035     " either lwIP or Nanostack."
00036 )
00037 int ethernet_init(void);
00038 MBED_DEPRECATED(
00039     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00040     " either lwIP or Nanostack."
00041 )
00042 void ethernet_free(void);
00043 
00044 // write size bytes from data to ethernet buffer
00045 // return num bytes written
00046 // or -1 if size is too big
00047 MBED_DEPRECATED(
00048     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00049     " either lwIP or Nanostack."
00050 )
00051 int ethernet_write(const char *data, int size);
00052 
00053 // send ethernet write buffer, returning the packet size sent
00054 MBED_DEPRECATED(
00055     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00056     " either lwIP or Nanostack."
00057 )
00058 int ethernet_send(void);
00059 
00060 // receive from ethernet buffer, returning packet size, or 0 if no packet
00061 MBED_DEPRECATED(
00062     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00063     " either lwIP or Nanostack."
00064 )
00065 int ethernet_receive(void);
00066 
00067 // read size bytes in to data, return actual num bytes read (0..size)
00068 // if data == NULL, throw the bytes away
00069 MBED_DEPRECATED(
00070     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00071     " either lwIP or Nanostack."
00072 )
00073 int ethernet_read(char *data, int size);
00074 
00075 // get the ethernet address
00076 MBED_DEPRECATED(
00077     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00078     " either lwIP or Nanostack."
00079 )
00080 void ethernet_address(char *mac);
00081 
00082 // see if the link is up
00083 MBED_DEPRECATED(
00084     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00085     " either lwIP or Nanostack."
00086 )
00087 int ethernet_link(void);
00088 
00089 // force link settings
00090 MBED_DEPRECATED(
00091     "Ethernet drivers are provided by a class derived from `EMAC` attached to"
00092     " either lwIP or Nanostack."
00093 )
00094 void ethernet_set_link(int speed, int duplex);
00095 
00096 #ifdef __cplusplus
00097 }
00098 #endif
00099 
00100 #endif
00101 
00102 #endif
00103 
00104 
00105 /** @}*/