AGHAF  4.5.1
Annecy electronique Generic Hardware Access Framework
aghaf_eth.h
Go to the documentation of this file.
1 // Copyright (c) 2019 by ANNECY ELECTRONIQUE, Chavanod, France
2 
6 
7 #ifndef EXXOTEST_AGHAF_ETHERNET_H
8 #define EXXOTEST_AGHAF_ETHERNET_H
9 
10 #include "aghaf_global.h"
11 #include <ghap/aghaf_eth_enums.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
19 
20 #define AGHAF_ETH_ALEN 6
21 
23 typedef void * AGHAF_EthBus;
24 
26 typedef struct AGHAF_ETH_MacAddress {
27  uint8_t data[AGHAF_ETH_ALEN];
29 
30 AGHAF_PUBLIC_FUNCTION(AGHAF_EthBus, AGHAF_ETH_getBus, (AGHAF_Device device, uint8_t index));
31 AGHAF_PUBLIC_FUNCTION(uint8_t, AGHAF_ETH_getBusIndex, (AGHAF_EthBus ethernet));
32 AGHAF_PUBLIC_FUNCTION(uint8_t, AGHAF_ETH_getBusCount, (AGHAF_Device device));
33 
34 AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_ETH_activate, (AGHAF_EthBus ethernet));
35 AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_ETH_deactivate, (AGHAF_EthBus ethernet));
36 AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_ETH_isActivated, (AGHAF_EthBus ethernet, AGHAF_BOOL *isActivated));
37 
38 AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_ETH_getParam, (AGHAF_EthBus ethernet, AGHAF_ETH_Param param, uint32_t *value));
39 AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_ETH_setParam, (AGHAF_EthBus ethernet, AGHAF_ETH_Param param, uint32_t value));
40 
41 AGHAF_PUBLIC_FUNCTION(void, AGHAF_ETH_getFriendlyNameEthCard, (AGHAF_EthBus ethernet, char **name));
42 AGHAF_PUBLIC_FUNCTION(void, AGHAF_ETH_freeFriendlyName, (char *friendlyName));
43 AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_ETH_getMacAddress, (AGHAF_EthBus ethernet, AGHAF_ETH_MacAddress* macAddress));
44 
45 AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_ETH_setEthernetDiagLineState, (AGHAF_EthBus ethernet, AGHAF_BOOL active));
46 
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif // EXXOTEST_AGHAF_ETHERNET_H
#define AGHAF_ETH_ALEN
size of a MAC address
Definition: aghaf_eth.h:20
AGHAF_Status AGHAF_ETH_setParam(AGHAF_EthBus ethernet, AGHAF_ETH_Param param, uint32_t value)
set a parameter from an ethernet card
Definition: aghaf_eth.cpp:111
AGHAF_Status AGHAF_ETH_deactivate(AGHAF_EthBus ethernet)
stop the communication with the Ethernet
Definition: aghaf_eth.cpp:64
void AGHAF_ETH_freeFriendlyName(char *friendlyName)
Free the memory allocated with AGHAF_Device_getFriendlyNameEthCard.
Definition: aghaf_eth.cpp:139
AGHAF_Status AGHAF_ETH_isActivated(AGHAF_EthBus ethernet, AGHAF_BOOL *isActivated)
allow to know if the communication on the Ethernet is started or not
Definition: aghaf_eth.cpp:77
AGHAF_Status AGHAF_ETH_setEthernetDiagLineState(AGHAF_EthBus ethernet, AGHAF_BOOL active)
AGHAF_ETH_setEthernetDiagLineState.
Definition: aghaf_eth.cpp:172
void * AGHAF_EthBus
Handle on a ethernet object.
Definition: aghaf_eth.h:23
AGHAF_Status AGHAF_ETH_activate(AGHAF_EthBus ethernet)
start the communication with the Ethernet
Definition: aghaf_eth.cpp:52
struct AGHAF_ETH_MacAddress AGHAF_ETH_MacAddress
contains a MAC address
AGHAF_Status AGHAF_ETH_getParam(AGHAF_EthBus ethernet, AGHAF_ETH_Param param, uint32_t *value)
get a parameter from an ethernet card
Definition: aghaf_eth.cpp:95
AGHAF_EthBus AGHAF_ETH_getBus(AGHAF_Device device, uint8_t index)
return the Ethernet bus at index in parameter
Definition: aghaf_eth.cpp:15
uint8_t AGHAF_ETH_getBusCount(AGHAF_Device device)
return the number of CAN bus from a device
Definition: aghaf_eth.cpp:40
AGHAF_Status AGHAF_ETH_getMacAddress(AGHAF_EthBus ethernet, AGHAF_ETH_MacAddress *macAddress)
return the Ethernet mac address on device "device", and channel "index"
Definition: aghaf_eth.cpp:151
uint8_t AGHAF_ETH_getBusIndex(AGHAF_EthBus ethernet)
return the index from a Ethernet
Definition: aghaf_eth.cpp:28
void AGHAF_ETH_getFriendlyNameEthCard(AGHAF_EthBus ethernet, char **name)
Provide the friendly name associated to the network card.
Definition: aghaf_eth.cpp:127
AGHAF_Status
enumerator to define the error type in aghaf functions
Definition: aghaf_global.h:109
AGHAF_BOOL
enumerator to get a bool definition
Definition: aghaf_global.h:102
void * AGHAF_Device
handle on an exxotest device
Definition: aghaf_global.h:145
contains a MAC address
Definition: aghaf_eth.h:26
uint8_t data[6]
MAC addres from a card.
Definition: aghaf_eth.h:27