Skip to content

Hybrid client code for connections to different MIDI devices possible? #43

Answered by MicroMidi
MicroMidi asked this question in Q&A
Discussion options

You must be logged in to vote

... "learn something new every day" - this is what I've been told by @lathoub some weeks ago - and actually I spent hours for a task that could be implemented within a minute. But finally I made it as I understood, that "BLEMIDI_Transport.h" just implements the callback declaration without code and "BLEMIDI_Client_ESP32.h" the callback implementation.
So in the end this turned out as a very trivial change:

  • Add a new callback declaration in "BLEMIDI_Transport.h":
// callbacks
    void (*_connectedCallbackDeviceName)(char *) = nullptr;
  • ... and assign the function pointer to this callback with (char *)-parameter
    BLEMIDI_Transport &setHandleConnected(void (*fptr)(char*))
    {
      …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@MicroMidi
Comment options

Comment options

You must be logged in to vote
2 replies
@MicroMidi
Comment options

@MicroMidi
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MicroMidi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #42 on December 20, 2021 08:51.