You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've never quite understood the purpose of this code section in the examples.
match data.process(server).await{// Server processing emitsOk(Some(GattEvent::Read(event))) => {if event.handle() == level.handle{let value = server.get(&level);info!("[gatt] Read Event to Level Characteristic: {:?}", value);}}Ok(Some(GattEvent::Write(event))) => {if event.handle() == level.handle{info!("[gatt] Write Event to Level Characteristic: {:?}", event.data());}}Ok(_) => {}Err(e) => {warn!("[gatt] error processing event: {:?}", e);}}
It only logs stuff. When would I enable such in my application, if reads, writes etc. happen anyways within the data.process(server) call?
The problem I have with this is that it ties the level.handle (a particular service's detail) to the implementation of the server's event loop. I don't think that's necessary, and removing this code in my own app allows encapsulation of service characteristics to be private.
The text was updated successfully, but these errors were encountered:
The write doesnt happen in the process call, but when the event is accept()ed, at which point it will return a reply that can be sent explicitly. The example code hides this since it relies on the drop implementation. It should probably show the full accept() and send() dance
I've never quite understood the purpose of this code section in the examples.
It only logs stuff. When would I enable such in my application, if reads, writes etc. happen anyways within the
data.process(server)
call?The problem I have with this is that it ties the
level.handle
(a particular service's detail) to the implementation of the server's event loop. I don't think that's necessary, and removing this code in my own app allows encapsulation of service characteristics to be private.The text was updated successfully, but these errors were encountered: