TCP issues

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TCP issues

1,427 Views
CamiloA_
Contributor III

Good morning everybody, today I have a couple of questions regarding TCP/IP functions and hopefully you could give me advices. My first problem is that I need to know if my RJ-45 cable is disconnected. I´ve tried a lot of things like: ipcfg_get_link_active, (which is always returning 0, whether the cable is connected or not) ipcfg_get_state(), which is responding 3 which stands for IPCFG_STATE_STATIC_IP, ipcfg_task_create() (everytime I call this sentence my program quits the task, so I can´t test if it actually works). I also tried to shutdown the socket and connecting it again afterwards, but never connects again. I really don´t know what to do because I`ve tried almost everything I know. On the other hand, does someone how to reset mi microcontroller with an mqx command?

Best Regards and thank you in advance for your cooperation.

0 Kudos
Reply
5 Replies

1,257 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Camilo,

Have you tried these:

void main(uint_32 param)

{

setup_network();

ipcfg_task_create(8, 1000);

if (! ipcfg_task_stats()) _task_block();

}

Or this:

void main(uint_32 param)

{

setup_network();

while (1)

{

_time_delay(1000);

ipcfg_task_poll();

}

}


Regards,

-Garabo

1,257 Views
CamiloA_
Contributor III

Thank you very much Garabo, yes, actually that was the first thing that I`ve tried but setup_network(); is not defined in my MQX libraries. it says to me that function has no prototype. I tried without using it and every time I call ipcfg_task_create(8, 1000); the current task is blocked, maybe it´s because of this, how is it defined in your mqx, maybe I can add it manually.

Thanks and have a good day..

0 Kudos
Reply

1,257 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Camilo,

Well, actually the function setup_network(); does not exist. It is only to let you know that you have to do the network setup before trying to perform any IPCFG work. I recommend you to review the example:

C:\Program Files\Freescale\Freescale MQX 3.8\demo\security_webserver

The function SEC_InitializeNetworking() is the one you want to port to your example. The other thing you can do is to test the function ipcfg_task_create() in this example.

Regards,

-Garabo

0 Kudos
Reply

1,257 Views
CamiloA_
Contributor III

:smileyhappy: Thanks, that`s what i supposed because i already made the network configuration and worked OK, but since the rj45 detection doesn`t work i thought that maybe setup_network(); was a special function required for it. Gonna read it, thank you for your patience.

0 Kudos
Reply

1,257 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Good Luck!

-Garabo

0 Kudos
Reply