Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: USBHost_t36 callbacks for device connected / disconnected etc?

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    7

    USBHost_t36 callbacks for device connected / disconnected etc?

    Hi!

    I've had a lot of success using USBHost_t36 and using a Teensy 3.6 to copy USB Midi data between devices.

    However, I was wondering if there were any callbacks available from USBHost to let me know when a device had been connected or disconnected? Or if there are other approaches that people are using to do this?

    At the moment I just loop through my list of MIDIDevice and check if any weren't connected which now are and vice versa.

    Thanks!
    T

  2. #2
    Code:
    MIDIDevice midi;
    
    if(midi){
    // midi device connected
    }

  3. #3
    Junior Member
    Join Date
    Sep 2014
    Posts
    7
    Thanks for your reply - that's what I'm currently doing. It doesn't tell you if the device just connected of course, or if there was one that is now disconnected, but I'm handling that in my code anyway.

    I was hoping for something like
    Code:
    USBHost usbHost;
    
    void setup()
    {
      usbHost.setDeviceConnected( myFunctionToHandleThis );
      usbHost.setDeviceDisconnected( myFunctionToHandleThisToo );
    }

  4. #4
    Ok i misunderstood your question, for what i see there's none, the way you are doing it is the right way

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •