ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
main_ble_custom_service_notify.cpp File Reference

BLE example showing a minimal custom service with NOTIFY. More...

#include <cassert>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <vector>
#include "../common/gap_event_handler.hpp"
#include "../common/characteristic_event_handler.hpp"
#include "advertisement_data.hpp"
#include "attribute_server.hpp"
#include "ble.hpp"
#include "characteristic.hpp"
#include "freertos_task.hpp"
#include "gap.hpp"
#include "platform.hpp"
#include "app_profile.h"
Include dependency graph for main_ble_custom_service_notify.cpp:

Functions

int main ()
 Program entry point for the custom service NOTIFY example.
 

Detailed Description

BLE example showing a minimal custom service with NOTIFY.

This example demonstrates:

  • defining a NOTIFY characteristic in a .gatt profile
  • locating the service/characteristic by UUID via AttributeServer
  • periodically updating a characteristic value and sending notifications

GATT layout

Service UUID: 0xFFD0

  • NotifyValue (UUID 0xFFD1): READ | NOTIFY (dynamic)

How to test (nRF Connect / LightBlue)

1) Connect to "c7222-notify-demo" 2) Open "NotifyValue" 3) Enable notifications (CCCD) 4) Observe periodic updates (counter increments)

Function Documentation

◆ main()

int main ( void  )

Program entry point for the custom service NOTIFY example.

Here is the call graph for this function: