bluetooth 相关问题

蓝牙是一种全球开放式无线技术标准,用于从固定和移动设备短距离(使用短波无线电传输)交换数据,创建具有高安全性的个人局域网(PAN)。

Ios 蓝牙权限被拒绝反应本机权限

我的应用程序正在请求本地网络权限。单击“确定”后,我看到蓝牙权限被拒绝警报。 我有 NSBluetoothAlwaysUsageDescription 和

回答 1 投票 0

从应用程序控制蓝牙耳机 v4.1 连接

我有一个蓝牙耳机 v4.1,可以直接从手机的蓝牙设置连接。 但我只想从特定的应用程序控制他们的连接,这意味着他们将无法连接......

回答 1 投票 0

如何实现使用Java通过蓝牙从其他Android手机读取和发送短信/彩信?

我不确定我的问题标题是否足够清楚。 让我解释更多细节。 我想要一个 Android 应用程序,它有助于通过蓝牙 MAP 在 2 个或更多 Android 移动设备之间进行同步。 来自我的

回答 1 投票 0

如何从fireboltt智能手表获取心率到flutter android应用程序

我正在尝试制作一个 flutter 应用程序来从我的智能手表中获取数据(心率、血氧饱和度……)。我不知道是wearOS还是tizen还是什么。它是Fire Bolt品牌的智能手表。我现在

回答 2 投票 0

如何使用BLE和`react-native-ble-plx`读取/写入数据?

我成功将react-native-ble-plx设置为手柄BLE设备。 我之前没有任何使用蓝牙的经验。根据我的理解和阅读文档后,我是这样的

回答 1 投票 0

蓝牙、Bluez:通过 bnepX 接口 ping 没有回复

我尝试过在蓝牙上使用网络、NAP 配置文件。 在主机上,xUbuntu 13.04 我按照这里进行操作。 该主机或 XUbuntu 计算机位于代理后面并在虚拟机上运行。 是

回答 1 投票 0

使用蓝牙从 Arduino 获取数据到 iPhone

我在 Arduino 上安装了 HC-06 传感器。我需要从 Arduino 获取一些数据到 iPhone。有人有例子吗?我已经准备好在 Arduino 上进行应用了。我可以使用 goS 从 Arduino 获取数据...

回答 1 投票 0

为什么我的蓝牙适配器使应用程序崩溃

我正在尝试学习如何通过我的应用程序启用和禁用蓝牙。所以我一直在为此编写一个小代码。当我在模拟器上运行应用程序时,代码可以工作并且它......

回答 2 投票 0

Android 12蓝牙权限混乱

