gl-inet / bletool

Apache License 2.0
14 stars 1 forks source link

bletool

Note: This project has been replaced by https://github.com/gl-inet/gl-ble-sdk

BleTool is a software develop kit for Bluetooth Low Energy (BLE) in GL-iNET’s products. It provides a basic and simple method for developers to operate all the BLE functions. Different from BlueZ which includes the full Bluetooth protocol stack in the host system, bletool is a light weight tool to operate hostless BLE modules which has fully built-in protocol stack. The module can fully operate on itself rather than depending on the host system. To use BleTool, you need to have one of the following devices.

You can also use BleTool if you use Silconlabs EFR32 BLE modules which use UART/SPI to connect to your host Linux.

how to install

By default, BleTool is not installed on your router. You can install it using opkg if you can ssh to the router.

opkg update
opkg install gl-bletool

Alternatively, you can install using the web UI. Login your router’s web UI using your browser which is http://192.168.8.1 by default. Then go to APPLICATIONS->Plug-ins. First click “Update” to refresh your software repo then search “gl-bletool”. Click “install” and wait until you got “installation successfully”.

installipk installsuccessful

how to use

BleTool provides the following elements to handle BLE advertising, connection and GATT services.

openwrt

API Reference

Look at the Bletool manual. It contains all detail about the API and CLI.

Directory Structure

|—— LICENSE
|
|—— Makefile
|
|—— VERSION_FILE
|
|—— README.md
|
|—— docs                                        # document
|
|—— files
|   |—— gl_bletool.init                         # configuration file
|
|—— src
    |   |—— components
    |   |   |—— dev_mgr
    |       |—— log
    |
    |—— daemon                                  # ble daemon
    |   |—— gl_daemon.c
    |   |—— bledriver
    |       |——silabs                           # silabs SDK
    |       |——util                             # utilities   
    |
    |—— include                                 # header file
        |—— gl_errno.h
    |   |—— gl_type.h
    |
    |—— lib                                     # ble api lib
    |   |—— gl_bleapi.h
    |   |—— gl_bleapi.c
    |
    |—— project                                 # user application file
    |   |—— gl_demo.c                           # demo file
    |
    |—— tool                        
    |   |—— gl_cli.c                            # debug tool – bletool
    |
    |—— Makefile