简体   繁体   English

如何将 hex 文件从 android 应用程序传输到蓝牙低功耗 (BLE) 模块?

[英]How to transfer a hex file from android app to Bluetooth Low Energy (BLE) module?

I'm developing an android app to transfer a hex file over BLE to a BLE module.我正在开发一个 android 应用程序,通过 BLE 将十六进制文件传输到 BLE 模块。 I have established the connection between the app and the BLE module using BluetoothGatt class.我已经使用BluetoothGatt类在应用程序和 BLE 模块之间建立了连接。 Now I want to send the hex file.现在我想发送十六进制文件。 Then the BLE module will receive the file and write to an SD card connected to that module.然后 BLE 模块将接收文件并写入连接到该模块的 SD 卡。

Balaraman.巴拉拉曼。

Using BluetoothGatt you can write to particular service and be notified about the result from that service.使用 BluetoothGatt,您可以写入特定服务并收到有关该服务结果的通知。 like explained in this link.就像在这个链接中解释的那样。

https://www.allaboutcircuits.com/projects/how-to-communicate-with-a-custom-ble-using-an-android-app/ https://www.allaboutcircuits.com/projects/how-to-communicate-with-a-custom-ble-using-an-android-app/

if you want to write hex commands to receive data from bluetooth device by notify or read, you can follow above tutorial.如果您想编写十六进制命令以通过通知或读取从蓝牙设备接收数据,您可以按照上面的教程进行操作。

But if HEX file contains some commands for the BLE module(Device) to make sure the BLE device updated by new code in the device itself, you need to flash those on to the device by the micro controller within it.但是,如果 HEX 文件包含一些用于 BLE 模块(设备)的命令,以确保设备本身中的新代码更新了 BLE 设备,则需要通过其中的微控制器将这些命令闪存到设备上。

I don't know how but in my former work place our Hardware engineer used to do that, whenever there was need to update the device code..我不知道怎么做,但在我以前的工作场所,我们的硬件工程师曾经这样做过,每当需要更新设备代码时..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM