BlueToe
an alternative GATT/BLE implementation
Loading...
Searching...
No Matches
gap_service.hpp
1#ifndef BLUETOE_GAP_SERVICE_HPP
2#define BLUETOE_GAP_SERVICE_HPP
3
4#include <cstdint>
5#include <bluetoe/service.hpp>
6#include <bluetoe/appearance.hpp>
7#include <bluetoe/server_name.hpp>
8
9namespace bluetoe {
10
11 namespace details {
12 struct gap_service_definition_meta_type {};
13
14 template < std::uint16_t MinConnectionInterval, std::uint16_t MaxConnectionInterval >
15 struct check_gap_service_for_gatt_servers_parameter
16 {
17
18 };
19 }
20
30 struct meta_type :
31 details::gap_service_definition_meta_type,
32 details::valid_server_option_meta_type {};
33
34 template < typename Services, typename ... ServerOptions >
35 struct add_service {
36 typedef Services type;
37 };
39 };
40
51 {
53 struct meta_type :
54 details::gap_service_definition_meta_type,
55 details::valid_server_option_meta_type {};
56
57 template < typename Appearance, typename Name >
58 using gap_service =
59 service<
64 >,
68 >
69 >;
70
71 template < typename Services, typename ... ServerOptions >
72 struct add_service {
73 typedef typename details::find_by_meta_type<
74 details::device_appearance_meta_type,
75 ServerOptions...,
77 >::type device_appearance;
78
79 static constexpr char default_server_name[ 15 ] = "Bluetoe-Server";
80
81 typedef typename details::find_by_meta_type<
82 details::server_name_meta_type,
83 ServerOptions...,
85 >::type device_name;
86
87 typedef typename details::add_type<
88 Services,
89 gap_service< device_appearance, device_name >
90 >::type type;
91 };
92
94 };
95
97 template < typename Services, typename ... ServerOptions >
98 constexpr char gap_service_for_gatt_servers::add_service< Services, ServerOptions... >::default_server_name[ 15 ];
101}
102
103#endif
A characteristic is a typed value that is accessable by a GATT client hosted by a GATT server.
Definition: characteristic.hpp:160
a 16-Bit UUID used to identify a service
Definition: service.hpp:80
a service with zero or more characteristics
Definition: service.hpp:150
a 16-Bit UUID used to identify a characteristic.
Definition: characteristic.hpp:79
a constant string characteristic value
Definition: characteristic_value.hpp:429
type to keep a bluetoe::appearance value
Definition: appearance.hpp:18
provides a characteristic with a fixed, read-only value
Definition: characteristic_value.hpp:345
Used as a parameter to a server, to define that the GATT server will include a GAP service for GATT s...
Definition: gap_service.hpp:51
Used as a parameter to a server, to define that the GATT server will not include a GAP service for GA...
Definition: gap_service.hpp:28
adds a discoverable device name
Definition: server_name.hpp:16