简体   繁体   中英

OpenThread API: undefined reference to otThreadGetMaxAllowedChildren()

I have the problem with compilation. After adding function call otThreadGetMaxAllowedChildren() in the openthread/examples/apps/cli/main.c I got an error:

openthread/examples/apps/cli/main.c:228: undefined reference to `otThreadGetMaxAllowedChildren'

Similary, the same issue with otThreadGetChildInfoByIndex() :

openthread/examples/apps/cli/main.c:204: undefined reference to `otThreadGetChildInfoByIndex'

I have added -DOPENTHREAD_FTD=1 flag, but error still occurs.

Any idea what should I do to make compilation successful?

The otThreadGetChildInfoByIndex() is only available for FTD builds.

You should either:

  1. Disable MTD and RCP in your build options, or

  2. Wrap your child table code with #if OPENTHREAD_FTD .

You can refer to the CLI code for example usage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM