/*---------------------------------------------------------------------------* Project: Horizon File: uds_Result.h Copyright (C) 2009-2011 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 56250 $ *---------------------------------------------------------------------------*/ #ifndef NN_UDS_CAFE_UDS_RESULT_H_ #define NN_UDS_CAFE_UDS_RESULT_H_ #include /*! @file @brief UDS library result values. */ namespace nn { namespace uds { namespace Cafe { //New definitions. /*! @ingroup nn_uds @defgroup nn_uds_result Local Communication (UDS) Results @brief A list of Results used in the Local Communication (UDS) library. @{ */ /*! @private @brief Result code details. */ enum Description { DESCRIPTION_NETWORK_IS_FULL = 1, //!< Could not connect because the maximum number of stations that can connect to the network has been reached. // DESCRIPTION_WIFI_OFF = 2, // Failed because the system is in wireless off mode. DESCRIPTION_INVALID_PARAMS = 3, //!< A parameter error other than @ref nn::uds::Cafe::ResultOutOfRange, @ref nn::uds::Cafe::ResultTooLarge, or @ref ResultNotAuthorized. // DESCRIPTION_MISCELLANOUS_SYSTEM_ERROR= 4, // The function failed because of a system error. It may succeed if called again. DESCRIPTION_MALFORMED_DATA = 5, //!< Detected the possibility of tampering. DESCRIPTION_INVALID_SDK_VERSION = 6, // Non-public error: the UDS SDK version is invalid. DESCRIPTION_SYSTEM_ERROR = 7, //!< The function failed because of a system error. DESCRIPTION_UNKNOWN = 8, // Unknown error. DESCRIPTION_PENDING = 9, // The process is put on hold. DESCRIPTION_NO_ACCOUNT = 10, // The current account is not set. DESCRIPTION_MAX }; #ifdef NN_UDS_SUPPORT_CLIENT /*! @class nn::uds::Cafe::ResultNotFoundNetwork Indicates that the network to which a connection was attempted using ConnectNetwork was not found. */ NN_DEFINE_RESULT_CONST( ResultNotFoundNetwork, Result::LEVEL_STATUS, Result::SUMMARY_NOT_FOUND, Result::MODULE_NN_UDS, Result::DESCRIPTION_NOT_FOUND ); /*! @class nn::uds::Cafe::ResultAlreadyNetworkIsFull @brief Indicates that the network to which a connection was attempted using ConnectNetwork is full. (The number of devices connected to that network has already reached the maximum.) */ NN_DEFINE_RESULT_CONST( ResultAlreadyNetworkIsFull, Result::LEVEL_STATUS, Result::SUMMARY_OUT_OF_RESOURCE, Result::MODULE_NN_UDS, DESCRIPTION_NETWORK_IS_FULL ); /*! @class nn::uds::Cafe::ResultDeniedFromMaster @brief Indicates that the attempt to connect to the network using @ref ConnectNetwork was denied by the host. If the host application is not intentionally prohibiting connection, this error may also occur when the connection cannot be made because of poor signal quality. */ NN_DEFINE_RESULT_CONST( ResultDeniedFromMaster, Result::LEVEL_STATUS, Result::SUMMARY_CANCELLED, Result::MODULE_NN_UDS, Result::DESCRIPTION_CANCEL_REQUESTED ); /*! @class nn::uds::Cafe::ResultConnectionTimeout @brief The connection to the network using the @ref ConnectNetwork function timed out. */ NN_DEFINE_RESULT_CONST( ResultConnectionTimeout, Result::LEVEL_STATUS, Result::SUMMARY_CANCELLED, Result::MODULE_NN_UDS, Result::DESCRIPTION_TIMEOUT ); #endif /*! @class nn::uds::Cafe::ResultAlreadyNetworkIsFull @brief Indicates that the network has already reached the maximum number of connected devices. */ NN_DEFINE_RESULT_CONST( ResultAlreadyNetworkIsFull, Result::LEVEL_STATUS, Result::SUMMARY_OUT_OF_RESOURCE, Result::MODULE_NN_UDS, DESCRIPTION_NETWORK_IS_FULL ); /*! @class nn::uds::Cafe::ResultInvalidState @brief Indicates that the function cannot run in the current library state. This result can also occur if the connection is lost during communication. */ NN_DEFINE_RESULT_CONST( ResultInvalidState, Result::LEVEL_STATUS, Result::SUMMARY_INVALID_STATE, Result::MODULE_NN_UDS, Result::DESCRIPTION_NOT_AUTHORIZED ); /*! @class nn::uds::Cafe::ResultInvalidNode @brief Indicates that the node with the specified node ID does not exist on the network. This result can also occur when the node attempts to send a packet to itself, or when the connection target disconnects from the network. */ NN_DEFINE_RESULT_CONST( ResultInvalidNode, Result::LEVEL_STATUS, Result::SUMMARY_WRONG_ARGUMENT, Result::MODULE_NN_UDS, Result::DESCRIPTION_NOT_FOUND ); /*! @class nn::uds::Cafe::ResultOutOfResource @brief Indicates that the library is out of resources. This result is returned when the size of the receive buffer specified using the @ref Attach function exceeds that of the buffer specified when @ref Initialize was called. */ NN_DEFINE_RESULT_CONST( ResultOutOfResource, Result::LEVEL_STATUS, Result::SUMMARY_OUT_OF_RESOURCE, Result::MODULE_NN_UDS, Result::DESCRIPTION_OUT_OF_MEMORY ); /*! @class nn::uds::Cafe::ResultBufferIsFull @brief This mostly occurs if @ref SendTo is called with high frequency, and send operations get backed up. The data being sent is lost if an error occurs. */ NN_DEFINE_RESULT_CONST( ResultBufferIsFull, Result::LEVEL_STATUS, Result::SUMMARY_OUT_OF_RESOURCE, Result::MODULE_NN_UDS, Result::DESCRIPTION_BUSY ); #if 0 /*! @class nn::uds::Cafe::ResultWirelessOff @brief Indicates that the system entered wireless-disabled mode after the UDS library was initialized. After the system enters wireless-disabled mode and until @ref Finalize is called, the UDS library interprets the wireless state as disabled even if the system subsequently enters wireless-enabled mode. To use UDS communication again, you must rerun the @ref Initialize function in wireless-enabled mode. */ NN_DEFINE_RESULT_CONST( ResultWirelessOff, Result::LEVEL_STATUS, Result::SUMMARY_STATUS_CHANGED, Result::MODULE_NN_UDS, DESCRIPTION_WIFI_OFF ); #endif /*! @class nn::uds::Cafe::ResultBusy @brief Indicates that the process is busy. */ NN_DEFINE_RESULT_CONST( ResultBusy, Result::LEVEL_STATUS, Result::SUMMARY_NOTHING_HAPPENED, Result::MODULE_NN_UDS, Result::DESCRIPTION_BUSY ); /*! @class nn::uds::Cafe::ResultNotInitialized @brief Indicates that the library has not been initialized. This error can be resolved by calling the @ref Initialize function. */ NN_DEFINE_RESULT_CONST( ResultNotInitialized, Result::LEVEL_USAGE, Result::SUMMARY_INVALID_STATE, Result::MODULE_NN_UDS, Result::DESCRIPTION_NOT_INITIALIZED ); /*! @class nn::uds::Cafe::ResultAlreadyOccupiedWirelessDevice @brief UDS communication cannot be used at the moment because other communication is already in progress. */ NN_DEFINE_RESULT_CONST( ResultAlreadyOccupiedWirelessDevice, Result::LEVEL_USAGE, Result::SUMMARY_OUT_OF_RESOURCE, Result::MODULE_NN_UDS, Result::DESCRIPTION_ALREADY_INITIALIZED ); /*! @class nn::uds::Cafe::ResultOutOfRange @brief Indicates that one or more of the arguments were set to values outside their valid ranges. */ NN_DEFINE_RESULT_CONST( ResultOutOfRange, Result::LEVEL_USAGE, Result::SUMMARY_WRONG_ARGUMENT, Result::MODULE_NN_UDS, Result::DESCRIPTION_OUT_OF_RANGE ); /*! @class nn::uds::Cafe::ResultMisalignedAddress @brief Indicates that the address alignment is invalid. */ NN_DEFINE_RESULT_CONST( ResultMisalignedAddress, Result::LEVEL_USAGE, Result::SUMMARY_WRONG_ARGUMENT, Result::MODULE_NN_UDS, Result::DESCRIPTION_MISALIGNED_ADDRESS ); /*! @class nn::uds::Cafe::ResultMisalignedSize @brief Indicates that the size alignment is invalid. */ NN_DEFINE_RESULT_CONST( ResultMisalignedSize, Result::LEVEL_USAGE, Result::SUMMARY_WRONG_ARGUMENT, Result::MODULE_NN_UDS, Result::DESCRIPTION_MISALIGNED_SIZE ); /*! @class nn::uds::Cafe::ResultTooLarge @brief Indicates that one or more of the arguments had data that exceeded the maximum size. This error occurs for functions that send data. */ NN_DEFINE_RESULT_CONST( ResultTooLarge, Result::LEVEL_USAGE, Result::SUMMARY_WRONG_ARGUMENT, Result::MODULE_NN_UDS, Result::DESCRIPTION_TOO_LARGE ); /*! @class nn::uds::Cafe::ResultNotAuthorized @brief Indicates that one or more of the arguments contain a value that is permitted only in special cases. */ NN_DEFINE_RESULT_CONST( ResultNotAuthorized, Result::LEVEL_USAGE, Result::SUMMARY_WRONG_ARGUMENT, Result::MODULE_NN_UDS, Result::DESCRIPTION_NOT_AUTHORIZED ); #if 0 /*! @class nn::uds::Cafe::ResultMiscellaneousSystemError @brief A temporary failure resulting from something on the system side. Normally, if you retry with the same arguments, the function succeeds. */ NN_DEFINE_RESULT_CONST( ResultMiscellaneousSystemError, Result::LEVEL_TEMPORARY, Result::SUMMARY_INTERNAL, Result::MODULE_NN_UDS, DESCRIPTION_MISCELLANOUS_SYSTEM_ERROR ); #endif /*! @class nn::uds::Cafe::ResultNotImplemented @brief The function is defined but not implemented. */ NN_DEFINE_RESULT_CONST( ResultNotImplemented, Result::LEVEL_STATUS, Result::SUMMARY_NOT_SUPPORTED, Result::MODULE_NN_UDS, Result::DESCRIPTION_NOT_IMPLEMENTED ); /*! @class nn::uds::Cafe::ResultMalformedData @brief Indicates that the data is not correct, and that the received data may have been tampered with. */ NN_DEFINE_RESULT_CONST( ResultMalformedData, Result::LEVEL_USAGE, Result::SUMMARY_CANCELLED, Result::MODULE_NN_UDS, DESCRIPTION_MALFORMED_DATA ); /*! @class nn::uds::Cafe::ResultInvalidPointer @brief Indicates that an invalid pointer was passed as a parameter. */ NN_DEFINE_RESULT_CONST( ResultInvalidPointer, Result::LEVEL_USAGE, Result::SUMMARY_INVALID_ARGUMENT, Result::MODULE_NN_UDS, Result::DESCRIPTION_INVALID_POINTER ); #if 0 /*! :private @class nn::dlp::Cafe::ResultRequestCanceled @brief Request canceled. */ NN_DEFINE_RESULT_CONST( ResultRequestCanceled, Result::LEVEL_STATUS, Result::SUMMARY_INVALID_STATE , Result::MODULE_NN_UDS, Result::DESCRIPTION_CANCEL_REQUESTED ); #endif /*! @class nn::uds::Cafe::ResultNotFound @brief Not found. */ NN_DEFINE_RESULT_CONST( ResultNotFound, Result::LEVEL_TEMPORARY, Result::SUMMARY_NOT_FOUND, Result::MODULE_NN_UDS, Result::DESCRIPTION_NOT_FOUND ); /****************************** Errors used only by the system. ******************************/ NN_DEFINE_RESULT_CONST( ResultInvalildSdkVersion, Result::LEVEL_FATAL, Result::SUMMARY_NOT_SUPPORTED, Result::MODULE_NN_UDS, DESCRIPTION_INVALID_SDK_VERSION ); NN_DEFINE_RESULT_CONST( ResultSystemError, Result::LEVEL_FATAL, Result::SUMMARY_INTERNAL, Result::MODULE_NN_UDS, DESCRIPTION_SYSTEM_ERROR ); NN_DEFINE_RESULT_CONST( ResultNoAccount, Result::LEVEL_FATAL, Result::SUMMARY_NOT_FOUND, Result::MODULE_NN_UDS, DESCRIPTION_NO_ACCOUNT ); NN_DEFINE_RESULT_CONST( ResultRequestPending, Result::LEVEL_INFO, Result::SUMMARY_SUCCESS, Result::MODULE_NN_UDS, DESCRIPTION_PENDING ); NN_DEFINE_RESULT_CONST( ResultUnknown, Result::LEVEL_PERMANENT, Result::SUMMARY_NOT_SUPPORTED, Result::MODULE_NN_UDS, DESCRIPTION_UNKNOWN ); NN_DEFINE_RESULT_CONST( ResultAlreadyNetworkIsFull, Result::LEVEL_STATUS, Result::SUMMARY_OUT_OF_RESOURCE, Result::MODULE_NN_UDS, DESCRIPTION_NETWORK_IS_FULL ); /*! @} */ } // namespace Cafe } // namespace uds } // namespace nn #endif //NN_UDS_CAFE_UDS_RESULT_H_