diff options
author | Bertrand SIMONNET <bsimonnet@google.com> | 2016-03-09 10:29:47 -0800 |
---|---|---|
committer | Bertrand SIMONNET <bsimonnet@google.com> | 2016-03-10 09:18:26 -0800 |
commit | e2d5fe09e909fbff34cba9d9c5f5e1464a194030 (patch) | |
tree | ace23a5813b4906bc35462ada41701611ad7dc74 /include | |
parent | 7b331c0a446f1cdd3340d3aca0318531a9d1fe1b (diff) | |
download | peripheralmanager-e2d5fe09e909fbff34cba9d9c5f5e1464a194030.tar.gz |
Use errno instead of a custom error code.
Errno is expressive enough to cover all error cases we can encounter. It
is also standard and more convinient to use.
All errors will be reported across the AIDL interface via service
specific error codes with values from errno.
On success, we allow reporting Status::ok() for convenience which
translates to a service specific error code 0.
Bug: 27477643
Change-Id: Ifa453d9f350cc2e06aea0f6d5c64eb5928404d88
Diffstat (limited to 'include')
-rw-r--r-- | include/peripheralmanager/errors.h | 37 | ||||
-rw-r--r-- | include/peripheralmanager/peripheral_manager_client.h | 1 |
2 files changed, 0 insertions, 38 deletions
diff --git a/include/peripheralmanager/errors.h b/include/peripheralmanager/errors.h deleted file mode 100644 index e57026b..0000000 --- a/include/peripheralmanager/errors.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SYSTEM_PERIPHERALMANAGER_ERRORS_H_ -#define SYSTEM_PERIPHERALMANAGER_ERRORS_H_ - -#include <sys/cdefs.h> - -/// @defgroup Errors Peripheral IO Errors -/// @brief Error Codes -/// @{ - -/// Peripherial IO common error codes -enum peripheral_error_t { - PERIPHERAL_IO_OK, /**< Ok */ - PERIPHERAL_IO_UNKNOWN_DEVICE, /**< Unknown device */ - PERIPHERAL_IO_DEVICE_IN_USE, /**< Device in use */ - PERIPHERAL_IO_FUNCTION_NOT_IMPLEMENTED, /**< Function not supported on device. */ - PERIPHERAL_IO_UNKNOWN_ERROR, /**< Generic error */ -}; - -/// @} - -#endif // SYSTEM_PERIPHERALMANAGER_ERRORS_H_ diff --git a/include/peripheralmanager/peripheral_manager_client.h b/include/peripheralmanager/peripheral_manager_client.h index bdfce86..a424ddb 100644 --- a/include/peripheralmanager/peripheral_manager_client.h +++ b/include/peripheralmanager/peripheral_manager_client.h @@ -19,7 +19,6 @@ #include <sys/cdefs.h> -#include "peripheralmanager/errors.h" #include "peripheralmanager/gpio.h" #include "peripheralmanager/spi_device.h" |