This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/TM4C129XNCZAD: Detect network link at boot

Part Number: TM4C129XNCZAD

Tool/software: TI-RTOS

How can my device detect a network connection at boot?

I managed to register a link callback with NC_setLinkHook( void (*LinkHook)(int)); which solves most of my problem. This gives me a link up callback if my device boots plugged into the network, but it doesn't trigger the link down message if my device boots disconnected. Is it safe to assume no news is bad news?

Is there an appropriate time to register my link function? I currently register it inside another hook function, the stack thread initialization hook. The Stack thread being hook could be used too I assume. (It would be nice to set this hook in XGCONF with all the other hook functions)

  • Hi Peter,

    If your device boots up and you are not connect to a network, the hook functions is not called. It's only called on a transition. So assume it's down until told otherwise.

    I'd register the LinkHook in the Global.stackInitHook function.

    Without looking deeper, I would not use Global.stackBeginHook. The following statement after the generated code (<ndk_install_dir>\packages\ti\ndk\config\Global.xdt is the template) for the stackBeginHook placement seems like a red flag!

    call to user specified stackBeginHook


    /* THIS MUST BE THE ABSOLUTE FIRST THING DONE IN AN APPLICATION!! */

    rc = NC_SystemOpen(`localNetSchedPri`, `localNetSchedOp`);

    Todd