From de11e6f61534e1b5c1b0b973f0db5b758bd1da9a Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 8 Oct 2024 19:37:08 -0700 Subject: [PATCH] Posix: add test for allowing/disallowing incoming connections --- examples/posix/src/my_platform.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/posix/src/my_platform.c b/examples/posix/src/my_platform.c index 011bc91a..1038fe37 100644 --- a/examples/posix/src/my_platform.c +++ b/examples/posix/src/my_platform.c @@ -242,6 +242,14 @@ static void posix_on_controller_data(uni_hid_device_t* d, uni_controller_t* ctl) uni_bt_start_scanning_and_autoconnect_safe(); enabled = true; } + + if (gp->buttons & BUTTON_THUMB_L) { + logi("Incoming connections allowed\n"); + uni_bt_allow_incoming_connections(true); + } else if (gp->buttons & BUTTON_THUMB_R) { + logi("Incoming connections disallowed\n"); + uni_bt_allow_incoming_connections(false); + } break; case UNI_CONTROLLER_CLASS_MOUSE: // TODO: Do something