From 3796f76c56d42ca9b4fd36edae7f6bf6656009b9 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Mon, 29 Jun 2020 00:37:11 -0400 Subject: Initial exploration of split BLE service. * Service for split peripheral to report position state to split central. * Updated advertising info. * Behavior for split BT until we have a proper event system. --- app/include/zmk/split/bluetooth/service.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/include/zmk/split/bluetooth/service.h (limited to 'app/include') diff --git a/app/include/zmk/split/bluetooth/service.h b/app/include/zmk/split/bluetooth/service.h new file mode 100644 index 0000000..694afc1 --- /dev/null +++ b/app/include/zmk/split/bluetooth/service.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +#ifndef BT_UUID_NUM_OF_DIGITALS +#define BT_UUID_NUM_OF_DIGITALS BT_UUID_DECLARE_16(0x2909) +#endif + +#define ZMK_SPLIT_BT_BASE_UUID 0x2a, 0x48, 0xc2, 0xb1, 0xcf, 0xc5, 0x67, 0xc9, 0x07, 0x71, 0x96, 0x00 +#define ZMK_SPLIT_BT_SERVICE_UUID ZMK_SPLIT_BT_BASE_UUID, 0x00, 0x00, 0x00, 0x00 +#define ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID ZMK_SPLIT_BT_BASE_UUID, 0x01, 0x00, 0x00, 0x00 + +#define ZMK_BT_UUID_SPLIT BT_UUID_DECLARE_128(ZMK_SPLIT_BT_SERVICE_UUID) +#define ZMK_BT_UUID_SPLIT_POS_STATE BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID) + +int zmk_split_bt_position_pressed(u8_t position); +int zmk_split_bt_position_released(u8_t position); \ No newline at end of file -- cgit v1.2.3 From a165db63586f37531d5050623bc5a7bc96793d49 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Wed, 1 Jul 2020 22:27:01 -0400 Subject: Initial work on split central support. --- app/include/zmk/split/bluetooth/service.h | 11 ----------- app/include/zmk/split/bluetooth/uuid.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 app/include/zmk/split/bluetooth/uuid.h (limited to 'app/include') diff --git a/app/include/zmk/split/bluetooth/service.h b/app/include/zmk/split/bluetooth/service.h index 694afc1..76af898 100644 --- a/app/include/zmk/split/bluetooth/service.h +++ b/app/include/zmk/split/bluetooth/service.h @@ -2,16 +2,5 @@ #include -#ifndef BT_UUID_NUM_OF_DIGITALS -#define BT_UUID_NUM_OF_DIGITALS BT_UUID_DECLARE_16(0x2909) -#endif - -#define ZMK_SPLIT_BT_BASE_UUID 0x2a, 0x48, 0xc2, 0xb1, 0xcf, 0xc5, 0x67, 0xc9, 0x07, 0x71, 0x96, 0x00 -#define ZMK_SPLIT_BT_SERVICE_UUID ZMK_SPLIT_BT_BASE_UUID, 0x00, 0x00, 0x00, 0x00 -#define ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID ZMK_SPLIT_BT_BASE_UUID, 0x01, 0x00, 0x00, 0x00 - -#define ZMK_BT_UUID_SPLIT BT_UUID_DECLARE_128(ZMK_SPLIT_BT_SERVICE_UUID) -#define ZMK_BT_UUID_SPLIT_POS_STATE BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID) - int zmk_split_bt_position_pressed(u8_t position); int zmk_split_bt_position_released(u8_t position); \ No newline at end of file diff --git a/app/include/zmk/split/bluetooth/uuid.h b/app/include/zmk/split/bluetooth/uuid.h new file mode 100644 index 0000000..4fa7f40 --- /dev/null +++ b/app/include/zmk/split/bluetooth/uuid.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +#ifndef BT_UUID_NUM_OF_DIGITALS +#define BT_UUID_NUM_OF_DIGITALS BT_UUID_DECLARE_16(0x2909) +#endif + +#define ZMK_SPLIT_BT_BASE_UUID 0x2a, 0x48, 0xc2, 0xb1, 0xcf, 0xc5, 0x67, 0xc9, 0x07, 0x71, 0x96, 0x00 +#define ZMK_SPLIT_BT_SERVICE_UUID ZMK_SPLIT_BT_BASE_UUID, 0x00, 0x00, 0x00, 0x00 +#define ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID ZMK_SPLIT_BT_BASE_UUID, 0x01, 0x00, 0x00, 0x00 + +#define ZMK_BT_UUID_SPLIT BT_UUID_DECLARE_128(ZMK_SPLIT_BT_SERVICE_UUID) +#define ZMK_BT_UUID_SPLIT_POS_STATE BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID) -- cgit v1.2.3 From be537d06565a38f5fcca8d5a1d0a7b7350b35d51 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 2 Jul 2020 23:34:11 -0400 Subject: Lots of work on split peripheral/central logic. --- app/include/zmk/split/bluetooth/central.h | 2 ++ app/include/zmk/split/bluetooth/uuid.h | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 app/include/zmk/split/bluetooth/central.h (limited to 'app/include') diff --git a/app/include/zmk/split/bluetooth/central.h b/app/include/zmk/split/bluetooth/central.h new file mode 100644 index 0000000..09a7161 --- /dev/null +++ b/app/include/zmk/split/bluetooth/central.h @@ -0,0 +1,2 @@ + +int zmk_split_bt_central_init(); \ No newline at end of file diff --git a/app/include/zmk/split/bluetooth/uuid.h b/app/include/zmk/split/bluetooth/uuid.h index 4fa7f40..59f2f71 100644 --- a/app/include/zmk/split/bluetooth/uuid.h +++ b/app/include/zmk/split/bluetooth/uuid.h @@ -6,9 +6,7 @@ #define BT_UUID_NUM_OF_DIGITALS BT_UUID_DECLARE_16(0x2909) #endif -#define ZMK_SPLIT_BT_BASE_UUID 0x2a, 0x48, 0xc2, 0xb1, 0xcf, 0xc5, 0x67, 0xc9, 0x07, 0x71, 0x96, 0x00 -#define ZMK_SPLIT_BT_SERVICE_UUID ZMK_SPLIT_BT_BASE_UUID, 0x00, 0x00, 0x00, 0x00 -#define ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID ZMK_SPLIT_BT_BASE_UUID, 0x01, 0x00, 0x00, 0x00 +#define ZMK_BT_SPLIT_UUID(num) BT_UUID_128_ENCODE(num, 0x0096, 0x7107, 0xc967, 0xc5cfb1c2482a) +#define ZMK_SPLIT_BT_SERVICE_UUID ZMK_BT_SPLIT_UUID(0x00000000) +#define ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID ZMK_BT_SPLIT_UUID(0x00000001) -#define ZMK_BT_UUID_SPLIT BT_UUID_DECLARE_128(ZMK_SPLIT_BT_SERVICE_UUID) -#define ZMK_BT_UUID_SPLIT_POS_STATE BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID) -- cgit v1.2.3 From eb0bf2337ee988cb5b094db814beb0db8271e908 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 16 Jul 2020 18:52:04 -0400 Subject: More cleanup of BLE split code. --- app/include/zmk/split/bluetooth/central.h | 2 -- app/include/zmk/split/bluetooth/service.h | 2 -- 2 files changed, 4 deletions(-) delete mode 100644 app/include/zmk/split/bluetooth/central.h (limited to 'app/include') diff --git a/app/include/zmk/split/bluetooth/central.h b/app/include/zmk/split/bluetooth/central.h deleted file mode 100644 index 09a7161..0000000 --- a/app/include/zmk/split/bluetooth/central.h +++ /dev/null @@ -1,2 +0,0 @@ - -int zmk_split_bt_central_init(); \ No newline at end of file diff --git a/app/include/zmk/split/bluetooth/service.h b/app/include/zmk/split/bluetooth/service.h index 76af898..954e0cd 100644 --- a/app/include/zmk/split/bluetooth/service.h +++ b/app/include/zmk/split/bluetooth/service.h @@ -1,6 +1,4 @@ #pragma once -#include - int zmk_split_bt_position_pressed(u8_t position); int zmk_split_bt_position_released(u8_t position); \ No newline at end of file -- cgit v1.2.3