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.
callbacks.h@7:63daf39f20e1, 2015-05-19 (annotated)
- Committer:
- dishbreak
- Date:
- Tue May 19 07:30:40 2015 +0000
- Revision:
- 7:63daf39f20e1
- Parent:
- 6:23d9a99dcde0
Adding Scan Result callback support.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dishbreak | 2:3ce9a31a6a7e | 1 | #include "api_datatypes.h" |
dishbreak | 2:3ce9a31a6a7e | 2 | #ifndef CALLBACKS_H |
dishbreak | 2:3ce9a31a6a7e | 3 | #define CALLBACKS_H |
dishbreak | 2:3ce9a31a6a7e | 4 | |
dishbreak | 6:23d9a99dcde0 | 5 | /** @file callbacks.h |
dishbreak | 6:23d9a99dcde0 | 6 | * @brief Definitions of function callbacks that BGLib will invoke. |
dishbreak | 6:23d9a99dcde0 | 7 | * In order to take advantage of these callbacks, use the corresponding setter in the BGLib API. |
dishbreak | 6:23d9a99dcde0 | 8 | */ |
dishbreak | 6:23d9a99dcde0 | 9 | |
dishbreak | 6:23d9a99dcde0 | 10 | /** @brief Function pointer for Hello response handler. |
dishbreak | 5:7c7220a316ed | 11 | * This is a pointer to a callback for the Hello response. It should point to a function that takes no arguments. |
dishbreak | 5:7c7220a316ed | 12 | */ |
dishbreak | 2:3ce9a31a6a7e | 13 | typedef void (*hello_callback_t)(); |
dishbreak | 2:3ce9a31a6a7e | 14 | |
dishbreak | 6:23d9a99dcde0 | 15 | /** Function pointer for Get Info response handler. |
dishbreak | 6:23d9a99dcde0 | 16 | * @param ble_msg_system_get_info_rsp_t A data structure containing the response. |
dishbreak | 6:23d9a99dcde0 | 17 | */ |
dishbreak | 2:3ce9a31a6a7e | 18 | typedef void (*get_info_callback_t)(ble_msg_system_get_info_rsp_t); |
dishbreak | 2:3ce9a31a6a7e | 19 | |
dishbreak | 6:23d9a99dcde0 | 20 | /** Function pointer for System Boot event handler. |
dishbreak | 6:23d9a99dcde0 | 21 | * @param ble_msg_system_boot_evt_t A data structure containing the data from the System Boot event. |
dishbreak | 6:23d9a99dcde0 | 22 | */ |
dishbreak | 3:8f43af513d87 | 23 | typedef void (*boot_callback_t)(ble_msg_system_boot_evt_t); |
dishbreak | 3:8f43af513d87 | 24 | |
dishbreak | 6:23d9a99dcde0 | 25 | /** Function pointer for timestamping. This is a function that is intended to run whenever there is <em>any</em> data available on the UART. |
dishbreak | 6:23d9a99dcde0 | 26 | */ |
dishbreak | 4:21eee6881dac | 27 | typedef void (*timestamp_callback_t)(); |
dishbreak | 4:21eee6881dac | 28 | |
dishbreak | 6:23d9a99dcde0 | 29 | /** Function pointer for Discover response handler. |
dishbreak | 6:23d9a99dcde0 | 30 | * @param ble_msg_gap_discover_rsp_t A data structure containing the response. |
dishbreak | 6:23d9a99dcde0 | 31 | */ |
dishbreak | 6:23d9a99dcde0 | 32 | typedef void (*discover_callback_t)(ble_msg_gap_discover_rsp_t); |
dishbreak | 6:23d9a99dcde0 | 33 | |
dishbreak | 7:63daf39f20e1 | 34 | /** Function pointer for Scan Result event handler. |
dishbreak | 7:63daf39f20e1 | 35 | * @param ble_msg_gap_scan_result_evt_t A data structure containing the data from a Scan Result event. |
dishbreak | 7:63daf39f20e1 | 36 | */ |
dishbreak | 7:63daf39f20e1 | 37 | typedef void (*scan_result_callback_t)(ble_msg_gap_scan_result_evt_t); |
dishbreak | 7:63daf39f20e1 | 38 | |
dishbreak | 2:3ce9a31a6a7e | 39 | #endif |