- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经成功地将我的 Android (6.0.1) 手机 (Sony Xperia Z3) 与我的笔记本电脑(运行 Ubuntu 14.04)配对。我可以来回发送文件。蓝牙连接菜单显示,如果发送文件,连接开关切换到ON。
我使用以下方式建立了持久连接:
sudo rfcomm connect rfcomm0 [MAC ADDRESS] [CHANNEL]
我想通过蓝牙将数据从我的手机发送到我的笔记本电脑。如果我运行这个 code开关也会打开,但会立即关闭连接(开关会回到关闭状态)。
Logcat 在调用 init()
后显示以下警告:
W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
在调用 write()
方法时出现此异常:
E/error: error init:java.io.IOException: read failed, socket might closed or timeout, read ret: -1
当使用 rfcomm
连接时,一些 channel 会失败并拒绝连接。我的猜测是我使用了错误的 channel 。
rfcomm
时如何知道使用哪个 channel ?最佳答案
不知何故,我无法使用 createRfcommSocketToServiceRecord
方法让它工作。
然后我所做的是删除:
ParcelUuid[] uuids = device.getUuids();
BluetoothSocket socket = device.createRfcommSocketToServiceRecord(uuids[0].getUuid());
并将这些行替换为:
int channel = 1; // substitute with channel you are listening on
Method m = device.getClass().getMethod("createRfcommSocket",new Class[] { int.class });
BluetoothSocket socket = (BluetoothSocket) m.invoke(device, channel);
然后我发出 sudo rfcomm listen rfcomm0
,然后显示它正在 Linux 终端上监听的 channel ,我终于可以连接了!
回答我自己的问题:
调用 rfcomm 时如何知道使用哪个 channel ?
Linux 终端在发出 sudo rfcomm listen rfcomm0
如何在我的 Android 应用中指定此 channel ?
我使用反射访问的方法现在有这个参数 (createRfcommSocket
)
我怎么知道要使用哪个 UUID?
在这个解决方案中没有。
示例代码中使用了第一个 UUID:为什么?
对于找到的解决方案无关紧要。
关于java - 通过蓝牙将数据从手机发送到笔记本电脑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37489483/
问题:将具有两个字符分隔符的数据文件加载到 Azure SQL Db 时,我们遇到以下错误。我们可能做错了什么以及如何解决这个问题? 在 Azure Databricks 中使用 Python 笔记本
我正在使用 ipython notebook 迈出第一步,我成功地将它安装在我的远程服务器上(通过 SSH),并使用以下命令启动它: ipython notebook --ip='*' ---pyla
我想知道对于一个网站来说,最好的数据库设计是什么,让用户(假设有 10k 个用户)给自己留下带有日期的注释。用户只能看到自己的笔记。 用户将看到的示例: 2014年9月28日 -去商店 -带狗去散步
我希望没有人会认为这个问题离题。我即将开始探索在 Jupyter 笔记本中使用 C# 内核。我看到有几种选择,有些似乎过时了。我对探索它们并不真正感兴趣,我只是想要一些能够很好地用于演示的东西。目的是
我已经使用此命令在 R 控制台中安装了 Rcpp,该命令直到现在通常用于安装要在 jupyter 笔记本上运行的软件包: install.packages('Rcpp', '/home/user/an
我已经使用更新了 Tornado sudo pip install --upgrade tornado 检查当前版本显示我已经有一个 4.0 以后的版本 找到命令的输出: pip 显示 Tornado
这个问题在这里已经有了答案: How can I share Jupyter notebooks with non-programmers? [closed] (6 个回答) 5年前关闭。 我安装了一
我有一个 IPython 笔记本,我不小心丢弃了一个巨大的输出 (15 MB),导致笔记本崩溃。现在,当我打开笔记本并尝试删除有问题的单元格时,笔记本又崩溃了——从而阻止了我解决问题并将笔记本恢复到稳
当我使用 ipython 笔记本(Windows 版本)运行任何 %R 代码时,输出在结果之前包含一个 480 x 480 的空白图像。我已经申请了fix #2433让 rmagic 在 Wind
大家好,我想使用新的.NET Jupyter笔记本,因此我准备了一个gitt的存储库,其中包含dockerfile(是正确的)和NuGet.config文件,例如: here the tuto 一切都
如何将本地镜像添加到 IJulia 笔记本?该图像与 IPYNB 文件位于同一本地网络文件夹中。该文件夹可通过符号链接(symbolic link)访问。我尝试过相对文件名和绝对文件名。 ![Ima
docs描述如何创建密码来保护您的 jupyter 笔记本。我希望能够创建并共享一个特定的笔记本,并为该笔记本设置特殊的密码。这可能吗? 最佳答案 不,这是不可能的。该密码保护整个 Jupyter 服
最近我了解到,使用 python 可以生成 IPython 笔记本 automatically .这看起来是个很酷的功能,我想用它来自动生成报告。但是用 julia 而不是 python。那么是否有一
我正在使用 Jupyter 笔记本,并且需要运行另一个 Jupyter 笔记本。这通常使用 %run 很简单,但另一个笔记本的路径是相对的并且包含空格。 这会产生以下错误: %run '..//../
我想在一个循环中运行完整的 Jupyter 笔记本,为笔记本的每次运行传递不同的参数。我可以使用插件传递参数,如下所述:Passing command line arguments to argv i
我真的很感谢这里的一些帮助,基本上我正在学习使用tensorflow,我决定最简单的方法是在VMware和/或Virtualbox上安装ubuntu,然后访问ipython笔记本(anaconda附带
有谁知道在执行单元格之前是否有选项(或建议的 hack)可以让 IPython 笔记本自动保存? 很多时候我一直在做一些事情而没有保存很长一段时间,然后我执行了一个愚蠢的命令,该命令在控制台上打印了如
我正在尝试在另一个文件中运行 .ipynb 文件。我想嵌套这两个的原因是因为在其中一个中,我安装了所有 conda 软件包、github 存储库,并且我不想为我将暂时使用的演示文件重做整个事情。我使用
我有多个相互链接的 Jupyter 笔记本,例如 Notebook1.ipydb 包含指向 Notebook2.ipydb 的链接,其 Markdown [Notebook2](Notebook2.i
我使用 jupyter python 中的 matplotlib 库生成了下图。正如你所看到的,我有两个不同的数据,一个是红色,另一个是绿色。我的问题是,有什么办法可以让我有一个小侧窗来说明每种颜色的
我是一名优秀的程序员,十分优秀!