-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Bluetooth: Classic: SPP: Add SPP command set #94523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Seems like this still doesn't address the request that was pointed out here: #77017 (comment) |
@jhedberg thanks for your suggestion I know your needs. User apps can send and receive SPP data via UART, as NUT GATT service does. If necessary, I would like to submit these changes for SPP NUT with another PR(SPP Based NUT Service vid UART) . This PR is only for SPP protocol stack, ensuring SPP stack function works well. Do you agree? |
This isn't about "my needs". I'm merely (as maintainer) providing guidance to help steer the design in a direction that will be maximally useful for users of Zephyr, and in line with existing "serial port" abstractions in the Bluetooth stack.
What is "NUT"? Do you mean NUS (Nordic UART Service)? The request isn't about NUS, rather about following a similar design wrt how it's exposed as a Zephyr UART driver and instances created through devicetree nodes.
I'm not quite sure. This is exposing a new public API, which may not be the ideal choice for someone wanting to use SPP if a UART driver API was also available. |
I'd also appreciate an answer to the question from @ubieda here: #77017 (comment) I'd like to get hold of such HW as well, so that I can do proper testing of Bluetooth Classic PRs. |
sorry typo for NUS For example, We have a requirement that on the Nuttx or Linux platform, where the Zephyr kernel is not running, and SPP data transmission and reception are need through the API. |
I test it with qemu_x86 tests/bluetooth/shell such as enable BT_SPP config then run qemu with BT USB dongle west build -b qemu_x86 tests/bluetooth/shell then test with SPP client or server tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments
What do you mean by "the API"? Surely nuttx and Linux don't use this new API that you're exposing. The requirement to transmit data over SPP is clear, however I don't think that puts any specific requirements on the API as long as it allows the transmission of data. |
What we are talking about here is a private implementation of our internal, which has been used in the product since it relies on the API interface, which may mislead you. However it doesn't matter anymore, as long as the API is exposed |
In an upstream context (e.g. this PR) it's not really relevant what you have in some internal tree. It should be possible to reason and provide justifications in a purely upstream context. |
2154239
to
f093346
Compare
4d1b818
to
f826fba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of inline comments. However in general, I get the feeling that this is potentially over engineering the whole thing. Isn't SPP pretty much RFCOMM + SDP handling (registering the right kind of record and discovering the right kind of record). In that sense, I'd expect to just have helpers for the SDP handling and then for the rest it should be possible just use exiting public RFCOMM APIs. Or am I missing something? Is there something more advanced that's needed?
thanks for you suggestion. Some changes have been taken to simplify the process |
e1b31f6
to
b84c3c3
Compare
|
||
union { | ||
/** UUID (service) to discovery remote SPP service */ | ||
const struct bt_uuid *uuid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the peer use the same uuid
to define many spp sdp services with different channels value, then the uuid
is used to connect peer, how the spp knows which channel to connect? It seems that the all SDP related logic should be in application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the peer use the same
uuid
to define many spp sdp services with different channels value, then theuuid
is used to connect peer, how the spp knows which channel to connect? It seems that the all SDP related logic should be in application.
@MarkWangChinese thanks very much for you attentivenesss. it would be compatible in that case.
if user would like to conenct channels with that uuid, it could be done by uuid. SDP related logic could be reuesed.
if user would like to connect a specific channel, it could be done by channel. and sdp related logic could be done in application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For one specific uuid and there are two rfcomm channels that uses the uuid. I think you mean that user can find the spp sdp services in application or user can use the uuid
parameter to let spp profile codes to find the sdp services. How user knows the specific uuid has multiple rfcomm channels in peer, so application needs to find the sdp services firstly. Since the application needs to find the sdp services firstly, I still think it's not neccessary to put the sdp discovery in spp profile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For one specific uuid and there are two rfcomm channels that uses the uuid. I think you mean that user can find the spp sdp services in application or user can use the
uuid
parameter to let spp profile codes to find the sdp services. How user knows the specific uuid has multiple rfcomm channels in peer, so application needs to find the sdp services firstly. Since the application needs to find the sdp services firstly, I still think it's not neccessary to put the sdp discovery in spp profile.
@MarkWangChinese It doesn't sound like it's necessary to remove it.
In most case,there would be only a rfcomm channel within in a specific sdp. in many rfcomm channel cases, bt_spp_connect would connect all channel one by one. The current implementation is just like Android do.
and app could connect spp by channel as well. I think we need to consider ease of use that api
Add SPP test shell commands, support client and server features. include `register`, `connect`, `send` and `disconnect`. Signed-off-by: Kai Cheng <[email protected]>
zephyr_library() | ||
zephyr_library_sources(bredr.c) | ||
zephyr_library_sources_ifdef(CONFIG_BT_RFCOMM rfcomm.c) | ||
zephyr_library_sources_ifdef(CONFIG_BT_RFCOMM spp.c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move rfcomm.c to bredr.c?
|
Implementation Overview
Serial Port Profile (SPP) implementation providing full client/server functionality and comprehensive test tools. The solution enables reliable serial communication over RFCOMM for IoT devices, peripherals, and bridge applications.
reopen from PR: #77017
Core Components
shell