MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
btle_connection.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <stdint.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
17 typedef enum {
18  MBL_MW_GATT_CHAR_WRITE_WITH_RESPONSE = 0,
19  MBL_MW_GATT_CHAR_WRITE_WITHOUT_RESPONSE
21 
25 typedef struct {
26  uint64_t service_uuid_high;
27  uint64_t service_uuid_low;
28  uint64_t uuid_high;
29  uint64_t uuid_low;
31 
38 typedef int32_t(*MblMwFnIntVoidPtrArray)(const void* caller, const uint8_t* start, uint8_t length);
44 typedef void(*MblMwFnVoidVoidPtrInt)(const void* caller, int32_t value);
45 
49 typedef struct {
53  void *context;
62  void (*write_gatt_char)(void *context, const void* caller, MblMwGattCharWriteType writeType, const MblMwGattChar* characteristic,
63  const uint8_t* value, uint8_t length);
71  void (*read_gatt_char)(void *context, const void* caller, const MblMwGattChar* characteristic, MblMwFnIntVoidPtrArray handler);
80  void (*enable_notifications)(void *context, const void* caller, const MblMwGattChar* characteristic, MblMwFnIntVoidPtrArray handler, MblMwFnVoidVoidPtrInt ready);
87  void (*on_disconnect)(void *context, const void* caller, MblMwFnVoidVoidPtrInt handler);
89 
90 #ifdef __cplusplus
91 }
92 #endif
void(* MblMwFnVoidVoidPtrInt)(const void *caller, int32_t value)
Definition for callback functions that accept a void pointer and an int32.
Definition: btle_connection.h:44
UUIDs identifying a gatt characteristic and its parent service.
Definition: btle_connection.h:25
uint64_t uuid_high
High 64 bits of the characteristic uuid.
Definition: btle_connection.h:28
uint64_t uuid_low
Low 64 bits of the characteristic uuid.
Definition: btle_connection.h:29
Wrapper class containing functions for communicating with the MetaWear through a Bluetooth Low Energy...
Definition: btle_connection.h:49
uint64_t service_uuid_low
Low 64 bits of the parent service uuid.
Definition: btle_connection.h:27
int32_t(* MblMwFnIntVoidPtrArray)(const void *caller, const uint8_t *start, uint8_t length)
Definition for callback functions that accept a void pointer and byte array.
Definition: btle_connection.h:38
uint64_t service_uuid_high
High 64 bits of the parent service uuid.
Definition: btle_connection.h:26
MblMwGattCharWriteType
Write types for the GATT characteristic.
Definition: btle_connection.h:17
void * context
Provides the calling function the ability to pass any context specific data required.
Definition: btle_connection.h:53