- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
问题: 监控主从蓝牙之间的 sco 数据包。
问题描述。 我有小型内部蓝牙设备(在 Linux fedora OS 中开发)并配置为从设备。
我对以下内容感兴趣:
pcm.btheadset {
type plug
slave {
pcm {
type bluetooth
device DC:A9:71:8D:2D:C6
profile "auto"
}
}
aplay -D btheadset " path of audio_file"
hciconfig -a
acl packets have increase but sco remain at 0
RX bytes:1041 acl:456 sco:0 events:36 errors:0
TX bytes:1347 acl:567 sco:0 commands:34 errors:0
最佳答案
经过几天与 Ubuntu 频繁崩溃的斗争,它终于奏效了。
以下是我尝试过的步骤。请作为引用,因为我很可能忘记写一些步骤
..................................................... ..................................................................
问题概述:尝试将Linux OS连接到BT耳机并建立sco链接以播放音乐
UBuntu 配置:
内核版本: 3.0.0-32-通用
Ubuntu 版本 ->11.10
测试设备: JABRA EASY GO 耳机..
..................................................... ......................
1) 安装以上版本的 Ubuntu 。这个 Ubuntu 版本不受支持,但由于我的内部设备使用几乎相同的内核版本,所以我坚持使用这个版本。
2) 配置 apt-get 源列表。由于安装的版本不支持,apt-get 将无法工作。要使其工作,请修改 /etc/apt/sources.list
.
示例->
sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update && sudo apt-get dist-upgrade
bluez-hcidump
bluez-utils
libbluetooth1
libbluetooth1-dev
install automake-1.7 and autoconfig
cvs
cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa login
cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa co btsco
configure and make
.
#include< linux/smp.h>
#include< linux/muxtex.h>
if( bt_sco->playback == NULL)
{
}
http://www.linuxquestions.org/questions/linux-kernel-70/is-there-any-kill_proc-replacement-for-proprietary-linux-kernel-drivers-4175460017/
int my_kill_proc(pid_t pid, int sig) {
int error = -ESRCH; /* default return value */
struct task_struct* p;
struct task_struct* t = NULL;
struct pid* pspid;
rcu_read_lock();
p = &init_task; /* start at init */
do {
if (p->pid == pid) { /* does the pid (not tgid) match? */
t = p;
break;
}
p = next_task(p); /* "this isn't the task you're looking for" */
} while (p != &init_task); /* stop when we get back to init */
if (t != NULL) {
pspid = t->pids[PIDTYPE_PID].pid;
if (pspid != NULL) error = kill_pid(pspid,sig,1);
}
rcu_read_unlock();
return error;
}
my_kill_proc( bt_sco->thread_pid, SIGINT )
%d to %lu
对于错误 long int
replace lock_kernal to mutex_lock( &os_mutex)
解锁相同
sudo hcidump -i hci0 sco
监控 sco 数据包
aplay -D plughw:Headset /home/my_home_dir/my_sample_fiile.wav
关于linux - 如何使用 bluez 库在蓝牙中测试 sco 数据包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26137056/
我正在尝试使用 BlueZ 4.X DBus 接口(interface)在 Linux 上建立与蓝牙 4.0 LE 设备的连接。 为了测试这一点,我使用以下命令: dbus-send --system
我有一个连接到 Linux 设备的蓝牙耳机。我想以编程方式接收播放/暂停/下一个/上一个/volUp/volDown 按钮按下。 经过一些研究,我发现我可以使用 dbus 与 Bluez 交互。我尝试
我正在使用 BlueZ 3.x.我有一个 linux 嵌入式设备,我需要使用蓝牙技术发送和接收文件,使用 Obex . (注意:BlueZ 4.x 甚至无法在我们的特定平台上编译。) 我不需要 PIN
Linux下的bluez是否可以同时连接多个经典和低能耗设备? bluez 网站提供这样的信息不是很有帮助。 最佳答案 是的,我已成功同时连接到 7 个低能耗设备。最大值因您使用的硬件而异。您还可以连
我有一个自定义 GATT 服务器,作为插件在 Linux 上使用 BlueZ 4.101。我现在正在尝试设置自定义扫描响应广告数据。我在 iOS 上使用 LightBlue 来调试我的 GATT 服务
我想在测试设置中实现的是: 运行: hcitool -i hci0 lescan --duplicates --passive 在一个外壳上 并联在另一个via上 hcitool -i hci0 le
我正在使用 Fedora 24。对于我的论文,我必须从源代码构建 BlueZ,因为我需要实验性功能。现在,最佳做法是什么?在从源代码重新安装之前,我是否必须从操作系统中删除 BlueZ?当我尝试使用
传输端点未连接 #include #include #include #include #include int main(int argc, char **argv) { struct s
用例 Ubuntu 机器正在模拟键盘 Ubuntu 机器(虚拟键盘)模拟连接到要控制的远程设备 问题 在正常情况下,HID 描述是通过 SDP 报告的,因此,当设备连接到键盘时,它已经知道要使用的 H
我正在用 C 为 Bluez 5.18 编写插件代码,我想创建自己的 BLE GATT 配置文件作为插件(共享库)。我需要从主代码调用函数,当我编译它时,没有错误,但是在加载插件时,它因 undefi
我正在使用 Raspberry Pi(运行 Jessie)、Bluez 和 iBeacons(10 个 iBeacons)。我的应用程序(用 Python 编写)嗅探 iBeacons 并报告 MAC
在一天的大部分时间里,我一直在努力让 BlueZ 在我的 Ubuntu 桌面上运行。它只是行不通。我可以通过系统对话成功地将我的设备与我的计算机配对,但 BlueZ 扫描从未发现任何东西。有没有 Bl
我正在浏览 Device API在 BlueZ 5.44 中,我对连接和配对设备之间的区别有点困惑。我看到连接是基于配置文件的,而配对似乎独立于配置文件。配对似乎更多地与 SDP 和身份验证有关。 但
如何重建 bluez?是否可以?例如,我想更改 avctp.c 中的某些内容。我从他们的网站下载了最新的 bluez 版本并进行了我需要的更改。现在,我如何使更改生效;即我需要做什么来重建 bluet
我在 linux 中使用内核版本 3.0.35 和 bluez-4.98。有了这个,我就可以根据其中一个 SO 问题中给出的 hcitool 命令来宣传 ibeacon。我也能够连接到其他 ble 设
我正在用 C/C++ 为低功耗蓝牙设备编写一个库。到目前为止,我一直在使用 Bluez 公开的 D-Bus 接口(interface),并且能够发现、连接设备并与之通信。 但是,当设备由于链接故障或超
我编写了一个 Python 程序,它通过蓝牙套接字(参见下面的示例)读取和写入 L2CAP 连接以与某些硬件通信。然而,代码可能想要为蓝牙适配器做太多的 IO 处理,所以我通过在需要时放慢 bar 循
说明: 我有一个带有蓝牙功能的小型内部设备。 目前,其他设备连接到该盒子。 需求: 现在我们必须使它成为奴隶,以便它与其他设备连接。我想知道该怎么做?我不需要源代码或任何只是你的意见。 附加信息: 该
我在我的 Linux 板上使用 bluez 附带的 example-gatt-server.py 脚本。我想向我的自定义特征之一添加通知。为此,我需要定义客户端特征配置描述符并将其添加到我的自定义特征
使用 BlueZ 蓝牙堆栈,如何以编程方式枚举已配对但不一定连接的设备? 最佳答案 更新:下面的内容并不像我最初想象的那么简单。 adapter_get_devices 只是起点。如果您可以发布其中的
我是一名优秀的程序员,十分优秀!