/*---------------------------------------------------------------------------* Copyright (C) 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. *---------------------------------------------------------------------------*/ #ifndef NN_BOSS_BOSS_LIB_H_ #define NN_BOSS_BOSS_LIB_H_ #include #include #include #ifdef __cplusplus namespace nn { namespace boss { /*! @addtogroup nn_boss @{ @defgroup nn_boss_api SpotPass (BOSS) API @brief Members of the SpotPass (BOSS) library API. (Includes only C++ API members.) @{ */ /*! @brief Initializes the SpotPass (BOSS) library. You must call this function once before using the BOSS library. @return Returns the result of the function. Returns one of the following Result values. @retval Result::IsSuccess Indicates that initialization succeeded. @retval Other Indicates an unexpected error. (For more information, see @ref nn_boss_result.) */ nn::Result Initialize( void ); /*! @brief Finalizes the SpotPass (BOSS) library. Call this function once when you are finished using the BOSS library. If another BOSS function is being called at the point this function is called, this function blocks until the other call ends. Contemplate this when a blocking BOSS function is being called. If you want to use BOSS again after calling this function, you must call @ref Initialize again. This function does not run finalization on individual tasks and has no effect on tasks registered by the caller. In other words, calling this function does not end or suspend any tasks. */ void Finalize(void); /*! @brief Determines whether the library has been initialized. @return Returns true if it is already initialized and false if it is not yet initialized. */ bool IsInitialized(void); /*! @brief Gets a list of registered task IDs. Gets a list of the registered task IDs for the account in the specified slot that were registered by the calling application. (Set 0 for slotNo to target the account that is logged in at the time of the call.) If a buffer with a size equal to or greater than the number of tasks registered by applications is set for the taskIdList parameter, you can retrieve a list of all registered tasks at one time. If you specify a small buffer for the taskIdList parameter, you can get a partial task ID list by specifying the number of the task from which to start retrieving IDs for the startPos parameter. To get all of the registered task IDs, run the API function multiple times and change the value specified for the startPos parameter. @param[in] slotNo Specifies a slot in the target account. @param[out] taskIdList Specifies a TaskID array for storing a list of task IDs. The number of array elements must match the value of elementCount. @param[in] elementCount Specifies the number of elements in taskIdList. @param[out] getIdCount Stores the obtained number of task IDs. @param[in] startPos Specifies the position, among all task IDs, of the first task ID to get. You can call this function repeatedly, using a taskIdList with a small number of elements, to get all of the task IDs. If omitted, elements are obtained starting with the first task ID in the list. @return Returns the result of the function. Returns one of the following Result values. @retval Result::IsSuccess Indicates successful retrieval. @retval ResultNotCompleted Could not get all of the task IDs. @retval ResultNotExist The specified task ID does not exist. @retval ResultInvalidParameter Invalid argument. @retval ResultLibraryNotInitialized Indicates that the session is not initialized. The function returns this Result if it is called before @ref Initialize is called. Always call the @ref Initialize function before you use the BOSS library. */ nn::Result GetTaskIdList(u8 slotNo, TaskID taskIdList[], u32 elementCount, u32* getIdCount, u32 startPos = 0); /*! @brief Gets the BOSS state. @return Returns the state of BOSS. For the definitions of each value, see the descriptions of the @ref BossState enumerators. */ BossState GetBossState(void); /*! @brief Returns the error code for the execution result of an API function. If a BOSS API function returns a nn::Result type representing an error, you can use this function to convert the result into an error code. This function returns 0 if passed a result representing success (result.IsSuccess() returns true). @param[in] result The nn::Result instance to convert. @return Returns the error code. */ u32 GetErrorCode( nn::Result result ); /*! @deprecated This API function is not supported. Do not use it. */ nn::Result RegisterRootCa(const char* pName, const u8* pCertData, size_t certDataSize, AccountID accountId = 0); /*! @deprecated This API function is not supported. Do not use it. */ nn::Result RegisterClientCert(const char* pCertName, const u8* pCertData, size_t certDataSize, const char* pKeyName, const u8* pPrivateKeyData, size_t privateKeyDataSize, AccountID accountId = 0); /*! @deprecated This API function is outdated. Do not use it. */ nn::Result GetTaskIdList(TaskID taskIdList[], u32 elementCount, u32* getIdCount, AccountID accountId = 0, u32 startPos = 0); /*! @} @} */ } // end of namespace boss } // end of namespace nn #endif // __cplusplus #endif /* NN_BOSS_BOSS_LIB_H_ */