/******************************************************************************* ** ** Function RFCOMM_LineStatusReq ** ** Description This function is called by the port entity when line ** status should be delivered to the peer. ** *******************************************************************************/ void RFCOMM_LineStatusReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT8 status) { tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci); if ((p_port->state != PORT_STATE_OPENED) || (p_port->rfc.state != RFC_STATE_OPENED)) return; p_port->rfc.expected_rsp |= RFC_RSP_RLS; rfc_send_rls (p_mcb, dlci, TRUE, status); rfc_port_timer_start (p_port, RFC_T2_TIMEOUT); }
/******************************************************************************* ** ** Function RFCOMM_LineStatusReq ** ** Description This function is called by the port entity when line ** status should be delivered to the peer. ** *******************************************************************************/ void RFCOMM_LineStatusReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT8 status) { tPORT *p_port = port_find_mcb_dlci_port(p_mcb, dlci); if (p_port == NULL) { RFCOMM_TRACE_WARNING("%s Unable to find DLCI port dlci:%d", __func__, dlci); return; } if ((p_port->state != PORT_STATE_OPENED) || (p_port->rfc.state != RFC_STATE_OPENED)) return; p_port->rfc.expected_rsp |= RFC_RSP_RLS; rfc_send_rls (p_mcb, dlci, TRUE, status); rfc_port_timer_start (p_port, RFC_T2_TIMEOUT); }
/******************************************************************************* ** ** Function rfc_process_rls ** ** Description This function handles Remote Line Status command. ** Pass command to the user. ** *******************************************************************************/ void rfc_process_rls (tRFC_MCB *p_mcb, BOOLEAN is_command, MX_FRAME *p_frame) { tPORT *p_port; if (is_command) { PORT_LineStatusInd (p_mcb, p_frame->dlci, p_frame->u.rls.line_status); rfc_send_rls (p_mcb, p_frame->dlci, FALSE, p_frame->u.rls.line_status); } else { p_port = port_find_mcb_dlci_port (p_mcb, p_frame->dlci); /* If we are not awaiting response just ignore it */ if (!p_port || !(p_port->rfc.expected_rsp & RFC_RSP_RLS)) { return; } p_port->rfc.expected_rsp &= ~RFC_RSP_RLS; rfc_port_timer_stop (p_port); } }