蓝牙看不懂,只能通过串口入手,仿真找到以下函数,串口接收数据,通过蓝牙发送出去
static serialStatus_t Serial_WriteInternal( uint8_t InterfaceId )
void SerialManagerTask(osaTaskParam_t argument) 任务管理函数
{
uint16_t i;
uint8_t ev;
#if defined(FWK_SMALL_RAM_CONFIG)
{
#else
osaEventFlags_t mSMTaskEventFlags;
while( 1 )
{
/* Wait for an event. The task will block here. */
(void)OSA_EventWait(mSMTaskEventId, osaEventFlagsAll_c, FALSE, osaWaitForever_c ,&mSMTaskEventFlags);
#endif
for( i = 0; i < gSerialManagerMaxInterfaces_c; i++ )
{
OSA_InterruptDisable();
ev = mSerials.events;
mSerials.events = 0;
OSA_InterruptEnable();
if ( (ev & gSMGR_Rx_c) &&
(NULL != mSerials.rxCallback) )
{
mSerials.rxCallback( mSerials.pRxParam ); //-》Uart_RxCallBack
}
if( ev & gSMGR_TxDone_c )
{
Serial_TxQueueMaintenance(&mSerials);
}
/* If the Serial is IDLE and there is data to tx */
if( (mSerials.state == 0) && (mSerials.txQueue[mSerials.txCurrent].dataSize > 0) )
{
(void)Serial_WriteInternal( i );
}
#if gSerialMgrUseSPI_c
/* If the SPI Slave has more data to transmit, restart the transfer */
#if gSerialMgrSlaveDapTxLogicOne_c
if( (GpioReadPinInput(&mSpiMasterDapCfg)) && (mSerials.serialType == gSerialMgrSPIMaster_c) && (0 == mSerials.state) )
#else
if( (!GpioReadPinInput(&mSpiMasterDapCfg)) && (mSerials.serialType == gSerialMgrSPIMaster_c) && (0 == mSerials.state) )
#endif
{
if( (0 == mSerials.txQueue[mSerials.txIn].dataSize) && (NULL == mSerials.txQueue[mSerials.txIn].txCallback) )
{
Serial_SpiSendDummyByte(i);
}
}
#endif
}
#if !defined(FWK_SMALL_RAM_CONFIG)
/* For BareMetal break the while(1) after 1 run */
if (gUseRtos_c == 0)
{
break;
}
#endif
} /* while(1) */
}
#endif
static void UartStreamFlushTimerCallback(void *pData)
{//超时回调
App_PostCallbackMessage(BleApp_FlushUartStream, NULL);
}
static void Uart_RxCallBack(void *pData)
{//串口的回调函数
uint16_t byteCount;
Serial_RxBufferByteCount(gAppSerMgrIf, &byteCount);
if (byteCount < mAppUartBufferSize)
{
仿真的逆向推导 的断点关键于,这不是保存到草稿的?怎么发布出来的?!