@NonNull
    public static PhyPair toPhyPair(int txPhy, int rxPhy) {
        // GATT callbacks do not use the same LE Coded value as it does for the setPreferredPhy function. GATT
        // callbacks use the unmasked value (BluetoothDevice.PHY_LE_CODED) and setPreferredPhy uses the mask value
        // (BluetoothDevice.PHY_LE_CODED_MASK). Explicitly check for BluetoothDevice.PHY_LE_CODED here and manually
        // set it to RxBlePhy.PHY_CODED since it too uses the masked version. This will abstract that confusion
        // away from the user and make it unified.
        RxBlePhy tx = RxBlePhyImpl.fromValue(txPhy);
        RxBlePhy rx = RxBlePhyImpl.fromValue(rxPhy);

        return new PhyPairImpl(tx, rx);
    }
Function used to convert the specified enum set to the equivalent values mask.

@param set The enum set to compute the values mask for.

@return If the set is NULL, empty, then the default value mask, RxBlePhy.PHY_1M, is returned.
Otherwise, the resulting values mask is returned.
rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/RxBlePhyImpl.java