C/C++ BLE read/write example with Bluez

前端 未结 2 398
悲&欢浪女
悲&欢浪女 2021-02-04 12:21

I am starting to build up a simple BLE network with a microcontroller and a raspberry pi (tardis BLE dongle). As a starting point, I am looking for a simple C or C++ example to

2条回答
  •  太阳男子
    2021-02-04 12:58

    Something simple? How short is a piece of string? I personally think that the gatttool code itself is simple enough to follow and extract for your own purposes (I've done it recently). But if that's really not suitable for you then another option is libgatt. It's essentially the same code that gatttool uses but has been bundled more conveniently into a public library API. Have a look at gatt.h which has connect/read/write etc. Hopefully it should be self evident how to use that.

提交回复
热议问题