Virgil IoT KIT
|
Status codes and macroses. More...
#include <virgil/iot/macros/macros.h>
Go to the source code of this file.
Macros | |
#define | STATUS_CHECK(OPERATION, MESSAGE, ...) CHECK(VS_CODE_OK == (OPERATION), (MESSAGE), ##__VA_ARGS__) |
Status code check and perform goto terminate if non-successful. More... | |
#define | STATUS_CHECK_RET(OPERATION, MESSAGE, ...) CHECK_RET(VS_CODE_OK == (ret_code = (OPERATION)), ret_code, (MESSAGE), ##__VA_ARGS__) |
Status code check and return vs_status_e if non-successful. More... | |
#define | STATUS_CHECK_RET_BOOL(OPERATION, MESSAGE, ...) BOOL_CHECK_RET(VS_CODE_OK == (OPERATION), (MESSAGE), ##__VA_ARGS__) |
Status code check and return bool if non-successful. More... | |
Status codes and macroses.
This file declares vs_status_e status codes. There are also macros to simplify return code checks :
You can introduce your own error codes. They must start from VS_CODE_ERR_USER code.
#define STATUS_CHECK | ( | OPERATION, | |
MESSAGE, | |||
... | |||
) | CHECK(VS_CODE_OK == (OPERATION), (MESSAGE), ##__VA_ARGS__) |
Status code check and perform goto terminate if non-successful.
[in] | OPERATION | Operation to be checked. |
[in] | MESSAGE | String with printf-like parameter to be logged in case of non-successful operation. |
#define STATUS_CHECK_RET | ( | OPERATION, | |
MESSAGE, | |||
... | |||
) | CHECK_RET(VS_CODE_OK == (ret_code = (OPERATION)), ret_code, (MESSAGE), ##__VA_ARGS__) |
Status code check and return vs_status_e if non-successful.
[in] | OPERATION | Operation to be checked. |
[in] | MESSAGE | String with printf-like parameter to be logged in case of non-successful operation. |
#define STATUS_CHECK_RET_BOOL | ( | OPERATION, | |
MESSAGE, | |||
... | |||
) | BOOL_CHECK_RET(VS_CODE_OK == (OPERATION), (MESSAGE), ##__VA_ARGS__) |
Status code check and return bool if non-successful.
[in] | OPERATION | Operation to be checked. |
[in] | MESSAGE | String with printf-like parameter to be logged in case of non-successful operation. |
enum vs_status_e |
Status code.
Zero value VS_CODE_OK is used for non-error values. Negative values mean error
Enumerator | |
---|---|
VS_CODE_COMMAND_NO_RESPONSE | No need in response. |
VS_CODE_OLD_VERSION | Provided file is not newer than the current file. |
VS_CODE_OK | Successful operation. |
VS_CODE_ERR_NULLPTR_ARGUMENT | Argument is NULL pointer while it must be not NULL. |
VS_CODE_ERR_ZERO_ARGUMENT | Argument is zero while it must be not zero. |
VS_CODE_ERR_INCORRECT_ARGUMENT | Incorrect argument. |
VS_CODE_ERR_INCORRECT_PARAMETER | Incorrect parameter. |
VS_CODE_ERR_UNSUPPORTED_PARAMETER | Unsupported parameter. |
VS_CODE_ERR_AMBIGUOUS_INIT_CALL | Ambiguous initialization call. |
VS_CODE_ERR_CTX_NOT_READY | Context is not ready. |
VS_CODE_ERR_NOT_IMPLEMENTED | This feature is not implemented. |
VS_CODE_ERR_NOT_FOUND | Entity has not been found. |
VS_CODE_ERR_NO_CALLBACK | There is no callback. |
VS_CODE_ERR_UNREGISTERED_MAPPING_TYPE | Unsupported mapping type. |
VS_CODE_ERR_INCORRECT_SEND_REQUEST | Incorrect send request. |
VS_CODE_ERR_NO_MEMORY | No memory. |
VS_CODE_ERR_TOO_SMALL_BUFFER | Buffer is too small. |
VS_CODE_ERR_FORMAT_OVERFLOW | Incorrect data format. |
VS_CODE_ERR_VERIFY | Incorrect result of verification. |
VS_CODE_ERR_UNSUPPORTED | Unsupported crypto data. |
VS_CODE_ERR_CRYPTO | Error during crypto operation processing. |
VS_CODE_ERR_FILE | Error during file processing. |
VS_CODE_ERR_FILE_READ | Error during file read. |
VS_CODE_ERR_FILE_WRITE | Error during file write. |
VS_CODE_ERR_FILE_DELETE | Error during file delete. |
VS_CODE_ERR_CLOUD | Error during operation with cloud. |
VS_CODE_ERR_JSON | Error during JSON processing. |
VS_CODE_ERR_REQUEST_PREPARE | Error during request preparation. |
VS_CODE_ERR_REQUEST_SEND | Error during request send. |
VS_CODE_ERR_PRVS_UNKNOWN | Provision error. |
VS_CODE_ERR_SNAP_UNKNOWN | SNAP error. |
VS_CODE_ERR_SNAP_NOT_MY_PACKET | SNAP error "not my packet". |
VS_CODE_ERR_SNAP_TOO_MUCH_SERVICES | Too much services to be registered by SNAP. |
VS_CODE_ERR_THREAD | Error during thread processing. |
VS_CODE_ERR_NO_SIMULATOR | No simulator has been found. |
VS_CODE_ERR_SOCKET | Error during socket operations. |
VS_CODE_ERR_PLC | PLC error. |
VS_CODE_ERR_NOINIT | Not initialized. |
VS_CODE_ERR_INIT_SNAP | Error while vs_netif_t . init call |
VS_CODE_ERR_DEINIT_SNAP | Error while vs_netif_t . deinit call |
VS_CODE_ERR_TX_SNAP | Error while vs_netif_t . tx call |
VS_CODE_ERR_MAC_SNAP | Error while vs_netif_t . mac call |
VS_CODE_ERR_POLLING_INFO_CLIENT | Error while starting polling. |
VS_CODE_ERR_USER | User specific error codes start with this value. |