How to stop RTCS DHCP server

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to stop RTCS DHCP server

ソリューションへジャンプ
1,284件の閲覧回数
JasonPeng
Contributor I

Hi All,

I am using RTCS DHCP server on the MQX 4.02. DHCP server is working on our product.

As our product requirement, I need to stop the RTCS DHCP server. In the MQX_RTCS_User_Guide.pdf, I can't find the stop DHCP server API.

Can anyone give me some insight how to stop RTCS DHCP server?

Thanks in advance,

Jason

ラベル(1)
0 件の賞賛
返信
1 解決策
1,102件の閲覧回数
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Jason,

The error makes sense. This is a brutal stop for the DHCP. This means that there is not a clean up of the sockets used by the task. You will need to create a function that kills the DHCP task and clean up all the resources associated to it.


Have a great day,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,102件の閲覧回数
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Jason,

Just as you pointed, there is not a function to stop the DHCP server. What you can do is to kill the task. Take this code as an example:

/* Start DHCP Server: */

error = DHCPSRV_init(“DHCP server”, 7, 2000);

/* Kill DHCP server */

task_id = _task_get_id_from_name(“DHCP server”);

_task_abort(task_id);

I hope this helps.

Have a great day,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
1,102件の閲覧回数
JasonPeng
Contributor I

Hi Garabo,

Thank you for your reply.

The DHCP server task can be killed after running your code.

However I got the error when I restart DHCP server.

  // Start DHCP Server

    error = DHCPSRV_init("DHCP server", 7, 2000);

    if (error != RTCS_OK) {  <== error is 0x1663 (RTCSERR_UDP_PORT_OPEN)

      return error;

    }

   

Any idea?

Thanks a lot!

Jason

0 件の賞賛
返信
1,103件の閲覧回数
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Jason,

The error makes sense. This is a brutal stop for the DHCP. This means that there is not a clean up of the sockets used by the task. You will need to create a function that kills the DHCP task and clean up all the resources associated to it.


Have a great day,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信