fsfw-example-common/stm32h7/networking/networking.cpp

16 lines
542 B
C++
Raw Normal View History

2021-07-16 13:20:38 +02:00
#include "networking.h"
2022-05-05 20:55:28 +02:00
#include "udp_config.h"
2021-07-16 13:20:38 +02:00
bool ethernetCableConnected = false;
2022-05-05 20:55:28 +02:00
void networking::setEthCableConnected(bool status) { ethernetCableConnected = status; }
2021-07-16 13:20:38 +02:00
2022-05-05 20:55:28 +02:00
bool networking::getEthCableConnected() { return ethernetCableConnected; }
2021-07-16 13:20:38 +02:00
void networking::setLwipAddresses(ip_addr_t* ipaddr, ip_addr_t* netmask, ip_addr_t* gw) {
2022-05-05 20:55:28 +02:00
IP4_ADDR(ipaddr, IP_ADDR0, IP_ADDR1, IP_ADDR2, IP_ADDR3);
IP4_ADDR(netmask, NETMASK_ADDR0, NETMASK_ADDR1, NETMASK_ADDR2, NETMASK_ADDR3);
IP4_ADDR(gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
2021-07-16 13:20:38 +02:00
}