git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@4 7061adef-622a-194b-ae81-725974e89856

This commit is contained in:
miya 2008-10-16 02:27:37 +00:00
parent 0f1cfa409b
commit 2cec551e54
5 changed files with 152 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#include <twl.h>
#include <twl/sea.h>
#include <twl/na.h>
#include <TwlWiFi/nuc.h>
// #include <TwlWiFi/nuc.h>
#include "netconnect.h"
#include "sitedefs.h"

View File

@ -7,6 +7,152 @@ extern "C" {
void nuc_main(void);
// Network Update Client API
#include <twl/types.h>
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
#define NUC_MAX_TITLE_UPDATE_COUNT 128
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
typedef OSTitleId NUCTitleId;
typedef void* (*NUCAlloc)(u32 size, int align);
typedef void (*NUCFree)(void* ptr);
typedef enum{
NUC_STATUS_NOT_DONE, // 処理実行中
NUC_STATUS_COMPLETED,// 処理完了
NUC_STATUS_ERROR // 処理エラー
} NucStatus;
typedef enum{
NUC_ERROR_NO_SPACE, // TWL本体保存メモリの空き容量が不足しています。
NUC_ERROR_CONNECT, // サーバーに接続できません。
NUC_ERROR_INTERNET, // インターネットのエラーにより、TWL本体の更新ができません。
NUC_ERROR_UPDATE // エラーが発生しましたため、TWL本体の更新ができません。
} NucError;
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
Name: NUC_LoadCert
Description: WRAMにロードします
NA_LoadVersionDataArchive()
NA_UnloadVersionDataArchive()
Arguments:
Returns: TRUE
*---------------------------------------------------------------------------*/
BOOL NUC_LoadCert(void);
/*---------------------------------------------------------------------------*
Name: NUC_Init
Description: NUC
Arguments: allocFunc:
freeFunc:
Returns: TRUE
*---------------------------------------------------------------------------*/
BOOL NUC_Init(NUCAlloc allocFunc, NUCFree freeFunc);
/*---------------------------------------------------------------------------*
Name: NUC_CheckAsync
Description: titleIDの取得
Arguments: titleIds: titleIdを取得するバッファ
nTitleIds: titleIdの数を取得するポインタ
Returns: TRUE
*---------------------------------------------------------------------------*/
BOOL NUC_CheckAsync(NUCTitleId *titleIds, u32 *nTitleIds);
/*---------------------------------------------------------------------------*
Name: NUC_DownloadAsync
Description: titleIDの更新のダウンロード
NULLの場合は全てダウンロードします
FS関数を呼ぶことはできなくなります
Arguments: titleIds: titleIDの入ったポインタ
nTitleIds: titleIDの個数
Returns: TRUE
*---------------------------------------------------------------------------*/
BOOL NUC_DownloadAsync(NUCTitleId *titleIds, u32 nTitleIds);
/*---------------------------------------------------------------------------*
Name: NUC_GetProgress
Description:
Arguments: pCurrentSize:
pTotalSize:
pStatus:
Returns:
*---------------------------------------------------------------------------*/
void NUC_GetProgress(u64* pCurrentSize, u64* pTotalSize, NucStatus* pStatus);
/*---------------------------------------------------------------------------*
Name: NUC_Cleanup
Description: NAMNHTTPNSSLNUPESの終了処理をします
Arguments: titleIds: titleIdの配列
nTitleIds: titleIdの数
Returns: TRUE
*---------------------------------------------------------------------------*/
BOOL NUC_Cleanup(const NUCTitleId *titleIds, u32 nTitleIds);
/*---------------------------------------------------------------------------*
Name: NUC_GetLastError
Description:
Arguments:
Returns:
*---------------------------------------------------------------------------*/
int NUC_GetLastError(void);
/*---------------------------------------------------------------------------*
Name: NUC_GetErrorType
Description:
Arguments: error_code:
Returns:
*---------------------------------------------------------------------------*/
NucError NUC_GetErrorType(int error_code);
/*---------------------------------------------------------------------------*
Name: NUC_IsResetNeeded
Description:
Arguments:
Returns:
*---------------------------------------------------------------------------*/
BOOL NUC_IsResetNeeded(void);
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@ -16,7 +16,8 @@
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <TwlWiFi/nuc.h>
//#include <TwlWiFi/nuc.h>
#include "nuc.h"
#include "nuc_error_msg.h"
/*---------------------------------------------------------------------------*

View File

@ -39,7 +39,7 @@ ES_ROOT = $(ES_LATEST)
LINCLUDES = $(TWLSDK_ROOT)/build/libraries/lcfg/ARM9.TWL/include ../common/src \
$(ES_ROOT)/twl/include $(ES_ROOT)/common/lib/ec/include
LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE)
LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE) ../wifilib
LLIBRARIES += libecx$(TWL_LIBSUFFIX).a \

View File

@ -39,13 +39,13 @@ ES_ROOT = $(ES_LATEST)
LINCLUDES = $(TWLSDK_ROOT)/build/libraries/lcfg/ARM9.TWL/include ../common/src \
$(ES_ROOT)/twl/include $(ES_ROOT)/common/lib/ec/include
LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE)
LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE) ../wifilib
LLIBRARIES += libecx$(TWL_LIBSUFFIX).a \
liblcfg$(TWL_LIBSUFFIX).a \
libnhttp.nssl$(TWL_LIBSUFFIX).a \
libshr$(TWL_LIBSUFFIX).a \
libnhttp.nssl$(TWL_LIBSUFFIX).a \
libnuc$(TWL_LIBSUFFIX).a \
libnup$(TWL_LIBSUFFIX).a \
libnam$(TWL_LIBSUFFIX).a \