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.

[参考译文] TM4C129XNCZAD:我想在通过 NDK API 接收 ARP 数据包时设置回调函数

Guru**** 2391415 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1239479/tm4c129xnczad-i-want-to-set-callback-function-upon-arp-packet-reception-through-ndk-apis

器件型号:TM4C129XNCZAD

我想使用这个函数'cooki_setARPHook'来设置一个在接收 ARP 数据包时被调用的挂钩函数

函数如下所示  

void fxnARPCallback(void* data)
{
    /*
    check arp sender ip packet
    */
}

/* inside another task we are using */
void task()
{
    LLI_setARPHook(fxnARPCallback);
    /*then trigger an arp packet from sender PC 
        by removing the arp entry from pc then ping to this socket in order to
        look at the sender's arp data packet */
}


那么、在执行此操作后、回调人员从不调用、那么我该如何修复它呢?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

     在 NDK 中、您可以添加挂钩函数、或许可以为"网络 IP 地址挂钩"添加挂钩回调函数。 请参见以下示例。  

    或者、您也可以像下面一样手动添加到.cfg 文件中。  

    Global.networkIPAddrHook ="&MyHookFunction";