Skip to content
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

Additional try/catch for C API #97

Merged
merged 10 commits into from Aug 23, 2016
Merged

Additional try/catch for C API #97

merged 10 commits into from Aug 23, 2016

Conversation

guruofquality
Copy link
Contributor

This PR represents additional try/catch blocks for C API device calls. This causes graceful returns with error message set (vs std::terminate when the uncaught exception throws in C). The API was not properly set up to provide error return codes. We are not introducing any C API changes in this commit. This is a fix commit for 0.5 series; so the following was done for existing calls:

  • All errors thrown set SoapySDRDevice_lastError()
  • API calls that returned points will return NULL on error
  • API calls that return PODs return -1 or NAN (whatever fits)
  • API calls that return void set the error, but there is nothing to show
  • Because error cannot be determined for all return types, a int SoapySDRDevice_lastStatus() is provided to determine the error state of the last device API call.

Related issue: #95

@guruofquality guruofquality merged commit a1d85fb into maint Aug 23, 2016
@guruofquality guruofquality deleted the c_error_work branch August 23, 2016 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant