diff options
| author | François Cartegnie <281376+fcartegnie@users.noreply.github.com> | 2024-07-09 08:46:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-09 08:46:19 +0200 |
| commit | a6c62295e92b3d960700508a445be1fba71a3cc2 (patch) | |
| tree | 35c825b6551afad7688813d7de510111a67bf007 /src/ble/profile/utils.h | |
| parent | 69b530cbbb72ad9e4b9a7a6c4742f29540664d00 (diff) | |
| parent | 8274cab154f198447f12028e1686bbe2a6de6ebd (diff) | |
Merge pull request #30 from kienvo/ble-init
feat: Bluetooth LE initial setup
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__ */ |