AB&T / SOEM

Dependents:   EasyCAT_LAB_simple EasyCAT_LAB_very_simple EasyCAT_LAB

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers oshw.cpp Source File

oshw.cpp

00001 /*
00002  * Licensed under the GNU General Public License version 2 with exceptions. See
00003  * LICENSE file in the project root for full license information
00004  */
00005 
00006 #include "oshw.h"
00007 #include <stdlib.h>
00008 #include "lwip/def.h"
00009 
00010 
00011 /**
00012  * Host to Network byte order (i.e. to big endian).
00013  *
00014  * Note that Ethercat uses little endian byte order, except for the Ethernet
00015  * header which is big endian as usual.
00016  */
00017  
00018  
00019 
00020 uint16 oshw_htons(const uint16 host)
00021 {
00022     return htons (host);
00023 }
00024 
00025 
00026 /**
00027  * Network (i.e. big endian) to Host byte order.
00028  *
00029  * Note that Ethercat uses little endian byte order, except for the Ethernet
00030  * header which is big endian as usual.
00031  */
00032 uint16 oshw_ntohs(const uint16 network)
00033 {
00034     return ntohs (network);
00035 }
00036 
00037 /* Create list over available network adapters.
00038  * @return First element in linked list of adapters
00039  */
00040 ec_adaptert * oshw_find_adapters(void)
00041 {
00042    ec_adaptert * ret_adapter = NULL;
00043 
00044    /* TODO if needed */
00045 
00046    return ret_adapter;
00047 }
00048 
00049 /** Free memory allocated memory used by adapter collection.
00050  * @param[in] adapter = First element in linked list of adapters
00051  * EC_NOFRAME.
00052  */
00053 void oshw_free_adapters(ec_adaptert * adapter)
00054 {
00055        /* TODO if needed */
00056 }