Corrected scope of formatFlags function in ble-discovery.