From 8274cab154f198447f12028e1686bbe2a6de6ebd Mon Sep 17 00:00:00 2001 From: Dien-Nhung Nguyen-Phu Date: Sun, 23 Jun 2024 19:22:20 +0700 Subject: feat: add initial Bluetooth LE module --- src/ble/profile/utils.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/ble/profile/utils.h (limited to 'src/ble/profile/utils.h') diff --git a/src/ble/profile/utils.h b/src/ble/profile/utils.h new file mode 100644 index 0000000..b52504f --- /dev/null +++ b/src/ble/profile/utils.h @@ -0,0 +1,22 @@ +#ifndef __UTILS_H__ +#define __UTILS_H__ + +#include "CH58xBLE_LIB.h" + +#define ATTR_DECLAR(uuid, uuid_size, permissions, val) \ + { \ + {(uuid_size), (uint8_t *)(uuid)}, \ + (permissions), \ + 0, \ + (uint8_t *)(val) \ + } + +// Characteristic Declaration +#define CHAR_DECLAR(properties) \ + ATTR_DECLAR(characterUUID, 2, GATT_PERMIT_READ, properties) + +// Characteristic Value Declaration +#define CHAR_VAL_DECLAR(uuid, uuid_size, permissions, val) \ + ATTR_DECLAR(uuid, uuid_size, permissions, val) + +#endif /* __UTILS_H__ */ -- cgit v1.2.3