Bluetooth: Audio: Add BT_MCS_VALID_OP
Add the BT_MCS_VALID_OP macro to verify MCS opcodes for both the MCC and MCS implementations. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
9dea871a7a
commit
e7770a6a7e
3 changed files with 37 additions and 0 deletions
|
@ -2735,6 +2735,18 @@ int bt_mcc_send_cmd(struct bt_conn *conn, const struct mpl_cmd *cmd)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
CHECKIF(cmd == NULL) {
|
||||
LOG_DBG("cmd is NULL");
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
CHECKIF(!BT_MCS_VALID_OP(cmd->opcode)) {
|
||||
LOG_DBG("Opcode 0x%02X is invalid", cmd->opcode);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
length = sizeof(cmd->opcode);
|
||||
(void)memcpy(mcs_inst->write_buf, &cmd->opcode, length);
|
||||
if (cmd->use_param) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue