Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_packages_modules_Bluetooth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LMODroid
platform_packages_modules_Bluetooth
Commits
f9e5924c
Commit
f9e5924c
authored
3 years ago
by
Treehugger Robot
Committed by
Gerrit Code Review
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge "RFCOMM: Handle failed connection request"
parents
26a771ff
743a06b3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
system/stack/rfcomm/rfc_mx_fsm.cc
+33
-28
33 additions, 28 deletions
system/stack/rfcomm/rfc_mx_fsm.cc
with
33 additions
and
28 deletions
system/stack/rfcomm/rfc_mx_fsm.cc
+
33
−
28
View file @
f9e5924c
...
...
@@ -73,7 +73,7 @@ static void rfc_mx_conf_cnf(tRFC_MCB* p_mcb, uint16_t result);
void
rfc_mx_sm_execute
(
tRFC_MCB
*
p_mcb
,
uint16_t
event
,
void
*
p_data
)
{
CHECK
(
p_mcb
!=
nullptr
)
<<
__func__
<<
": NULL mcb for event "
<<
event
;
LOG_
DEBUG
(
LOG_
INFO
(
"RFCOMM peer:%s event:%d state:%s"
,
PRIVATE_ADDRESS
(
p_mcb
->
bd_addr
),
event
,
rfcomm_mx_state_text
(
static_cast
<
tRFC_MX_STATE
>
(
p_mcb
->
state
)).
c_str
());
...
...
@@ -563,36 +563,41 @@ void rfc_on_l2cap_error(uint16_t lcid, uint16_t result) {
if
(
p_mcb
==
nullptr
)
return
;
if
(
result
==
L2CAP_CONN_OTHER_ERROR
)
{
RFCOMM_TRACE_DEBUG
(
"RFCOMM_ConnectCnf retry as acceptor on pending LCID(0x%x)"
,
p_mcb
->
pending_lcid
);
/* remove mcb from mapping table */
rfc_save_lcid_mcb
(
NULL
,
p_mcb
->
lcid
);
p_mcb
->
lcid
=
p_mcb
->
pending_lcid
;
p_mcb
->
is_initiator
=
false
;
p_mcb
->
state
=
RFC_MX_STATE_IDLE
;
/* store mcb into mapping table */
rfc_save_lcid_mcb
(
p_mcb
,
p_mcb
->
lcid
);
/* update direction bit */
for
(
int
i
=
0
;
i
<
RFCOMM_MAX_DLCI
;
i
+=
2
)
{
uint8_t
handle
=
p_mcb
->
port_handles
[
i
];
if
(
handle
!=
0
)
{
p_mcb
->
port_handles
[
i
]
=
0
;
p_mcb
->
port_handles
[
i
+
1
]
=
handle
;
rfc_cb
.
port
.
port
[
handle
-
1
].
dlci
+=
1
;
RFCOMM_TRACE_DEBUG
(
"RFCOMM MX, port_handle=%d, DLCI[%d->%d]"
,
handle
,
i
,
rfc_cb
.
port
.
port
[
handle
-
1
].
dlci
);
/* if peer rejects our connect request but peer's connect request is pending
*/
if
(
p_mcb
->
pending_lcid
)
{
RFCOMM_TRACE_DEBUG
(
"RFCOMM_ConnectCnf retry as acceptor on pending LCID(0x%x)"
,
p_mcb
->
pending_lcid
);
/* remove mcb from mapping table */
rfc_save_lcid_mcb
(
NULL
,
p_mcb
->
lcid
);
p_mcb
->
lcid
=
p_mcb
->
pending_lcid
;
p_mcb
->
is_initiator
=
false
;
p_mcb
->
state
=
RFC_MX_STATE_IDLE
;
/* store mcb into mapping table */
rfc_save_lcid_mcb
(
p_mcb
,
p_mcb
->
lcid
);
/* update direction bit */
for
(
int
i
=
0
;
i
<
RFCOMM_MAX_DLCI
;
i
+=
2
)
{
uint8_t
handle
=
p_mcb
->
port_handles
[
i
];
if
(
handle
!=
0
)
{
p_mcb
->
port_handles
[
i
]
=
0
;
p_mcb
->
port_handles
[
i
+
1
]
=
handle
;
rfc_cb
.
port
.
port
[
handle
-
1
].
dlci
+=
1
;
RFCOMM_TRACE_DEBUG
(
"RFCOMM MX, port_handle=%d, DLCI[%d->%d]"
,
handle
,
i
,
rfc_cb
.
port
.
port
[
handle
-
1
].
dlci
);
}
}
rfc_mx_sm_execute
(
p_mcb
,
RFC_MX_EVENT_CONN_IND
,
nullptr
);
return
;
}
rfc_mx_sm_execute
(
p_mcb
,
RFC_MX_EVENT_CONN_IND
,
nullptr
);
}
if
(
result
==
L2CAP_CFG_FAILED_NO_REASON
)
{
p_mcb
->
lcid
=
lcid
;
rfc_mx_sm_execute
(
p_mcb
,
RFC_MX_EVENT_CONN_CNF
,
&
result
);
}
else
if
(
result
==
L2CAP_CFG_FAILED_NO_REASON
)
{
LOG
(
ERROR
)
<<
__func__
<<
": failed to configure L2CAP for "
<<
p_mcb
->
bd_addr
;
if
(
p_mcb
->
is_initiator
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment