Skip to content

Add non-blocking write function for USBCDC #7090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2018

Conversation

omdathetkan
Copy link
Contributor

@omdathetkan omdathetkan commented Jun 1, 2018

Description

For certain applications it is desirable to do a non-blocking write when sending larger blocks of data over USBSerial. I am proposing to add a second function to USBCDC to support this. Does anyone have suggestions on how to implement this in the API?

bool USBSerial::writeBlock(uint8_t * buf, uint16_t size) {
    if(size > MAX_PACKET_SIZE_EPBULK) {
        return false;
    }
    if(!send(buf, size)) {
        return false;
    }
    return true;
}

There could be an optional argument bool blocking=true, or a second function writeBlockNB, or make it always non-blocking?

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[x] Feature
[ ] Breaking change

@0xc0170 0xc0170 requested a review from c1728p9 June 4, 2018 10:20
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 4, 2018

@jorisa There's feature usb branch that might address this (@c1728p9 can confirm and review this). This should be the branch https://github.com/ARMmbed/mbed-os/tree/feature-hal-spec-usb-device

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 11, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 11, 2018

Build : SUCCESS

Build number : 2316
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7090/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jun 11, 2018

@cmonr
Copy link
Contributor

cmonr commented Jun 12, 2018

/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jun 12, 2018

@cmonr
Copy link
Contributor

cmonr commented Jun 12, 2018

Updated comment since this PR feels like it's more of a feature addition than a fix.

Rerunning test since failures appear to be focused around a device that had to be restarted today.
/morph test

@cmonr
Copy link
Contributor

cmonr commented Jun 12, 2018

/morph mbed2-build

@cmonr
Copy link
Contributor

cmonr commented Jun 12, 2018

We're looking into some CI issues at the moment. The test will be restarted when the dust has settled.

@mbed-ci
Copy link

mbed-ci commented Jun 12, 2018

@cmonr
Copy link
Contributor

cmonr commented Jun 13, 2018

Re-queued since failure was due to a newly discovered htrun bug.

/morph test

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2018

@cmonr cmonr merged commit baf5637 into ARMmbed:master Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants