蓝牙控制信号(DTR,DSR,RTS,CTS)在Android [英] Bluetooth control signals (DTR, DSR, RTS, CTS) on Android

查看:563
本文介绍了蓝牙控制信号(DTR,DSR,RTS,CTS)在Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过蓝牙SPP通过Android的远程改编我的Arduino的。第一步是复位ATMEGA微控制器。这是通过切换DTR线Arduino上完成的。是否有任何的API来从Android环境控制蓝牙SPP控制线?

I would like to remotely reprogram my Arduino via Android over Bluetooth SPP. The first step is to reset the ATMEGA microcontroller. This is accomplished on the Arduino by toggling the DTR line. Is there any API to control the Bluetooth SPP control lines from the Android environment?

推荐答案

此外,它是由最高人民检察院一般支持发送或接收控制信号(DTR,DSR,RTS,CTS)我不知道任何API或库安卓知道对不对,但你只是想重置控制器...

Also it is supported by SPP in general to send or receive the control signals (DTR, DSR, RTS, CTS) I do not know any API or library for android right know, but as you just want to reset your controller...

如果它是O.K.为你改变你的固件,你也可以创建你的UART(超过SPP)接收自己复位命令。

If it is o.k. for you to change your firmware you can also create your own reset-command that can be received on your UART (over SPP).

如果您收到命令,你可以调用像

If you receive that command you could call something like

asm("jmp 0x3800");

,你必须修改 JMP -address指向您的引导程序。
你也可能要改变你的中断向量指向您的引导程序。

where you have to modify the jmp-address to point to your bootloader. You also might want to change your interrupt vector to point to your bootloader.

或启用看门狗,并呼吁

while(1);

这也会自动更改中断向量到bootloader的中断向量和复位所有SFR。 - 但它是一个有点慢,bootloader的中断向量必须在熔丝位作为选

This will also automatically change the interrupt vector to the bootloader's interrupt vector and reset all SFRs. - But it is a little bit slower and the bootloader's interrupt vector must be choosen in the Fuse Bits.

这篇关于蓝牙控制信号(DTR,DSR,RTS,CTS)在Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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