-
- All Implemented Interfaces:
-
android.os.Parcelable,no.nordicsemi.android.ble.callback.DataReceivedCallback,no.nordicsemi.android.ble.callback.profile.ProfileDataCallback,no.nordicsemi.android.ble.common.profile.ht.MeasurementIntervalCallback
public final class MeasurementIntervalResponse extends MeasurementIntervalDataCallback implements Parcelable
Response class that could be used as a result of a synchronous request. The data received are available through getters, instead of a callback.
Usage example:
try { MeasurementIntervalResponse response = readCharacteristic(characteristic) .awaitValid(MeasurementIntervalResponse.class); int type = response.getType(); ... } catch (RequestFailedException e) { Log.w(TAG, "Request failed with status " + e.getStatus(), e); } catch (InvalidDataException e) { Log.w(TAG, "Invalid data received: " + e.getResponse().getRawData()); }
-
-
Field Summary
Fields Modifier and Type Field Description private intintervalpublic final static Parcelable.Creator<MeasurementIntervalResponse>CREATOR
-
Constructor Summary
Constructors Constructor Description MeasurementIntervalResponse()
-
Method Summary
Modifier and Type Method Description intgetInterval()Returns the measurement interval in seconds. voidonMeasurementIntervalReceived(@NonNull() BluetoothDevice device, int interval)Callback called when Measurement Interval characteristic has been read. voidwriteToParcel(@NonNull() Parcel dest, int flags)-
Methods inherited from class no.nordicsemi.android.ble.common.callback.ht.MeasurementIntervalDataCallback
onDataReceived -
Methods inherited from class no.nordicsemi.android.ble.callback.profile.ProfileReadResponse
isValid, onInvalidDataReceived, writeToParcel -
Methods inherited from class no.nordicsemi.android.ble.response.ReadResponse
describeContents, getBluetoothDevice, getRawData, onDataReceived -
Methods inherited from class no.nordicsemi.android.ble.common.profile.ht.MeasurementIntervalCallback
onMeasurementIntervalReceived -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getInterval
int getInterval()
Returns the measurement interval in seconds.
-
onMeasurementIntervalReceived
void onMeasurementIntervalReceived(@NonNull() BluetoothDevice device, int interval)
Callback called when Measurement Interval characteristic has been read.
- Parameters:
device- the target device.interval- measurement interval in seconds.
-
writeToParcel
void writeToParcel(@NonNull() Parcel dest, int flags)
-
-
-
-