-
- All Implemented Interfaces:
-
android.os.Parcelable,no.nordicsemi.android.ble.callback.DataReceivedCallback,no.nordicsemi.android.ble.callback.profile.ProfileDataCallback
public class ProfileReadResponse extends ReadResponse implements ProfileDataCallback, Parcelable
A response type for read requests with basic validation check. When read was requested as a synchronous call the isValid can be used to check if data were parsed successfully. Parsing method must call super methods on both onDataReceived and onInvalidDataReceived in order to make getters working properly.
Check out profile data callbacks in the Android BLE Common Library for example of usage.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<ProfileReadResponse>CREATOR
-
Constructor Summary
Constructors Constructor Description ProfileReadResponse()
-
Method Summary
Modifier and Type Method Description voidonInvalidDataReceived(@NonNull() BluetoothDevice device, @NonNull() Data data)Callback called when the data received do not conform to required scheme. booleanisValid()Returns true if onInvalidDataReceived wasn't called. voidwriteToParcel(@NonNull() Parcel dest, int flags)-
Methods inherited from class no.nordicsemi.android.ble.response.ReadResponse
describeContents, getBluetoothDevice, getRawData, onDataReceived, writeToParcel -
Methods inherited from class android.os.Parcelable
describeContents, writeToParcel -
Methods inherited from class no.nordicsemi.android.ble.callback.profile.ProfileDataCallback
onInvalidDataReceived -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onInvalidDataReceived
void onInvalidDataReceived(@NonNull() BluetoothDevice device, @NonNull() Data data)
Callback called when the data received do not conform to required scheme.
- Parameters:
device- the target device.data- the data received.
-
isValid
boolean isValid()
Returns true if onInvalidDataReceived wasn't called.
-
writeToParcel
void writeToParcel(@NonNull() Parcel dest, int flags)
-
-
-
-