Preventing random connections to nrf52832 custom device

Hello!

I am working on a medical device project utilizing nrf52832 microcontroller. We use a mobile app to control and interact with the device through BLE since the device only has 1 button and 2 LEDs for I/Os. My question is related to security aspect of the BLE connection; is there a way to prevent random bluetooth devices from connecting to nrf52832 controller using existing BLE features/libraries while advertising? Or would this have to be implemented in the application layer?

Related