lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] (no subject)


From: Jin Won Seo
Subject: [lwip-users] (no subject)
Date: Thu, 19 Sep 2013 03:25:22 +0900

Hi,

I am testing listener modules using LM3S9B96, lwip1.3.2, safeRTOS, StellarisWare 10636, ccs 5.4.x.

The listener task running in safeRTOS basically receives message from server daemon in Unix using socket(UDP).

As the server daemon sends messages, the listener seems like not getting anything from the server

Here is a capture of Wireshark:

Also I directly attempts to access the listener using telnet command(telnet 192.2.0.208 5701), but the below error message comes out

"telnet : Unable to connect to remote host: Connection refused"

Here is my listener task codes:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    // Setup the local address.
    memset((char *) &sClient, 0, sizeof(sClient));
    sClient.sin_family = AF_INET;
    sClient.sin_len = sizeof(sClient);
//  sClient.sin_addr.s_addr = lwIPLocalIPAddrGet();
    sClient.sin_addr.s_addr = inet_addr("192.2.0.208");
    sClient.sin_port = htons(sPort);// int sPort = 5701
 
    //setup the destination address
    memset((char *) &sDestAddr, 0, sizeof(sDestAddr));
    sDestAddr.sin_family = AF_INET;
    sDestAddr.sin_len = sizeof(sDestAddr);
    sDestAddr.sin_addr.s_addr = inet_addr("192.2.0.3");// for test, hard-corded
//  sDestAddr.sin_addr.s_addr = chgd_in_addr();
    sDestAddr.sin_port = htons(sPort);
 
    while((socket_fd = lwip_socket(AF_INET, SOCK_DGRAM, 0)) == 0)
    {
        //xTaskDelay(CHGD_OPEN_TIME);
        xTaskDelay(SECONDS(5));//arbitrary time for test
    }
 
    //bind socket to the local address and port
    if(lwip_bind(socket_fd, (struct sockaddr *) &sClient, sizeof(sClient)) == -1)
        lwip_close(socket_fd);
 
    while(1)
    {
        //receive from server
        length = lwip_recvfrom(socket_fd, (char *) msg_buf, sizeof(msg_buf),
                MSG_DONTWAIT, (struct sockaddr *)&sDestAddr, &size);
 
        if(length > 0)
        {
            sMsg = (NET_MSG *) (msg_buf);
            mon_cmd_do(socket_fd, &sDestAddr, sMsg, length);
        }
        lwip_close(socket_fd);
        xTaskDelay(1);// 1ms tick delay
    }

Whenever I set a breakpoint to see if the packets are received, but safeRTOS doesn't let me debug. It directly brings about the fail of scheduler. So, I don't know how I can debug other than WireShark.

I have not found out what is wrong with my modules.

Anyone can help me out?


reply via email to

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