Ejemplo n.º 1
0
/*------------------------------------------------------------------------------
 *       Call back function for the script processor to send an HCI command
 *------------------------------------------------------------------------------
 */
McpBtsSpStatus MCP_LM_SendHciCmdCB (McpBtsSpContext *context,
                                    McpU16 hciOpcode, 
                                    McpU8 *hciCmdParms, 
                                    McpUint hciCmdParmsLen)
{
    McpBtsSpStatus          status = MCP_BTS_SP_STATUS_PENDING;
    BtHciIfStatus           btHciIfStatus;

    MCP_FUNC_START("MCP_LM_SendHciCmdCB");

    MCP_UNUSED_PARAMETER(context);

    btHciIfStatus = BT_HCI_IF_SendHciCommand(handle,   
                                              (BtHciIfHciOpcode)hciOpcode, 
                                             hciCmdParms, 
                                             (McpU8)hciCmdParmsLen,                                          
                                             BT_HCI_IF_HCI_EVENT_COMMAND_COMPLETE,
                                             NULL);

    MCP_VERIFY_ERR((btHciIfStatus == BT_HCI_IF_STATUS_PENDING), MCP_BTS_SP_STATUS_FAILED,
                   ("MCP_LM_SendHciCmdCB: BT_HCI_IF_SendHciCommand Failed"));

    MCP_FUNC_END();

    return status;
}
Ejemplo n.º 2
0
BtHciIfStatus _MCP_HciSeq_SendCommand(MCP_HciSeq_Context *pContext)
{
    BtHciIfStatus status = BT_HCI_IF_STATUS_INTERNAL_ERROR;

    /* save current sequence ID for the command to be sent */
    pContext->uSeqenceIdOfSentCommand = pContext->uSequenceId;
    
    /* set flag of pending command */
    pContext->bPendingCommand = MCP_TRUE;
    
    /* execute the command */
    if(MCP_HAL_CORE_ID_BT == pContext->coreId)
    {
        status = BT_HCI_IF_SendHciCommand(pContext->handle,  
                                          pContext->command.eHciOpcode, 
                                          pContext->command.pHciCmdParms, 
                                          pContext->command.uhciCmdParmsLen,
                                          pContext->command.uCompletionEvent,
                                          (void*)pContext);       
    }
    else if (MCP_HAL_CORE_ID_FM == pContext->coreId)
    {
        status = FM_TRANSPORT_IF_SendFmVacCommand(pContext->command.pHciCmdParms, 
                                                  pContext->command.uhciCmdParmsLen,
                                                  _MCP_HciSeq_callback,
                                                  (void*)pContext);       
    }

    return (status);
}