Analyzing CLI project

Hi,

I have built and tested the CLI sample project on nRF52840 DK as well as a custom module. Now I want to extract the parts used for thread commissioning from it. I tried reverse-engineering the project, but I couldn't go very far. The main() function doesn't seem to do anything other than logging some messages and if BT is configured, it enables BLE, which is not enabled in my case. So the command processing is done by probably some kernel threads I guess. But where these initialized I cant find. I am not a FW engineer, but a HW engineer. I am trying to comeup with a minimalistic program to test my boards and understand the Openthread environment. 

Could someone help me to dissect the CLI project to understand how the 

1. command processing is handled

2. Thread commissioning is handled

Thanks heaps, 

Parents
  • Hi, 

    1. OpenThread CLI is integrated into the Zephyr shell. To indicate a Thread command, the ot keyword needs to precede the command. 

    2. Have a look at OpenThread commissioning.

    Regards,
    Amanda

  • Hi Amanda,

    Many thanks for your reply. 

    1. I do understand about preceding the commands with 'ot'. That is like application level. What I want is like back end. How the commands are executed under the hood of CLI program. My requirement is to come up with a simple program which handles the commissioning part by itself. So I am trying to lift the code sections from CLI instead of developing everything from scratch.

    2. I have looked into this, but this is again explanation of the commands and the result in application level isnt it? As I mentioned before, I am after the inner working of the CLI program.

    I tried using Debug mode to trace the program execution path. Still it seems a long way to do it like this.

    I am thinking that the coap_client/server projects may be more useful for me for this task. What is your opinion?

    Thanks,

Reply
  • Hi Amanda,

    Many thanks for your reply. 

    1. I do understand about preceding the commands with 'ot'. That is like application level. What I want is like back end. How the commands are executed under the hood of CLI program. My requirement is to come up with a simple program which handles the commissioning part by itself. So I am trying to lift the code sections from CLI instead of developing everything from scratch.

    2. I have looked into this, but this is again explanation of the commands and the result in application level isnt it? As I mentioned before, I am after the inner working of the CLI program.

    I tried using Debug mode to trace the program execution path. Still it seems a long way to do it like this.

    I am thinking that the coap_client/server projects may be more useful for me for this task. What is your opinion?

    Thanks,

Children
Related