ArmSys Support
ArmsysApi  0.12.18

#include <BNetwork.h>

Public Types

enum  PhyType { PhyTypeDP83848, PhyTypeLAN8742A }
 

Public Member Functions

 BNetwork ()
 
virtual ~BNetwork ()
 
BError init (const BUInt8 *macAddress, BUInt8 phyNum, PhyType phyType, const Pin *pins=0)
 Initialise the Ethernet. More...
 
BError start (Bool dhcp, IpAddress ipAddress=0, IpAddress netmask=0, IpAddress gateway=0)
 Configure the Ethernet. More...
 
BError config (Bool dhcp, IpAddress ipAddress=0, IpAddress netmask=0, IpAddress gateway=0)
 Configure the Ethernet. More...
 
void setUpDown (Bool up)
 
void getMac (BUInt8 *mac)
 
void getIpAddress (IpAddress &ipAddress)
 
void getIpNetmask (IpAddress &ipAddress)
 
void getIpGateway (IpAddress &ipAddress)
 
void getIpTimeServer (IpAddress &ipAddress)
 
void getStats (BNetworkStats &stats)
 
void interrupt (int event)
 
void process ()
 Processes RX packets and other events. More...
 
void process_dhcp ()
 Process DHCP. More...
 
void linkChanged ()
 The Ethernet link has changed. More...
 
err_t etherInit ()
 Initialise low level ethernet. More...
 
err_t etherPacketSend (IpPacket *packet)
 Send an Ethernet packet. More...
 
Bool etherPacketRecv ()
 Process an Ethernet input packet. More...
 
err_t etherAddMulticastAddress (const ip4_addr_t *group, enum netif_mac_filter_action action)
 Adds a MAC address for multicast filtering. More...
 
void phyInit ()
 Initialise PHY information. More...
 
void phyEnable (Bool on)
 Enable the PHY. More...
 
BError phySet (Bool autoNeg, Bool fullDuplex, BUInt32 speed)
 Set phy mode. More...
 
void phySetup ()
 Setup PHY. More...
 
void phyProcess ()
 Process PHY changes on interrupt from PHY. More...
 
void phyUpdate ()
 Update MAC information from PHY. More...
 
void phyPrint ()
 Print PHY settings. More...
 
BError ping (BSocketAddress address, BUInt32 timeout, BUInt32 &timeUs)
 Perfom an ICMP ping. More...
 
void debugPrint ()
 

Public Attributes

ETH_HandleTypeDef oether
 The ethernet low level driver. More...
 
struct netif onetif
 The LwIP network interface. More...
 

Protected Attributes

BUInt8 omacAddress [6]
 The hardware MAC address. More...
 
BUInt8 ophyNum
 The PHY number. More...
 
PhyType ophyType
 The PHY type. More...
 
Bool ophyAutoNeg
 PHY auto negotiation. More...
 
Bool ophyFullDuplex
 PHY full duplex. More...
 
BUInt32 ophySpeed
 PHY speed. More...
 
Bool odhcp
 DHCP enabled. More...
 
ip_addr_t oipAddress
 
ip_addr_t onetmask
 
ip_addr_t ogateway
 
BNetworkProcessTask oprocessTask
 The Ethernet processing task. More...
 
BQueue< BUIntoeventQueue
 Event processing queue. More...
 
BNetworkStats ostats
 Statistics. More...
 

Member Enumeration Documentation

◆ PhyType

Enumerator
PhyTypeDP83848 
PhyTypeLAN8742A 

Constructor & Destructor Documentation

◆ BNetwork()

BNetwork::BNetwork ( )

◆ ~BNetwork()

BNetwork::~BNetwork ( )
virtual

Member Function Documentation

◆ config()

BError BNetwork::config ( Bool  dhcp,
IpAddress  ipAddress = 0,
IpAddress  netmask = 0,
IpAddress  gateway = 0 
)

Configure the Ethernet.

◆ debugPrint()

void BNetwork::debugPrint ( )

◆ etherAddMulticastAddress()

err_t BNetwork::etherAddMulticastAddress ( const ip4_addr_t *  group,
enum netif_mac_filter_action  action 
)

Adds a MAC address for multicast filtering.

