libctru  v1.6.0
Data Structures | Enumerations | Functions
boss.h File Reference

BOSS service, see also: https://www.3dbrew.org/wiki/BOSS_Services. More...

Go to the source code of this file.

Data Structures

struct  bossContext
 BOSS context. More...
 

Enumerations

enum  bossTaskStatus {
  BOSSTASKSTATUS_STARTED = 0x2,
  BOSSTASKSTATUS_ERROR = 0x7
}
 BOSS task status.
 
enum  bossNsDataHeaderInfoTypes { bossNsDataHeaderInfoType_ContentSize = 0x3 }
 Type values for bossGetNsDataHeaderInfo().
 
enum  bossNsDataHeaderInfoTypeSizes { bossNsDataHeaderInfoTypeSize_ContentSize = 0x4 }
 Size of the output data for bossGetNsDataHeaderInfo().
 

Functions

Result bossInit (u64 programID, bool force_user)
 Initializes BOSS. More...
 
Result bossReinit (u64 programID)
 Run the InitializeSession service cmd. More...
 
void bossExit (void)
 Exits BOSS.
 
Handle bossGetSessionHandle (void)
 Returns the BOSS session handle.
 
Result bossSetStorageInfo (u64 extdataID, u32 boss_size, u8 mediaType)
 Set the content data storage location. More...
 
Result bossUnregisterStorage (void)
 Unregister the content data storage location, which includes unregistering the BOSS-session programID with BOSS.
 
Result bossRegisterTask (const char *taskID, u8 unk0, u8 unk1)
 Register a task. More...
 
Result bossSendProperty (u16 PropertyID, const void *buf, u32 size)
 Send a property. More...
 
Result bossDeleteNsData (u32 NsDataId)
 Deletes the content file for the specified NsDataId. More...
 
Result bossGetNsDataHeaderInfo (u32 NsDataId, u8 type, void *buffer, u32 size)
 Gets header info for the specified NsDataId. More...
 
Result bossReadNsData (u32 NsDataId, u64 offset, void *buffer, u32 size, u32 *transfer_total, u32 *unk_out)
 Reads data from the content for the specified NsDataId. More...
 
Result bossStartTaskImmediate (const char *taskID)
 Starts a task soon after running this command. More...
 
Result bossStartBgImmediate (const char *taskID)
 Similar to bossStartTaskImmediate? More...
 
Result bossDeleteTask (const char *taskID, u32 unk)
 Deletes a task by using CancelTask and UnregisterTask internally. More...
 
Result bossGetTaskState (const char *taskID, s8 inval, u8 *status, u32 *out1, u8 *out2)
 Returns task state. More...
 
Result bossGetTaskProperty0 (const char *taskID, u8 *out)
 This loads the current state of PropertyID 0x0 for the specified task. More...
 
void bossSetupContextDefault (bossContext *ctx, u32 seconds_interval, const char *url)
 Setup a BOSS context with the default config. More...
 
Result bossSendContextConfig (bossContext *ctx)
 Sends the config stored in the context. More...
 

Detailed Description

BOSS service, see also: https://www.3dbrew.org/wiki/BOSS_Services.

Function Documentation

◆ bossDeleteNsData()

Result bossDeleteNsData ( u32  NsDataId)

Deletes the content file for the specified NsDataId.

Parameters
NsDataIdNsDataId
Examples
network/boss/source/main.c.

◆ bossDeleteTask()

Result bossDeleteTask ( const char *  taskID,
u32  unk 
)

Deletes a task by using CancelTask and UnregisterTask internally.

Parameters
taskIDBOSS taskID.
unkUnknown, usually zero?
Examples
network/boss/source/main.c.

◆ bossGetNsDataHeaderInfo()

Result bossGetNsDataHeaderInfo ( u32  NsDataId,
u8  type,
void *  buffer,
u32  size 
)

Gets header info for the specified NsDataId.

Parameters
NsDataIdNsDataId
typeType of data to load.
bufferOutput buffer.
sizeOutput buffer size.
Examples
network/boss/source/main.c.

◆ bossGetTaskProperty0()

Result bossGetTaskProperty0 ( const char *  taskID,
u8 out 
)

This loads the current state of PropertyID 0x0 for the specified task.

Parameters
taskIDBOSS taskID.

◆ bossGetTaskState()

Result bossGetTaskState ( const char *  taskID,
s8  inval,
u8 status,
u32 out1,
u8 out2 
)

Returns task state.

Parameters
taskIDBOSS taskID.
invalUnknown, normally 0?
statusOutput status, see bossTaskStatus.
out1Output field.
out2Output field.
Examples
network/boss/source/main.c.

◆ bossInit()

Result bossInit ( u64  programID,
bool  force_user 
)

Initializes BOSS.

Parameters
programIDprogramID to use, 0 for the current process. Only used when BOSSP is available without *hax payload.
force_userWhen true, just use bossU instead of trying to initialize with bossP first.
Examples
network/boss/source/main.c.

◆ bossReadNsData()

Result bossReadNsData ( u32  NsDataId,
u64  offset,
void *  buffer,
u32  size,
u32 transfer_total,
u32 unk_out 
)

Reads data from the content for the specified NsDataId.

Parameters
NsDataIdNsDataId
offsetOffset in the content.
bufferOutput buffer.
sizeOutput buffer size.
transfer_totalOptional output actual read size, can be NULL.
unk_outOptional unknown output, can be NULL.
Examples
network/boss/source/main.c.

◆ bossRegisterTask()

Result bossRegisterTask ( const char *  taskID,
u8  unk0,
u8  unk1 
)

Register a task.

Parameters
taskIDBOSS taskID.
unk0Unknown, usually zero.
unk1Unknown, usually zero.
Examples
network/boss/source/main.c.

◆ bossReinit()

Result bossReinit ( u64  programID)

Run the InitializeSession service cmd.

This is mainly for changing the programID associated with the current BOSS session.

Parameters
programIDprogramID to use, 0 for the current process.

◆ bossSendContextConfig()

Result bossSendContextConfig ( bossContext ctx)

Sends the config stored in the context.

Used before registering a task.

Parameters
bossContextBOSS context.
Examples
network/boss/source/main.c.

◆ bossSendProperty()

Result bossSendProperty ( u16  PropertyID,
const void *  buf,
u32  size 
)

Send a property.

Parameters
PropertyIDPropertyID
bufInput buffer data.
sizeBuffer size.

◆ bossSetStorageInfo()

Result bossSetStorageInfo ( u64  extdataID,
u32  boss_size,
u8  mediaType 
)

Set the content data storage location.

Parameters
extdataIDu64 extdataID, must have the high word set to the shared-extdata value when it's for NAND.
boss_sizeProbably the max size in the extdata which BOSS can use.
mediaTypeRoughly the same as FS mediatype.

◆ bossSetupContextDefault()

void bossSetupContextDefault ( bossContext ctx,
u32  seconds_interval,
const char *  url 
)

Setup a BOSS context with the default config.

Parameters
bossContextBOSS context.
seconds_intervalInterval in seconds for running the task automatically.
urlTask URL.
Examples
network/boss/source/main.c.

◆ bossStartBgImmediate()

Result bossStartBgImmediate ( const char *  taskID)

Similar to bossStartTaskImmediate?

Parameters
taskIDBOSS taskID.

◆ bossStartTaskImmediate()

Result bossStartTaskImmediate ( const char *  taskID)

Starts a task soon after running this command.

Parameters
taskIDBOSS taskID.
Examples
network/boss/source/main.c.