src/lib/occlib/ipc_core.c
///////////////////////////////////////////////////////////////////////////////
/// Send a message as a command
///
Send a message as a command
Send a message as a command
int ipc_send_cmd(ipc_msg_t* cmd)
{
    int rc;
    do
    {
        if(!G_ipc_enabled)
        {
            rc = IPC_RC_SELF_BLOCKED;
            break;
        }
        if(!cmd->func_id.valid_flag)
        {
            rc = IPC_RC_INVALID_FUNC_ID;
            break;
        }
        if(cmd->func_id.active_flag)
        {
            rc = IPC_RC_MSG_ACTIVE;
            break;
        }
        cmd->func_id.response_flag = 0;
        cmd->func_id.sender_id = OCCHW_INST_ID_SELF;
        cmd->ipc_rc = 0;
        rc = ipc_send_msg(cmd, cmd->func_id.target_id);
        cmd->ipc_rc = rc;
    }
    while(0);
    return rc;
}
int ipc_send_cmd ( ipc_msg_t * cmd ) { int rc ; do { if ( ! G_ipc_enabled ) { rc = IPC_RC_SELF_BLOCKED ; break ; } if ( ! cmd -> func_id . valid_flag ) { rc = IPC_RC_INVALID_FUNC_ID ; break ; } if ( cmd -> func_id . active_flag ) { rc = IPC_RC_MSG_ACTIVE ; break ; } cmd -> func_id . response_flag = 0 ; cmd -> func_id . sender_id = OCCHW_INST_ID_SELF ; cmd -> ipc_rc = 0 ; rc = ipc_send_msg ( cmd , cmd -> func_id . target_id ) ; cmd -> ipc_rc = rc ; } while ( 0 ) ; return rc ; }
Send a message as a command
Send a message as a command
//don't allow sending new commands if IPC is disabled //don't send a command if the valid flag is not set //don't send a command if the active flag is set //Set the sender ID here.  Remote side uses this for sending responses. //place the message on the target's circular buffer