pub enum LocalServiceDelegateRequest {
OnCharacteristicConfiguration {
characteristic_id: u64,
peer_id: String,
notify: bool,
indicate: bool,
control_handle: LocalServiceDelegateControlHandle,
},
OnReadValue {
id: u64,
offset: i32,
responder: LocalServiceDelegateOnReadValueResponder,
},
OnWriteValue {
id: u64,
offset: u16,
value: Vec<u8>,
responder: LocalServiceDelegateOnWriteValueResponder,
},
OnWriteWithoutResponse {
id: u64,
offset: u16,
value: Vec<u8>,
control_handle: LocalServiceDelegateControlHandle,
},
}
Expand description
Interface for responding to requests on a local service.
Variants§
OnCharacteristicConfiguration
Notifies the delegate when a remote device with peer_id
enables or
disables notifications or indications on the characteristic with the given
characteristic_id
.
Fields
control_handle: LocalServiceDelegateControlHandle
OnReadValue
Called when a remote device issues a request to read the value of the
of the characteristic or descriptor with given identifier. The delegate
must respond to the request by returning the characteristic value. If the
read request resulted in an error it should be returned in error_code
.
On success, error_code
should be set to NO_ERROR and a value
should be
provided.
OnWriteValue
Called when a remote device issues a request to write the value of the characteristic or descriptor with the given identifier.
OnWriteWithoutResponse
Called when a remote device issues a request to write the value of the characteristic with the given identifier. This can be called on a characteristic with the WRITE_WITHOUT_RESPONSE property.
Implementations§
Source§impl LocalServiceDelegateRequest
impl LocalServiceDelegateRequest
pub fn into_on_characteristic_configuration( self, ) -> Option<(u64, String, bool, bool, LocalServiceDelegateControlHandle)>
pub fn into_on_read_value( self, ) -> Option<(u64, i32, LocalServiceDelegateOnReadValueResponder)>
pub fn into_on_write_value( self, ) -> Option<(u64, u16, Vec<u8>, LocalServiceDelegateOnWriteValueResponder)>
pub fn into_on_write_without_response( self, ) -> Option<(u64, u16, Vec<u8>, LocalServiceDelegateControlHandle)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL