<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ipcfg_get_link_active not working in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/ipcfg-get-link-active-not-working/m-p/298409#M9585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I used the following code the function works correctly. It will trap the sequence as long as cable is disconnected. Once I connect the cable it will exit my while loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error = RTCS_create();&lt;/P&gt;&lt;P&gt;if (error != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;if ((ipcfg_init_device(BSP_DEFAULT_ENET_DEVICE, enet_address)) != IPCFG_OK) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;while((ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE) == FALSE))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay(100);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;However if I use the below code it is not working. It is always on the _time_delay whether I plug in/out my cable.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error = RTCS_create();&lt;/P&gt;&lt;P&gt;if (error != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;if (ENET_initialize(BSP_DEFAULT_ENET_DEVICE, enet_address, 0, &amp;amp;ehandle) != ENET_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;if (RTCS_if_add(ehandle, RTCS_IF_ENET, &amp;amp;ihandle) != RTCS_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;if (RTCS_if_bind(ihandle, ip.ip, ip.mask) != RTCS_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&amp;nbsp; &lt;/P&gt;&lt;P&gt;while((ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE) == FALSE))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay(100);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering why it is not working when I used the latter code compare to the first code. Do I need to set anything?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Mar 2014 14:26:46 GMT</pubDate>
    <dc:creator>vines</dc:creator>
    <dc:date>2014-03-18T14:26:46Z</dc:date>
    <item>
      <title>ipcfg_get_link_active not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/ipcfg-get-link-active-not-working/m-p/298409#M9585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I used the following code the function works correctly. It will trap the sequence as long as cable is disconnected. Once I connect the cable it will exit my while loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error = RTCS_create();&lt;/P&gt;&lt;P&gt;if (error != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;if ((ipcfg_init_device(BSP_DEFAULT_ENET_DEVICE, enet_address)) != IPCFG_OK) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;while((ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE) == FALSE))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay(100);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;However if I use the below code it is not working. It is always on the _time_delay whether I plug in/out my cable.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error = RTCS_create();&lt;/P&gt;&lt;P&gt;if (error != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;if (ENET_initialize(BSP_DEFAULT_ENET_DEVICE, enet_address, 0, &amp;amp;ehandle) != ENET_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;if (RTCS_if_add(ehandle, RTCS_IF_ENET, &amp;amp;ihandle) != RTCS_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;if (RTCS_if_bind(ihandle, ip.ip, ip.mask) != RTCS_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&amp;nbsp; &lt;/P&gt;&lt;P&gt;while((ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE) == FALSE))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay(100);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering why it is not working when I used the latter code compare to the first code. Do I need to set anything?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 14:26:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/ipcfg-get-link-active-not-working/m-p/298409#M9585</guid>
      <dc:creator>vines</dc:creator>
      <dc:date>2014-03-18T14:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: ipcfg_get_link_active not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/ipcfg-get-link-active-not-working/m-p/298410#M9586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I know why this is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tracing back to the function ipcfg_get_link_active in RTCS&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;if (ipcfg_data[device].actual_state != IPCFG_STATE_INIT)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ENET_link_status (((IP_IF_PTR)(ipcfg_data[device].ihandle))-&amp;gt;HANDLE);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;return false;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;actual_state is always in IPCFG_STATE_INIT state in the second code. Thus, it won't enter the ENET_link_status checking. It will always return FALSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now actual_state value is modified in ipcfg_init_interface which is being called by ipcfg_init_device. That is the reason the first code is working because actual_state is no longer in IPCFG_STATE_INIT. It is already in IPCFG_STATE_UNBOUND state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However my question is why is MQX designed such a way? Is there a work around to initiate the handle without using ipcfg_init_device? I would rather do it in the application layer if there is an API, rather than changing something on the hardware layer. Is ipcfg_get_link_active only bounded in high level network management commands IPCFG?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 15:05:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/ipcfg-get-link-active-not-working/m-p/298410#M9586</guid>
      <dc:creator>vines</dc:creator>
      <dc:date>2014-03-18T15:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: ipcfg_get_link_active not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/ipcfg-get-link-active-not-working/m-p/298411#M9587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solve! Just used ENET_link_status instead. I guess this is not designed to be used in APP layer because it is not included on RTCS documentation at least on my MQX version.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 13:28:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/ipcfg-get-link-active-not-working/m-p/298411#M9587</guid>
      <dc:creator>vines</dc:creator>
      <dc:date>2014-03-26T13:28:04Z</dc:date>
    </item>
  </channel>
</rss>

