且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过启用蓝牙的微控制器通过 Android 手机拨打电话

更新时间:2023-11-27 16:31:10

也许先说坏"消息:

Android 本身不提供任何类型的调制解调器"功能等.意思是:没有内置AT命令来通过蓝牙控制手机.

Android itself does not provide any kind of "modem" functionality or the like. Means: There are no AT commands built in to control the phone via bluetooth.

好消息是:Android 手机几乎可以通过适当的应用程序以您能想到的任何方式进行控制.

The good news is: The Android phone can be controlled in almost any way you can think of by an appropriate app.

因此,您可能想要采用的方式(如果您想坚持使用 Android)是编写自己的特定 Android 应用程序

The way you might want to go (if you want to stick to Android) is thus to write your own specific Android app which

  1. 处理与 µC 之间的蓝牙连接(BlueTerm 显然成功地做到了这一点),并且
  2. 通过已建立的 BT 连接接受来自 µC 的命令,然后根据需要在 Android 设备上执行任何操作,例如拨打电话、发送 SMS 消息、播放声音,等等.

要开始 Android 应用程序开发,您可以访问 http://developer.android.com/index.html.如果您之前没有编写过 Android 应用,请准备好学习很多的新概念.

For a start on Android app development, you may go to http://developer.android.com/index.html. If you haven't written Android apps before be prepared to learn a lot of new concepts.

也许您可以利用一两个示例应用程序,例如 "Bluetooth Chat".

Maybe you can leverage one or two of the example apps, like "Bluetooth Chat".

Android 看到我的蓝牙设备,但说已配对,但未连接".

The android sees my bluetooth device, but says "paired, but not connect".

这只是表明您的 µC 的蓝牙模块与手机配对成功,并且手机存储了配对信息,以便将来无需重复输入 PIN 即可连接.未连接"部分应该暗示当前没有与指定设备建立连接,但是,在我的手机上,我从未见过配对并连接"或类似内容.不知道为什么.

This is just the indication that pairing between your µC's Bluetooth module and the phone was successful and that the phone stored the pairing information to allow future connections without repeated input of a PIN. The "not connected" part should imply that there is no connection currently established with the named device, however, on my phone I have never seen a "paired and connected" or similar. Not sure why.

我假设有一些标准协议并允许手机同步到蓝牙设备?

Im assuming there is some standard protocol and allow the cell phone to sync to the bluetooth device?

对于 Android,Google 决定仅实现 RFCOMM 蓝牙连接,其中一个特殊的连接是 SPP 串行端口仿真,这可能正是您的 BT 模块和 BlueTerm 使用的.

For Android, Google settled for implementing only RFCOMM Bluetooth connections, a special one of those being the SPP serial port emulation which is probably just what your BT module and BlueTerm use.