Skip to content

USB API Tweaks#7

Merged
dmadison merged 5 commits intomasterfrom
api-tweaks
Feb 20, 2019
Merged

USB API Tweaks#7
dmadison merged 5 commits intomasterfrom
api-tweaks

Conversation

@dmadison
Copy link
Copy Markdown
Owner

Making some small changes to how the USB API works:

  • Return types for send/receive are now once again int. If there's an error on the USB side these will return '-1'. This makes more sense than just returning '0' which could indicate an error or just a wait condition.
  • Removes the USB timeout variable. This is a lower level USB feature and should be handled by the USB code itself (board-specific).
  • Send array size in send/receive USB API. This is more idiomatic than having the API functions assume the size of the array.
  • Only process the receive data parsing if the received packet is of sufficient size.

This should be handled by the board implementation.
Better to pass this rather than just assume the data size
In case there's an error in the API recv function this will keep the library data valid and avoid the callback.
@dmadison dmadison merged commit 1b61dad into master Feb 20, 2019
@dmadison dmadison deleted the api-tweaks branch February 20, 2019 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant