hi i create board with lpc1788 and lan8720 i try send data with lan8720 and RL-TCPnet Library
#include <rtl.h>
U8 tcp_soc; U8 soc_state; BOOL wait_ack,tick;
U16 tcp_callback (U8 soc, U8 event, U8 *ptr, U16 par); void send_data (void); static void timer_poll ();
int main (void) {
init_TcpNet (); tcp_soc = tcp_get_socket (TCP_TYPE_CLIENT, 0, 120, tcp_callback); soc_state = 0;
while (1) { main_TcpNet (); send_data (); } }
void send_data (void) { static U8 rem_IP[4] = {192,168,0,6}; static int bcount; U32 max,i; U8 *sendbuf;
switch (soc_state) { case 0: tcp_connect (tcp_soc, rem_IP, 1000, 0); bcount = 0; wait_ack = __FALSE; soc_state = 1; return;
case 2: if (wait_ack == __TRUE) { return; } max = tcp_max_dsize (tcp_soc); sendbuf = tcp_get_buf (max); for (i = 0; i < max; i += 2) { sendbuf[i] = bcount >> 8; sendbuf[i+1] = bcount & 0xFF; if (bcount >= 32768) { soc_state = 3; break; } } tcp_send (tcp_soc, sendbuf, i); wait_ack = __TRUE; return;
case 3: if (wait_ack == __TRUE) { return; } tcp_close (tcp_soc); soc_state = 4; return; } }
U16 tcp_callback (U8 soc, U8 event, U8 *ptr, U16 par) {
switch (event) {
case TCP_EVT_CONNECT:
soc_state = 2; break; case TCP_EVT_ACK:
wait_ack = __FALSE; break;
} return (0); }
code not work and i can not ping device IP set in file NET_CONFIG.C
bump
Terkidi?
can u help plz
jalebe man faghat post aval ro neveshtam
Ye yarui hast miad az in kara mikone. vali mamolan javabam mide. alan fek konam balad nist.
>>i create board with lpc1788 and lan8720
And what design validation have you done? None of the presented code seems to relate to the hardware attachment and configuration. Perhaps you should start at a lower level, and work up the stack from there?
Read the instructions about posting source code, and don't bump threads
It work by other source code i want use it by RL-TCPNet