Giter Site home page Giter Site logo

g-hjy / hbluetooth Goto Github PK

View Code? Open in Web Editor NEW
187.0 187.0 13.0 238 KB

Android蓝牙开发。封装了支持Android蓝牙(经典蓝牙或低功耗蓝牙)扫描,连接,以及通信的库。附带使用例子。It encapsulates a library that supports Android Bluetooth (classic Bluetooth or low-power Bluetooth) scanning, connection and communication. Attached use examples.

Java 100.00%
android ble bluetooth bluetooth-low-energy library

hbluetooth's People

Contributors

g-hjy avatar xinduan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hbluetooth's Issues

搜索问题

手机蓝牙可以搜索到,通过程序不行,Android 11

与设备进行通信

你好,我没看明白,你这里与设备进行通信,我要发给设备的命令应该放在哪里,sender.send后面是什么?

通信问题

你好,最近在尝试使用这个蓝牙库,有几个问题想请教一下,期待大佬回复。

第一个,低功耗蓝牙的 UUID 怎么传,需要进行蓝牙通信。

第二个,通信时,传输 JSON 数据,应该怎么写。Demo 中的看不太明白。

sender.send(new byte[]{0x01, 0x02}, new SendCallBack() {
@OverRide
public void onSending() {
Log.i(TAG, "命令发送中...");
}
Demo 中 通信时,在 log 中也没看到 onSending() 和 onReceived() 的回调

关于蓝牙配对密码的问题

我有一个android设备是没有界面的,然后设置为服务端,然后另外一个设备是手机设置为客户端,每次客户端去连接无界面的android智能设备都提示确认配对密码,这种怎么处理呢。我也写了监听,自动配对和设置pin值,打断点也进入了这个方法体,但是没有效果。谢谢大佬
//自动配对设置Pin值 @Throws(java.lang.Exception::class) fun autoBond( btClass: Class<*>, device: BluetoothDevice?, strPin: String ): Boolean { val autoBondMethod: Method = btClass.getMethod("setPin", ByteArray::class.java) return autoBondMethod(device, strPin.toByteArray()) as Boolean }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.