/** * Reads the current PHY for this connections. * <p> * PHY LE 2M and PHY LE Coded are supported only on Android Oreo or newer. * You may safely read PHY on older platforms, but the request will not be executed * and you will get PHY LE 1M as TX and RX PHY in the callback. * * @return The new request. * @deprecated Access to this method will change to package-only. * Use {@link BleManager#readPhy()} instead. */ @Deprecated @NonNull public static PhyRequest newReadPhyRequest() { return new PhyRequest(Type.READ_PHY); }
/** * Reads the current PHY for this connections. * <p> * PHY LE 2M and PHY LE Coded are supported only on Android Oreo or newer. * You may safely read PHY on older platforms, but you will get PHY LE 1M as TX and RX PHY * in the callback. * <p> * The returned request must be either enqueued using {@link Request#enqueue()} for * asynchronous use, or awaited using await() in synchronous execution. * * @return The request. */ protected final PhyRequest readPhy() { return Request.newReadPhyRequest().setManager(this); }
/** * Requests the change of preferred PHY for this connections. * <p> * PHY LE 2M and PHY LE Coded are supported only on Android Oreo or newer. * You may safely request other PHYs on older platforms, but the request will not be executed * and you will get PHY LE 1M as TX and RX PHY in the callback. * * @param txPhy preferred transmitter PHY. Bitwise OR of any of * {@link PhyRequest#PHY_LE_1M_MASK}, {@link PhyRequest#PHY_LE_2M_MASK}, * and {@link PhyRequest#PHY_LE_CODED_MASK}. * @param rxPhy preferred receiver PHY. Bitwise OR of any of * {@link PhyRequest#PHY_LE_1M_MASK}, {@link PhyRequest#PHY_LE_2M_MASK}, * and {@link PhyRequest#PHY_LE_CODED_MASK}. * @param phyOptions preferred coding to use when transmitting on the LE Coded PHY. Can be one * of {@link PhyRequest#PHY_OPTION_NO_PREFERRED}, * {@link PhyRequest#PHY_OPTION_S2} or {@link PhyRequest#PHY_OPTION_S8}. * @return The new request. * @deprecated Access to this method will change to package-only. * Use {@link BleManager#setPreferredPhy(int, int, int)} instead. */ @Deprecated @NonNull public static PhyRequest newSetPreferredPhyRequest(@PhyMask final int txPhy, @PhyMask final int rxPhy, @PhyOption final int phyOptions) { return new PhyRequest(Type.SET_PREFERRED_PHY, txPhy, rxPhy, phyOptions); }
/** * Enqueues a request to set the preferred PHY. * <p> * PHY LE 2M and PHY LE Coded are supported only on Android Oreo or newer. * You may safely request other PHYs on older platforms, but you will get PHY LE 1M * as TX and RX PHY in the callback. * <p> * The returned request must be either enqueued using {@link Request#enqueue()} for * asynchronous use, or awaited using await() in synchronous execution. * * @param txPhy preferred transmitter PHY. Bitwise OR of any of * {@link PhyRequest#PHY_LE_1M_MASK}, {@link PhyRequest#PHY_LE_2M_MASK}, * and {@link PhyRequest#PHY_LE_CODED_MASK}. * @param rxPhy preferred receiver PHY. Bitwise OR of any of * {@link PhyRequest#PHY_LE_1M_MASK}, {@link PhyRequest#PHY_LE_2M_MASK}, * and {@link PhyRequest#PHY_LE_CODED_MASK}. * @param phyOptions preferred coding to use when transmitting on the LE Coded PHY. Can be one * of {@link PhyRequest#PHY_OPTION_NO_PREFERRED}, * {@link PhyRequest#PHY_OPTION_S2} or {@link PhyRequest#PHY_OPTION_S8}. * @return The request. */ protected final PhyRequest setPreferredPhy(@PhyMask final int txPhy, @PhyMask final int rxPhy, @PhyOption final int phyOptions) { return Request.newSetPreferredPhyRequest(txPhy, rxPhy, phyOptions).setManager(this); }