diff options
| author | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-06-23 19:22:20 +0700 |
|---|---|---|
| committer | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-06-23 19:33:13 +0700 |
| commit | 8274cab154f198447f12028e1686bbe2a6de6ebd (patch) | |
| tree | 35c825b6551afad7688813d7de510111a67bf007 /src/ble/profile/utils.h | |
| parent | 2383bf65e5f3ee9bc58877905dd29eed2e194d19 (diff) | |
feat: add initial Bluetooth LE module
Diffstat (limited to 'src/ble/profile/utils.h')
| -rw-r--r-- | src/ble/profile/utils.h | 22 |
1 files changed, 22 insertions, 0 deletions
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__ */ |