◆ etherInit()

err_t BNetwork::etherInit ( )

Initialise low level ethernet.

◆ etherPacketRecv()

Bool BNetwork::etherPacketRecv ( )

Process an Ethernet input packet.

◆ etherPacketSend()

err_t BNetwork::etherPacketSend ( IpPacket packet)

Send an Ethernet packet.

◆ getIpAddress()

void BNetwork::getIpAddress ( IpAddress ipAddress)

◆ getIpGateway()

void BNetwork::getIpGateway ( IpAddress ipAddress)

◆ getIpNetmask()

void BNetwork::getIpNetmask ( IpAddress ipAddress)

◆ getIpTimeServer()

void BNetwork::getIpTimeServer ( IpAddress ipAddress)

◆ getMac()

void BNetwork::getMac ( BUInt8 mac)

◆ getStats()

void BNetwork::getStats ( BNetworkStats stats)

◆ init()

BError BNetwork::init ( const BUInt8 macAddress,
BUInt8  phyNum,
PhyType  phyType,
const Pin pins = 0 
)

Initialise the Ethernet.

BNetwork::init pins define CPU pins used.

◆ interrupt()

void BNetwork::interrupt ( int  event)

◆ linkChanged()

void BNetwork::linkChanged ( )

The Ethernet link has changed.

◆ phyEnable()

void BNetwork::phyEnable ( Bool  on)

Enable the PHY.

◆ phyInit()

void BNetwork::phyInit ( )

Initialise PHY information.

◆ phyPrint()

void BNetwork::phyPrint ( )

Print PHY settings.

◆ phyProcess()

void BNetwork::phyProcess ( )

Process PHY changes on interrupt from PHY.

Process PHY changes on interrupt from PHY or poll.

◆ phySet()

BError BNetwork::phySet ( Bool  autoNeg,
Bool  fullDuplex,
BUInt32  speed 
)

Set phy mode.

◆ phySetup()

void BNetwork::phySetup ( )

Setup PHY.

◆ phyUpdate()

void BNetwork::phyUpdate ( )

Update MAC information from PHY.

◆ ping()

BError BNetwork::ping ( BSocketAddress  address,
BUInt32  timeout,
BUInt32 timeUs 
)

Perfom an ICMP ping.

◆ process()

void BNetwork::process ( )

Processes RX packets and other events.

◆ process_dhcp()

void BNetwork::process_dhcp ( )

Process DHCP.

◆ setUpDown()

void BNetwork::setUpDown ( Bool  up)

◆ start()

BError BNetwork::start ( Bool  dhcp,
IpAddress  ipAddress = 0,
IpAddress  netmask = 0,
IpAddress  gateway = 0 
)

Configure the Ethernet.

Member Data Documentation

◆ odhcp

Bool BNetwork::odhcp
protected

DHCP enabled.

◆ oether

ETH_HandleTypeDef BNetwork::oether

The ethernet low level driver.

◆ oeventQueue

BQueue<BUInt> BNetwork::oeventQueue
protected

Event processing queue.

◆ ogateway

ip_addr_t BNetwork::ogateway
protected

◆ oipAddress

ip_addr_t BNetwork::oipAddress
protected

◆ omacAddress

BUInt8 BNetwork::omacAddress[6]
protected

The hardware MAC address.

◆ onetif

struct netif BNetwork::onetif

The LwIP network interface.

◆ onetmask

ip_addr_t BNetwork::onetmask
protected

◆ ophyAutoNeg

Bool BNetwork::ophyAutoNeg
protected

PHY auto negotiation.

◆ ophyFullDuplex

Bool BNetwork::ophyFullDuplex
protected

PHY full duplex.

◆ ophyNum

BUInt8 BNetwork::ophyNum
protected

The PHY number.

◆ ophySpeed

BUInt32 BNetwork::ophySpeed
protected

PHY speed.

◆ ophyType

PhyType BNetwork::ophyType
protected

The PHY type.

◆ oprocessTask

BNetworkProcessTask BNetwork::oprocessTask
protected

The Ethernet processing task.

◆ ostats

BNetworkStats BNetwork::ostats
protected

Statistics.


The documentation for this class was generated from the following files: