lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] trigger linkoutput function to be called


From: samyuktar
Subject: [lwip-users] trigger linkoutput function to be called
Date: Thu, 14 Nov 2019 17:11:29 -0700 (MST)

Hello,
I am using a CC1352P1 Launchxl dev board from TI, in conjunction with an
SPI-Ethernet bridge (ENC28J60). I want to test on wireshark a simple
transmit of data from my device to my computer system. I have been able to
see this just using the ENC28J60 without any stack running on it.

Currently, I have configured the ethernetif.c file with my low level
transmit and receive functions, and I have also configured the
ethernetif_init functions with my ethernet_Init function which configures
the ENC28J60 for ethernet transfer. I have set netif->linkoutput =
low_level_output() in ethernetif_init(), and low_level_output calls my
ethernet_transmitPackets() function. I would like to know how to trigger the
call to low_level_output() so I can see if anything is being sent from my
device to the computer. I would also like to know how to set the data (in
pbuf) to be sent out.

So far, this is what I do to setup :



struct eth_addr test_ethaddr =  {{0xFF,0xEE,0xDD,0xCC,0xBB,0xAA}};
struct eth_addr test_ethaddr2 = {{0xAA,0xBB,0xCC,0xDD,0xEE,0xFF}};


struct netif *mynetif;
static ip4_addr_t ip_addr, netmask, gw;

struct netif *netif;
struct pbuf *p;
void* state;


IP4_ADDR(&gw, 192, 168,0,1)
IP4_ADDR(&ip_addr, 192, 168,0,1) 
IP4_ADDR(&netmask, 255,255,0,0)

netif_set_default(netif_add(mynetif, &ip_addr, &netmask,
                              &gw, NULL, (netif_init_fn) ethernetif_init,
(netif_input_fn) ethernetif_input));
/* Bring the interface up */
netif_set_up(netif);


And within ethernetif_init (which is set as the initialization function in
netif_add), I set the properties of netif such as netif->state,
netif->output = etharp_output, and netif->linkoutput = low_level_output. 

I would like to know when ethernetif_init, ethernetif_input and
low_level_output are actually called, and how to fill in data to send. 




--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]