所以在 API 31 中有新的蓝牙权限。我想使用以下命令打开或关闭蓝牙: 私有无效changeBluetoothState(布尔状态){ 蓝牙适配器 mBluetoothAdapter =

回答 5 投票 0

如何通过蓝牙在两个Android设备之间建立连接

我尝试使用 Android 开发者网站上的 Android 蓝牙聊天示例来连接两个设备。它仅从其中一台设备连接,当我尝试从...

回答 4 投票 0

Windows 上的蓝牙串行:如何获取连接状态

使用蓝牙串行设备(在我的例子中是ESP32),Windows驱动程序在蓝牙枚举中显示连接状态,如下所示。 怎么可能有相同的信息

回答 1 投票 0

无法从STM32 B-U585I-IOT02A检测到蓝牙

我正在使用 STM32CubeIDE 1.7.0 中的 BLE_AT_CLIENT 示例,但在 ST BLE SENSOR 应用程序或我的计算机/智能手机正常蓝牙扫描上未检测到任何内容。我有 2 个 B-U585I-IOT02A,并且都给出了

回答 2 投票 0

找到头文件,但内容似乎没有被预处理器包含

我正在尝试为我的设备构建 LineageOS 21.0,并且我已经下载了所有需要的源代码(我对这项工作并不陌生,因为我已经为该设备成功构建了从 15 到 20 的 LineageOS)。 但他...

回答 1 投票 0

在 Windows 上通过 RSSI 检测蓝牙信号强度

我试图了解如何在 Windows 上使用 C# 或 C++ 访问蓝牙(非 LE)连接的 RSSI。 我的理解是没有简单的“GetRSSI()”类型命令...

回答 1 投票 0

BLE通讯协议T1S(智能手环)获取数据

我想将我的Android应用程序与此智能手环(T1S)进行通信,我已经将其配对,但我不知道如何从中提取数据,例如温度等。 我得到了特点和服务...

回答 2 投票 0

Android 蓝牙配对,无需用户输入 PIN 码并使用 Android API 进行确认

我是Android编程的初学者,因为我三个月前才开始。 我正在做一个使用蓝牙将 Android 应用程序连接到 Arduino 的项目。我已经有 Android 应用程序的代码 (

回答 3 投票 0

查找 Android 智能手机蓝牙 MAC 地址的 bt_config.conf”或“bt_config.xml”

我有一台三星 Galaxy Note 20 Ultra (Exynos) - 已 root。 由于某种原因,我想更改我的智能手机 BT 地址。 下面的链接文章中提到了这一点。 查找设备蓝牙MAC地址...

回答 1 投票 0

缺少蓝牙权限 - 但我的应用程序不使用它

我当前的应用程序几乎可以正常工作,只是它偶尔会抛出一个我无法解释的错误: E/AudioManagerAndroid: 缺少蓝牙权限! 没有提供更多信息......

回答 1 投票 0

如何更改iPhone和Android上的蓝牙MAC地址或发送假的?

我想知道是否有应用程序或类似的东西可以让您更改手机的蓝牙MAC地址。我想要的是将蓝牙信号从一部特定手机复制到...

回答 1 投票 0

Android java中如何接收蓝牙耳机播放暂停事件

如何在我的 VOIP 应用程序中接收蓝牙颈带播放暂停事件? 我在应用程序中实现了下面的广播接收器。 清单文件 如何在我的 VOIP 应用程序中接收蓝牙颈带播放暂停事件? 我在应用程序中实现了下面的广播接收器。 清单文件 <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <receiver android:name=".MediaButtonReceiver" android:exported="true" android:priority="10000" > <intent-filter > <action android:name="android.intent.action.MEDIA_BUTTON" /> </intent-filter> </receiver> public class MediaButtonReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { android.util.Log.d("TAG", "Bluetooth onPlay: "+intent.getAction()); if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) { KeyEvent event = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT); if (event != null && event.getAction() == KeyEvent.ACTION_DOWN) { int keyCode = event.getKeyCode(); if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY || keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE) { // Handle play/pause event } } } } } 并像这样注册到调用活动 MediaButtonReceiver r = new MediaButtonReceiver(); registerReceiver(r, new IntentFilter(Intent.ACTION_MEDIA_BUTTON)); 并且还在应用程序中的广播接收器下面实现了 public class BluetoothHeadsetReceiver extends BroadcastReceiver implements BluetoothProfile.ServiceListener { private static final String TAG = "BluetoothHeadsetReceiver"; private BluetoothHeadset bluetoothHeadset; @Override public void onServiceConnected(int profile, BluetoothProfile proxy) { if (profile == BluetoothProfile.HEADSET) { bluetoothHeadset = (BluetoothHeadset) proxy; Log.d(TAG, "Bluetooth Headset connected"); } } @Override public void onServiceDisconnected(int profile) { if (profile == BluetoothProfile.HEADSET) { bluetoothHeadset = null; Log.d(TAG, "Bluetooth Headset disconnected"); } } @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d(TAG, "Bluetooth Headset onReceive : "+action); if (BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED.equals(action)) { int state = intent.getIntExtra(BluetoothHeadset.EXTRA_STATE, BluetoothHeadset.STATE_DISCONNECTED); if (state == BluetoothHeadset.STATE_CONNECTED) { Log.d(TAG, "Bluetooth Headset connected"); } else if (state == BluetoothHeadset.STATE_DISCONNECTED) { Log.d(TAG, "Bluetooth Headset disconnected"); } } else if (BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED.equals(action)) { int state = intent.getIntExtra(BluetoothHeadset.EXTRA_STATE, BluetoothHeadset.STATE_AUDIO_DISCONNECTED); if (state == BluetoothHeadset.STATE_AUDIO_CONNECTED) { Log.d(TAG, "Bluetooth Headset audio connected"); // Handle button click events or other actions here } else if (state == BluetoothHeadset.STATE_AUDIO_DISCONNECTED) { Log.d(TAG, "Bluetooth Headset audio disconnected"); } }else{ Log.d(TAG, "Bluetooth Headset onReceive else : "); } } public void register(Context context) { BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (bluetoothAdapter != null) { bluetoothAdapter.getProfileProxy(context, this, BluetoothProfile.HEADSET); IntentFilter filter = new IntentFilter(); filter.addAction(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED); filter.addAction(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED); context.registerReceiver(this, filter); } else { Log.e(TAG, "Bluetooth is not supported on this device"); } } public void unregister(Context context) { context.unregisterReceiver(this); if (bluetoothHeadset != null) { BluetoothAdapter.getDefaultAdapter().closeProfileProxy(BluetoothProfile.HEADSET, bluetoothHeadset); } } } 在调用 Activity OnCreate() 方法中注册以下代码。 MediaButtonReceiver r = new MediaButtonReceiver(); registerReceiver(r, new IntentFilter(Intent.ACTION_MEDIA_BUTTON)); if(gc.hasBTPermission(this, ConstantStrings.BLUETOOTH_PERMISSION)) { if (BluetoothManager.getInstance().isBluetoothHeadsetAvailable()) { headsetReceiver = new BluetoothHeadsetReceiver(); headsetReceiver.register(this); BluetoothManager.getInstance().initBluetooth(); } } 但不接收蓝牙耳机播放,暂停点击事件仅接收应用程序中的蓝牙连接和断开事件。 我想基于蓝牙点击事件呼叫接受和挂断呼叫,但不在应用程序中接收事件。 蓝牙 HID 配置文件/服务始终由设备的底层操作系统处理。只需订阅操作系统的关键事件即可。在 Android 中,应用程序可以通过覆盖 MediaSession.Callback.onMediaButtonEvent(Intent) 来覆盖默认行为。在这种情况下,应用程序可以/需要自行处理所有 API 细节。

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.