Giter Club home page Giter Club logo

Comments (4)

zxzxwu avatar zxzxwu commented on June 4, 2024

Do you mean device<->host uses Pyee but host<->transport uses sink method, and the inconsistency is somehow weird?

from bumble.

paulhamsh avatar paulhamsh commented on June 4, 2024

Yes exactly.
Is there a reason not to be consistent throughout the stack?
It makes it harder to trace through the code.
Also that the flow goes via Device to the Gatt server and not directly through the layers confused me a bit.
So flow from usb to gatt server seems complex to decypher, so I presumed there must be a reason to use different techniques.
The pdf is my attempt to follow the flow through the stack:
https://github.com/paulhamsh/PicoWBLEMidiTest/blob/331bc01f89aaa8e90e6cb288c27a4b7a2d7f2a0a/Bumble%20Overview.pdf

I am thinking using coroutines throughout might be cool.

from bumble.

barbibulle avatar barbibulle commented on June 4, 2024

The reason there are different ways layers call each other is because initially the code base didn't use pyee, that came later. Not everything has been updated to use pyee, so there are still direct calls to on_xxx methods, or sink functions (very lightweight for cases where the emitter holds directly a reference to a function, rather than an object on which it calls one or more methods by name).
For the transport library, it will likely remain this way, as the source/sink model is close to the way asyncio works in general with transports and protocols (ex: data_receveived methods being called), and is quite a bit lighter than the generic multi-listener model of pyee. For other layers, like gatt, it is possible that we'll end up updating to pyee events at some point.

from bumble.

paulhamsh avatar paulhamsh commented on June 4, 2024

Ah - thank you for explaining. That really helps

from bumble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.