@ -88,7 +88,7 @@ static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeade
} TestResponse ;
} TestResponse ;
/* Fill out the Test response data */
/* Fill out the Test response data */
TestResponse . CommandHeader = ( RFCOMM_Command_t ) { . Command = RFCOMM_Control_Test , . EA = true };
TestResponse . CommandHeader = ( RFCOMM_Command_t ) { . Command = RFCOMM_Control_Test , . EA = true , . CR = false };
TestResponse . Length = ( CommandDataLen < < 1 ) | 0x01 ;
TestResponse . Length = ( CommandDataLen < < 1 ) | 0x01 ;
memcpy ( TestResponse . TestData , Params , CommandDataLen ) ;
memcpy ( TestResponse . TestData , Params , CommandDataLen ) ;
@ -130,11 +130,11 @@ static void RFCOMM_ProcessMSCommand(const RFCOMM_Command_t* const CommandHeader,
return ;
return ;
/* Save the new channel signals to the channel state structure */
/* Save the new channel signals to the channel state structure */
RFCOMMChannel - > Signals = Params - > Signals ;
RFCOMMChannel - > Remote. Signals = Params - > Signals ;
/* If the command contains the optional break signals field, store the value */
/* If the command contains the optional break signals field, store the value */
if ( CommandDataLen = = sizeof ( RFCOMM_MS_Parameters_t ) )
if ( CommandDataLen = = sizeof ( RFCOMM_MS_Parameters_t ) )
RFCOMMChannel - > BreakSignals = Params - > BreakSignal s ;
RFCOMMChannel - > Remote. BreakSignal = Params - > BreakSignal ;
struct
struct
{
{
@ -144,14 +144,15 @@ static void RFCOMM_ProcessMSCommand(const RFCOMM_Command_t* const CommandHeader,
} MSResponse ;
} MSResponse ;
/* Fill out the MS response data */
/* Fill out the MS response data */
MSResponse . CommandHeader = ( RFCOMM_Command_t ) { . Command = RFCOMM_Control_ModemStatus , . EA = tru e} ;
MSResponse . CommandHeader = ( RFCOMM_Command_t ) { . Command = RFCOMM_Control_ModemStatus , . EA = tru e, . CR = fals e} ;
MSResponse . Length = ( CommandDataLen < < 1 ) | 0x01 ;
MSResponse . Length = ( CommandDataLen < < 1 ) | 0x01 ;
MSResponse . Params = * Params ;
memcpy ( & MSResponse . Params , Params , sizeof ( RFCOMM_MS_Parameters_t ) ) ;
BT_RFCOMM_DEBUG ( 1 , " >> MS Response " ) ;
BT_RFCOMM_DEBUG ( 1 , " >> MS Response " ) ;
/* Send the PDN response to acknowledge the command */
/* Send the PDN response to acknowledge the command */
RFCOMM_SendFrame ( RFCOMM_CONTROL_DLCI , false , RFCOMM_Frame_UIH , sizeof ( MSResponse ) , & MSResponse , Channel ) ;
RFCOMM_SendFrame ( RFCOMM_CONTROL_DLCI , false , RFCOMM_Frame_UIH ,
( sizeof ( MSResponse ) - sizeof ( MSResponse . Params ) + CommandDataLen ) , & MSResponse , Channel ) ;
}
}
static void RFCOMM_ProcessRPNCommand ( const RFCOMM_Command_t * const CommandHeader , const uint8_t * CommandData ,
static void RFCOMM_ProcessRPNCommand ( const RFCOMM_Command_t * const CommandHeader , const uint8_t * CommandData ,
@ -192,8 +193,11 @@ static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader
{
{
RFCOMMChannel = & RFCOMM_Channels [ i ] ;
RFCOMMChannel = & RFCOMM_Channels [ i ] ;
RFCOMMChannel - > DLCI = Params - > DLCI ;
RFCOMMChannel - > DLCI = Params - > DLCI ;
RFCOMMChannel - > Signals = 0 ;
RFCOMMChannel - > MTU = 0xFFFF ;
RFCOMMChannel - > BreakSignals = 0 ;
RFCOMMChannel - > Remote . Signals = 0 | ( 1 < < 0 ) ;
RFCOMMChannel - > Remote . BreakSignal = 0 | ( 1 < < 0 ) ;
RFCOMMChannel - > Local . Signals = RFCOMM_SIGNAL_RTC | RFCOMM_SIGNAL_RTR | RFCOMM_SIGNAL_DV | ( 1 < < 0 ) ;
RFCOMMChannel - > Local . BreakSignal = 0 | ( 1 < < 0 ) ;
break ;
break ;
}
}
}
}
@ -219,9 +223,9 @@ static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader
} DPNResponse ;
} DPNResponse ;
/* Fill out the DPN response data */
/* Fill out the DPN response data */
DPNResponse . CommandHeader = ( RFCOMM_Command_t ) { . Command = RFCOMM_Control_DLCParameterNegotiation , . EA = true };
DPNResponse . CommandHeader = ( RFCOMM_Command_t ) { . Command = RFCOMM_Control_DLCParameterNegotiation , . EA = true , . CR = false };
DPNResponse . Length = ( sizeof ( DPNResponse . Params ) < < 1 ) | 0x01 ;
DPNResponse . Length = ( sizeof ( DPNResponse . Params ) < < 1 ) | 0x01 ;
DPNResponse . Params = * Params ;
memcpy ( & DPNResponse . Params , Params , sizeof ( RFCOMM_DPN_Parameters_t ) ) ;
DPNResponse . Params . ConvergenceLayer = 0x00 ; // TODO: Enable credit based transaction support
DPNResponse . Params . ConvergenceLayer = 0x00 ; // TODO: Enable credit based transaction support
BT_RFCOMM_DEBUG ( 1 , " >> DPN Response " ) ;
BT_RFCOMM_DEBUG ( 1 , " >> DPN Response " ) ;