Skip to content

Commit

Permalink
Replaced type "ip_addr" with "ip4_addr"
Browse files Browse the repository at this point in the history
For this code to work with newer versions of Vitis, the type has to be replaced. The original note by Lance Simms can be found here: https://lancesimms.com/Xilinx/MicroZed_UDP_Server_for_Waveform_Centroiding_Chapter3_Part1.html
  • Loading branch information
JarnoBurggraef committed Mar 24, 2021
1 parent b519bfe commit 5be872e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern volatile u8 Error;

// Global Variables for Ethernet handling
extern u16_t RemotePort;
extern struct ip_addr RemoteAddr;
extern struct ip4_addr RemoteAddr;
extern struct udp_pcb send_pcb;

int transfer_data() {
Expand All @@ -37,7 +37,7 @@ void print_app_header()

/* recv_callback: function that handles responding to UDP packets */
void recv_callback(void *arg, struct udp_pcb *upcb,
struct pbuf *p, struct ip_addr *addr, u16_t port)
struct pbuf *p, struct ip4_addr *addr, u16_t port)
{

// Set up a timeout counter and a status variable
Expand Down
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ volatile u8 Error;

// Global Variables for Ethernet handling
u16_t RemotePort = 8;
struct ip_addr RemoteAddr;
struct ip4_addr RemoteAddr;
struct udp_pcb send_pcb;

void
print_ip(char *msg, struct ip_addr *ip)
print_ip(char *msg, struct ip4_addr *ip)
{
print(msg);
xil_printf("%d.%d.%d.%d\n\r", ip4_addr1(ip), ip4_addr2(ip),
Expand All @@ -80,7 +80,7 @@ void print_app_header()

int main()
{
struct ip_addr ipaddr, netmask, gw /*, Remotenetmask, Remotegw*/;
struct ip4_addr ipaddr, netmask, gw /*, Remotenetmask, Remotegw*/;
struct pbuf * psnd;
err_t udpsenderr;
int status = 0;
Expand Down

0 comments on commit 5be872e

Please sign in to comment.