- \r
- /* Only accept the connection if it is a ACL (data) connection */\r
- Bluetooth_HCIProcessingState = (Bluetooth_Connection.IsConnected ||\r
- (((Bluetooth_HCIEvent_ConnectionRequest_t*)&EventParams)->LinkType != 0x01)) ?\r
+ \r
+ bool IsACLConnection = (((Bluetooth_HCIEvent_ConnectionRequest_t*)&EventParams)->LinkType == 0x01);\r
+\r
+ /* Only accept the connection if it is a ACL (data) connection, a device is not already connected\r
+ and the user application has indicated that the connection should be allowed */\r
+ Bluetooth_HCIProcessingState = (Bluetooth_Connection.IsConnected || !(IsACLConnection) ||\r
+ !(CALLBACK_Bluetooth_ConnectionRequest(Bluetooth_TempDeviceAddress))) ?\r