This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CLI one byte commands

I'm working on an application that utilizes CLI library, and I need to add CLI commands as in the code below:

NRF_CLI_CMD_REGISTER(0x1, NULL, "PING", cmd_ping);

But when I attempt this I get an error message:

error: invalid suffix "_str_ptr" on integer constant
1> ../../../../components/libraries/experimental_section_vars/nrf_section.h:149:5: note: in definition of macro 'NRF_SECTION_ITEM_REGISTER'
1> ../../../../components/libraries/util/nordic_common.h:116:31: note: in expansion of macro 'CONCAT_2_'
1> ../../../../components/libraries/cli/nrf_cli.h:155:65: note: in expansion of macro 'CONCAT_2'

So basically, I need to have one-byte commands. My initial idea was to convert hexadecimal numbers to ASCII characters and register commands as:

 

NRF_CLI_CMD_REGISTER(**ASCII CHARACTER**, NULL, "PING", cmd_ping);

But that didn't work either. 

Thanks

Best regards

Emir

Parents Reply Children
Related