
btstack - issue #216
[minorIssue: L2CAP_CONNECTION_RESPONSE_RESULT_SUCCESSFUL but zero (0) is used for success
What steps will reproduce the problem? 1. 2. 3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Comment #1
Posted on Nov 23, 2011 by Happy BirdArghh, what keypress caused that to submit itself!!!!!
Title: [MINOR] L2CAP_CONNECTION_RESPONSE_RESULT_SUCCESSFUL but zero (0) is used for success
Text: When an L2CAP client connection fails due to there being no listener on the peer device for the specified PSM we see: HCI_EVENT_PACKET, L2CAP_EVENT_CHANNEL_OPENED, status: 0x65 Where 0x65 is L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_PSM, so that’s correct.
However when a connection is successful we see: HCI_EVENT_PACKET, L2CAP_EVENT_CHANNEL_OPENED, status: 0x00 That case does not use: #define L2CAP_CONFIG_RESPONSE_RESULT_SUCCESSFUL 0x66
Two solutions: 1) Rename that macro to be _BASE or similar, and continue to use zero for success. 2) Change the (two or so) places in btstack where an event for successful connection is raised to use that macro. However this likely a breaking change; existing user code might be using 0 (zero) for success…
RFCOMM appears not to have a corresponding _SUCCESSFUL macro, which adds weight to #1.
Status: New
Labels:
Type-Defect
Priority-Medium