移植到ESP32说明(依赖ESP-IDF):
https://github.com/bluekitchen/btstack/tree/master/port/esp32
一个蓝牙2.0 A2DP发送端,可以连接小米蓝牙音箱:
https://github.com/bluekitchen/btstack/blob/master/example/a2dp_source_demo.c
需要把源码里面这行:
static const char * device_addr_string = "00:21:3C:AC:F7:38";
里面的mac地址改为你的蓝牙喇叭地址.
使用方法:
b - AVDTP Source create connection to addr E8:07:BF:1C:43:74
B - AVDTP Source disconnect
c - AVRCP Target create connection to addr E8:07:BF:1C:43:74
C - AVRCP Target disconnect
x - start streaming sine
z - start streaming 'nao-deceased by disease'
p - pause streaming
离线
晕神就是厉害
离线
请问有linux平台下使用bluez播放音频文件到蓝牙耳机的示例代码或者资料吗?
离线
强烈不建议在嵌入式环境用 bluez
建议用 btstack, 商业使用请付费。
https://whycan.cn/t_1133.html#p5588
晕哥,请问怎么把BTstack移植到嵌入式平台啊,比如海思3516这个。
我看了官方文档,都是一些流行的板卡,树莓派什么的,就是没有教大家怎么自己动手移植。。。
希望指导一下小弟。。。
最近编辑记录 WM_CH (2018-09-27 15:10:21)
离线
led_counter 一个无蓝牙的定时器演示程序
gap_inquiry 搜索附近的经典蓝牙设备
gatt_browser 搜索第一个BLE设备并获取信息
spp_and_gatt_counter spp和gatt同时工作
gatt_counter 可以接受手机调试软件发过来的数据
• Hello World example:
– led counter: Hello World - Blinking an LED without Bluetooth.
• GAP examples:
– gap inquiry: GAP Classic Inquiry.
– gap link keys: GAP Link Key Management (Classic).
• Low Energy examples:
– gap le advertisements: GAP LE Advertisements Scanner.
– gatt browser: GATT Client - Discover Primary Services.
– gatt counter: GATT Server - Heartbeat Counter over GATT.
– gatt streamer server: Performance - Stream Data over GATT (Server).
– gatt battery query: GATT Battery Service Client.
– gatt device information query: GATT Device Information Service
Client.
– gatt heart rate client: GATT Heart Rate Sensor Client .
– nordic spp le counter: LE Nordic SPP-like Heartbeat Server .
– nordic spp le streamer: LE Nordic SPP-like Streamer Server .
– ublox spp le counter: LE u-blox SPP-like Heartbeat Server.
– sm pairing central: LE Central - Test Pairing Methods.
– sm pairing peripheral: LE Peripheral - Test Pairing Methods.
– le credit based flow control mode client: LE Credit-Based Flow-Control
Mode Client - Send Data over L2CAP.
– le credit based flow control mode server: LE Credit-Based Flow-Control
Mode Server - Receive data over L2CAP.
– att delayed response: LE Peripheral - Delayed Response.
– ancs client demo: LE ANCS Client - Apple Notification Service.
– le mitm: LE Man-in-the-Middle Tool.
• Performance examples:
– le streamer client: Performance - Stream Data over GATT (Client).
– gatt streamer server: Performance - Stream Data over GATT (Server).
– le credit based flow control mode client: LE Credit-Based Flow-Control
Mode Client - Send Data over L2CAP.
– le credit based flow control mode server: LE Credit-Based Flow-Control
Mode Server - Receive data over L2CAP.
– spp streamer client: Performance - Stream Data over SPP (Client).
– spp streamer: Performance - Stream Data over SPP (Server).
• Audio examples:
– a2dp sink demo: A2DP Sink - Receive Audio Stream and Control
Playback.
– a2dp source demo: A2DP Source - Stream Audio and Control Volume.
– avrcp browsing client: AVRCP Browsing - Browse Media Players
and Media Information.
– hfp ag demo: HFP AG - Audio Gateway.
– hfp hf demo: HFP HF - Hands-Free.
– hsp ag demo: HSP AG - Audio Gateway
– hsp hs demo: HSP HS - Headset.
– sine player: Audio Driver - Play Sine .
– mod player: Audio Driver - Play 80’s MOD Song.
– audio duplex: Audio Driver - Forward Audio from Source to Sink.
• SPP Server examples:
– spp counter: SPP Server - Heartbeat Counter over RFCOMM.
– spp flowcontrol: SPP Server - RFCOMM Flow Control.
• Networking examples:
– pan lwip http server: PAN - lwIP HTTP and DHCP Server .
– panu demo: BNEP/PANU (Linux only).
• HID examples:
– hid keyboard demo: HID Keyboard Classic.
– hid mouse demo: HID Mouse Classic.
– hid host demo: HID Host Classic.
– hog keyboard demo: HID Keyboard LE.
– hog mouse demo: HID Mouse LE.
– hog boot host demo: HID Boot Host LE.
• Dual Mode examples:
– spp and gatt counter: Dual Mode - SPP and LE Counter.
– gatt streamer server: Performance - Stream Data over GATT (Server).
• SDP Queries examples:
– sdp general query: SDP Client - Query Remote SDP Records.
– sdp rfcomm query: SDP Client - Query RFCOMM SDP record.
– sdp bnep query: SDP Client - Query BNEP SDP record.
• Phone Book Access example:
– pbap client demo: PBAP Client - Get Contacts from Phonebook
Server.
• Testing example:
– dut mode classic: Testing - Enable Device Under Test (DUT) Mode
for Classic.
离线