Partial implementation of BlueGiga's BGAPI for use with the BLE112/3 modules over UART.
Hi there! I recently started using BLE112 modules with the mbed LPC1768 MCU, and I realized there was no implementation of BlueGiga's BGAPI available for mbed. This library implements only a few commands, but if you're looking to get started, this is a good place to look.
This was developed against BGAPI v1.3.2. I make no guarantees as to how well it will work with newer revisions of the software.
Diff: BGLib.cpp
- Revision:
- 6:23d9a99dcde0
- Parent:
- 4:21eee6881dac
- Child:
- 7:63daf39f20e1
diff -r 7c7220a316ed -r 23d9a99dcde0 BGLib.cpp --- a/BGLib.cpp Tue May 19 05:01:10 2015 +0000 +++ b/BGLib.cpp Tue May 19 05:49:00 2015 +0000 @@ -39,6 +39,12 @@ mTimestampCallback = pCallback; } +void BGLib::ble_cmd_gap_discover(gap_discover_mode mode) { + uint8_t bytes[] = {0x00, 0x01, 0x06, 0x02, 0x00}; + bytes[4] = (uint8_t) mode; + send_bytes(bytes, 5); +} + void BGLib::parse() { mTimestampCallback();