Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Inconsistent declaration in ble_dtm.h/dtm_uart.c for DTM command in nRF5 SDK v17.0.2

My static code analysis tool complained something, so I took a deeper look and found the following declaration inconsistencies as of nRF5 SDK v17.0.2 in the DTM area. So I am wondering, whether this is a (formal, not functional) bug in the DTM code resp. header file?! Or is there some greater meaning behind it?!?

ble_dtm.h defines 

typedef uint32_t dtm_cmd_t;                                                 /**< DTM command type. */

dtm_cmd_t is exclusively used in dtm_uart.c for the command compilation before giving it to the dtm_cmd(). Also it declares dtm_cmd_from_uart, which I would have expected to be of type dtm_cmd_t, but it isn't, instead it fits to signature of dtm_cmd().

uint16_t dtm_cmd_from_uart = 0; //Packed command containing command_code:freqency:length:payload in 2:6:6:2 bits.
[..]
dtm_cmd_from_uart = ((dtm_cmd_t)rx_byte) << 8;
[..]
dtm_cmd(dtm_cmd_from_uart);

whereas ble_dtm.h dtm_cmd() signature uses an unsigned 16bit command.

uint32_t dtm_cmd(uint16_t cmd);
Parents Reply Children
No Data
Related