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

  NsDataId | NsDataId

Examples
  network/boss/source/main.c.

## bossDeleteTask()

Result bossDeleteTask | ( | const char * | taskID,
|  | u32 | unk
| ) |  |

Deletes a task by using CancelTask and UnregisterTask internally.

Parameters

  taskID | BOSS taskID.
  unk | Unknown, 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

  NsDataId | NsDataId
  type | Type of data to load.
  buffer | Output buffer.
  size | Output 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

  taskID | BOSS taskID.

## bossGetTaskState()

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

Returns task state.

Parameters

  taskID | BOSS taskID.
  inval | Unknown, normally 0?
  status | Output status, see bossTaskStatus.
  out1 | Output field.
  out2 | Output field.

Examples
  network/boss/source/main.c.

## bossInit()

Result bossInit | ( | u64 | programID,
|  | bool | force_user
| ) |  |

Initializes BOSS.

Parameters

  programID | programID to use, 0 for the current process. Only used when BOSSP is available without *hax payload.
  force_user | When 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

  NsDataId | NsDataId
  offset | Offset in the content.
  buffer | Output buffer.
  size | Output buffer size.
  transfer_total | Optional output actual read size, can be NULL.
  unk_out | Optional 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

  taskID | BOSS taskID.
  unk0 | Unknown, usually zero.
  unk1 | Unknown, 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

  programID | programID 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

  bossContext | BOSS context.

Examples
  network/boss/source/main.c.

## bossSendProperty()

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

Send a property.

Parameters

  PropertyID | PropertyID
  buf | Input buffer data.
  size | Buffer size.

## bossSetStorageInfo()

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

Set the content data storage location.

Parameters

  extdataID | u64 extdataID, must have the high word set to the shared-extdata value when it's for NAND.
  boss_size | Probably the max size in the extdata which BOSS can use.
  mediaType | Roughly 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

  bossContext | BOSS context.
  seconds_interval | Interval in seconds for running the task automatically.
  url | Task URL.

Examples
  network/boss/source/main.c.

## bossStartBgImmediate()

Result bossStartBgImmediate | ( | const char * | taskID | ) |

Similar to bossStartTaskImmediate?

Parameters

  taskID | BOSS taskID.

## bossStartTaskImmediate()

Result bossStartTaskImmediate | ( | const char * | taskID | ) |

Starts a task soon after running this command.

Parameters

  taskID | BOSS taskID.

Examples
  network/boss/source/main.c.