ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
gap_event_handler.hpp File Reference

Minimal GAP event handler used by BLE examples. More...

#include <cstdint>
#include <cstdio>
#include "attribute_server.hpp"
#include "gap.hpp"
Include dependency graph for gap_event_handler.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GapEventHandler
 Minimal GAP event handler for example applications. More...
 

Detailed Description

Minimal GAP event handler used by BLE examples.

This header declares a small helper class that implements c7222::Gap::EventHandler and prints GAP events to the console. It is used by BLE examples to track the state of advertising, scanning, and connections without adding application-specific behavior. The intent is educational: demonstrate how to register a handler and what information is available in each callback.

The class is deliberately minimal. It keeps a Gap pointer so it can restart advertising after a disconnect, which is common in examples that should remain discoverable. It also keeps an optional AttributeServer pointer so that, on connection, it can propagate the active connection handle to the GATT layer and enable attribute access.