mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-17 20:42:47 +00:00
respond to MSC CMD in OPEN state, too
This commit is contained in:
parent
828325e337
commit
39de7faaf3
24
src/rfcomm.c
24
src/rfcomm.c
@ -1378,7 +1378,7 @@ static void rfcomm_channel_state_machine(rfcomm_channel_t *channel, rfcomm_chann
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: integrate in common swich
|
// TODO: integrate in common switch
|
||||||
if (event->type == CH_EVT_RCVD_DM){
|
if (event->type == CH_EVT_RCVD_DM){
|
||||||
log_dbg("Received DM message for #%u\n", channel->dlci);
|
log_dbg("Received DM message for #%u\n", channel->dlci);
|
||||||
log_dbg("-> Closing channel locally for #%u\n", channel->dlci);
|
log_dbg("-> Closing channel locally for #%u\n", channel->dlci);
|
||||||
@ -1409,7 +1409,7 @@ static void rfcomm_channel_state_machine(rfcomm_channel_t *channel, rfcomm_chann
|
|||||||
if (event->type == CH_EVT_RCVD_RPN_REQ){
|
if (event->type == CH_EVT_RCVD_RPN_REQ){
|
||||||
|
|
||||||
log_dbg("Received Remote Port Negotiation (Info) for #%u\n", channel->dlci);
|
log_dbg("Received Remote Port Negotiation (Info) for #%u\n", channel->dlci);
|
||||||
log_dbg("Sending Remote Port Negotiation (info) RSP for #%u\n", channel->dlci);
|
log_dbg("Sending Remote Port Negotiation (Info) RSP for #%u\n", channel->dlci);
|
||||||
|
|
||||||
// default rpn rsp
|
// default rpn rsp
|
||||||
rfcomm_rpn_data_t rpn_data;
|
rfcomm_rpn_data_t rpn_data;
|
||||||
@ -1603,6 +1603,26 @@ static void rfcomm_channel_state_machine(rfcomm_channel_t *channel, rfcomm_chann
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case RFCOMM_CHANNEL_OPEN:
|
||||||
|
switch (event->type){
|
||||||
|
case CH_EVT_RCVD_MSC_CMD:
|
||||||
|
channel->state_var |= STATE_VAR_RCVD_MSC_CMD;
|
||||||
|
channel->state_var |= STATE_VAR_SEND_MSC_RSP;
|
||||||
|
break;
|
||||||
|
case CH_EVT_READY_TO_SEND:
|
||||||
|
if (channel->state_var & STATE_VAR_SEND_MSC_RSP){
|
||||||
|
log_dbg("Sending MSC RSP for #%u\n", channel->dlci);
|
||||||
|
channel->state_var &= ~STATE_VAR_SEND_MSC_RSP;
|
||||||
|
channel->state_var |= STATE_VAR_SENT_MSC_RSP;
|
||||||
|
rfcomm_send_uih_msc_rsp(multiplexer, channel->dlci, 0x8d); // ea=1,fc=0,rtc=1,rtr=1,ic=0,dv=1
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case RFCOMM_CHANNEL_SEND_DM:
|
case RFCOMM_CHANNEL_SEND_DM:
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case CH_EVT_READY_TO_SEND:
|
case CH_EVT_READY_TO_SEND:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user