I want to do scanning existing networks and for these goals, I need to enable Commissioner on Commissioner side. I use the otCommissionerStart function but when I check the current state I get DISABLED. What I do wrong? And do I need really enable commissioner role to do scan the networks?
You don't need to enable commissioner role. You can check such things in the CLI implementation, and see what OT command are needed for each CLI command.
There is a 'scan' CLI command here: https://github.com/openthread/openthread/blob/master/src/cli/README.md#scan-channel
Then you go and see which function you should be looking for cli.cpp: https://github.com/openthread/openthread/blob/master/src/cli/cli.cpp#L206
And you will see that you can use otLinkActiveScan for scanning networks: https://github.com/openthread/openthread/blob/master/src/cli/cli.cpp#L2781Best regards,
UPGRADE: I've already scanned networks, but now it is not joinable (commissioner state is PETITION). How I can set ACTIVE commissioner role state and do it joinable.
You need to start the commissioner using otCommissionerStart:
This will set the commisioner state to 'active':
Thanks. But anyway it's strange because I did the same as you wrote and nothing worked :) So, I'll one more time.