Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29

Thread: Blink(1)

  1. #21
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    No they are different functions. I've added some debug output to both. Please give them a whirl with debug view running.
    Attached Files Attached Files
    Ron
    No support through PM

  2. #22
    Join Date
    Dec 2004
    Posts
    103

    Default

    I get the following traces:

    Code:
    [37844] HIDDEBUG: hid_send_feature_report exit 1 last error 87 length=8 
    [37844] HIDDEBUG: write exit 1 last error 1 length=8
    First error seems related to the way the hid_send_feature_report is done, some invalid parameter
    My code is just trying to do the lua equivalent of this C function:

    Code:
    int blink1_fadeToRGB(blink1_device *dev,  uint16_t fadeMillis,
                         uint8_t r, uint8_t g, uint8_t b)
    {
        int dms = fadeMillis/10;  // millis_divided_by_10
    
    
        uint8_t buf[9];
    
    
        buf[0] = blink1_report_id;     // report id
        buf[1] = 'c';   // command code for 'fade to rgb'
        buf[2] = ((blink1_enable_degamma) ? blink1_degamma(r) : r );
        buf[3] = ((blink1_enable_degamma) ? blink1_degamma(g) : g );
        buf[4] = ((blink1_enable_degamma) ? blink1_degamma(b) : b );
        buf[5] = (dms >> 8);
        buf[6] = dms % 0xff;
        buf[7] = 0;
    
    
        int rc = blink1_write(dev, buf, sizeof(buf) );
    
    
        return rc; 
    }
    where blink1_write is invoking hid_send_feature_report:

    Code:
    int blink1_write( blink1_device* dev, void* buf, int len)
    {
        if( dev==NULL ) {
            return -1; // BLINK1_ERR_NOTOPEN;
        }
        int rc = hid_send_feature_report( dev, buf, len );
        // FIXME: put this in an ifdef?
        if( rc==-1 ) {
            LOG("blink1_write error: %ls\n", hid_error(dev));
        }
        return rc;
    }

  3. #23
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    one thing that stands out is that they are passing length = 9 ( from uint8_t buf[9]; and sizeof(buf) ) yet you are passing 8.... Maybe it requires a report length of 9... odd number, but possible i guess.
    Ron
    No support through PM

  4. #24
    Join Date
    Dec 2004
    Posts
    103

    Default

    Thanks Ron, two mistakes on my side, indeed the report size is 9 and not 8 (dizzy I'm) and the report Id is not 0 but 1. It works far better now.
    Do you think you will be able to provide a quick fix for the enumerate(vid, pid) problem?

  5. #25
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    Excellent!! Yeah I forgot to look at that bug. Let me see...
    Ron
    No support through PM

  6. #26
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    OK with fixed Vid/pid on enumerate and cleaned up error reporting.
    Attached Files Attached Files
    Ron
    No support through PM

  7. #27
    Join Date
    Dec 2004
    Posts
    103

    Default

    Could I get an official plugin id?
    Thanks

  8. #28
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    You get 1026.
    Ron
    No support through PM

  9. #29
    Join Date
    Dec 2004
    Posts
    103

    Default

    Thanks a lot

Page 3 of 3 FirstFirst 123

Posting Permissions

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