Android 蓝牙串口/RFCOMM/SPP,如何更改波特率? [英] Android Bluetooth Serial/RFCOMM/SPP, How to Change the BAUD RATE?

查看:63
本文介绍了Android 蓝牙串口/RFCOMM/SPP,如何更改波特率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这非常令人沮丧,因为我已经尝试了数周,甚至在互联网上都没有任何线索.

This is very frustrating as I've been trying for weeks and not even a clue on the internet.

我正在从事一个在不同农业硬件上读取/写入蓝牙串行数据的项目.

I am working on a project that reads/writes bluetooth serial data on different farming hardware.

这些硬件中的大多数都是旧的,无法更改其 SPP 的波特率.

most of these hardware are old and changing the baud rate of their SPP is not an option.

我使用 android 蓝牙聊天作为读/写的基础,我只更改了 UUID 以允许连接到我拥有的设备

I'm using the android bluetooth chat as a basis to read/write, I've only changed the UUID to allow connection to the devices I have

我已经成功地以 19,200 的糟糕速度从标签阅读器中读取了精美的内容,并且格式很好

I've managed to read from a tag reader at a bad rate of 19,200 beautifully, and formatted nicely

但是,我现在坚持使用波特率为 9,600 并且在我的应用程序中显示有趣字符的比例,甚至不接近应该来自比例的格式

However, I'm stuck now with the scales which has a baud rate of 9,600 and shows funny characters in my app, not even close to the format that should come from the scales

这个项目以前是在旧的 Windows Mobile 上完成的,波特率可以在他们的 API 中更改

This project was done previously on a old Windows Mobile and baud rates could be changed in their API

有没有办法在 Android 中做到这一点,还是我在错误的树上吠叫?

Is there a way to do this in Android or am I barking up the wrong tree?

推荐答案

大概是一些蓝牙到串行转换器连接到旧设备?如果是这样,您应该能够对其进行一次编程以始终使用特定的比特率.那么蓝牙客户端就不需要设置比特率了...

Presumably some Bluetooth to serial converter is attached to the legacy devices? If so you should be able to program it once to always use a particular bit rate. Then there would be no need for the Bluetooth client to set the bit rate...

这篇关于Android 蓝牙串口/RFCOMM/SPP,如何更改波特率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