mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-03 18:12:14 +02:00
Compare commits
No commits in common. "master" and "v3.3.0" have entirely different histories.
34
.doozer.json
Normal file
34
.doozer.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"targets": {
|
||||
"lib": {
|
||||
|
||||
"buildenv": "docker:devkitpro/devkita64",
|
||||
|
||||
"buildcmd": [
|
||||
"sudo -E make -j${PARALLEL} -C nx install"
|
||||
]
|
||||
},
|
||||
|
||||
"docs": {
|
||||
// This target build and upload docs and will be trigged from doozer's CD script
|
||||
"auto": false,
|
||||
|
||||
"buildenv": "xenial-amd64",
|
||||
"builddeps": [
|
||||
"doxygen"
|
||||
],
|
||||
|
||||
"buildcmd": [
|
||||
"cd nx", "doxygen"
|
||||
],
|
||||
|
||||
"artifacts": [{
|
||||
"source": "nx/docs/html",
|
||||
"destination": {
|
||||
"type": "git",
|
||||
"branch": "gh-pages"
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
22
.github/workflows/build.yaml
vendored
22
.github/workflows/build.yaml
vendored
@ -1,22 +0,0 @@
|
||||
name: Build libnx
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test build
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: 'devkitpro/devkita64'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: build
|
||||
run: make -C nx -j$(nproc)
|
39
.github/workflows/doxygen.yaml
vendored
39
.github/workflows/doxygen.yaml
vendored
@ -1,39 +0,0 @@
|
||||
name: Build documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: [ v* ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build documentation
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Get current tag
|
||||
id: vars
|
||||
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
|
||||
|
||||
- name: Set up Doxygen
|
||||
run: sudo apt-get install -y doxygen
|
||||
|
||||
- name: Display Doxygen version
|
||||
run: echo "Doxygen version $(doxygen -v)"
|
||||
|
||||
- name: Build documentation
|
||||
run: |
|
||||
cd nx
|
||||
LIBNX_VERSION=${{ steps.vars.outputs.tag }} doxygen Doxyfile
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@3.7.1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH: gh-pages
|
||||
FOLDER: nx/docs/html
|
||||
CLEAN: true
|
||||
SINGLE_COMMIT: true
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -8,10 +8,7 @@
|
||||
*.pfs0
|
||||
Thumbs.db
|
||||
.*/
|
||||
!.github/
|
||||
debug/
|
||||
release/
|
||||
lib/
|
||||
docs/
|
||||
compile_commands.json
|
||||
.clangd
|
||||
|
366
Changelog.md
366
Changelog.md
@ -1,371 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## Version 4.7.0
|
||||
|
||||
#### system
|
||||
* Basic support for 18.0.0
|
||||
|
||||
#### services
|
||||
* fs: add GetFileSystemAttribute cmd
|
||||
* fs: Implement "ChallengeCardExistence" and "GetGameCardDeviceCertificate"
|
||||
|
||||
#### graphics
|
||||
* nvchannel: Fix SET_CLK_RATE, implement GET_CLK_RATE and SET_SUBMIT_TIMEOUT
|
||||
|
||||
#### miscellaneous
|
||||
* Update SetSysProductModel_Aula comment
|
||||
|
||||
## Version 4.6.0
|
||||
|
||||
#### system
|
||||
* svc: fix query/insecure names
|
||||
|
||||
#### miscellaneous
|
||||
* add fsDeviceOperatorGetGameCardUpdatePartitionInfo
|
||||
* Add NX_ prefix to PACKED, NORETURN, IGNORE_ARG and DEPRECATED macros
|
||||
* Fix: avoid segfault at static destructors
|
||||
|
||||
## Version 4.5.0
|
||||
|
||||
#### services
|
||||
* btdrv: Missing definitions for ble were added
|
||||
* capsdc: Updated for [17.0.0+]
|
||||
* hidsys: Support was added for many commands
|
||||
* fs:
|
||||
* Updated for [17.0.0+]
|
||||
* Support was added for many fsDeviceOperator commands
|
||||
* ncm: Updated for [17.0.0+]
|
||||
* nfc: Support was added for all remaining commands
|
||||
* ns: Added nsEstimateSizeToMove
|
||||
* pctl: Support was added for many commands
|
||||
* ssl: Updated sslConnectionSetPrivateOption for [17.0.0+]
|
||||
* ts: Updated for [17.0.0+]
|
||||
|
||||
#### devices
|
||||
* socket: Updated wrapper to automatically select latest available bsd service version (fixes multicast support)
|
||||
|
||||
#### miscellaneous
|
||||
* The linker script/crt0 were updated to support relro
|
||||
* A bug was fixed in aes-cbc block decryption
|
||||
* A number of problems were corrected involving incorrect ipc serialization with pointer arguments
|
||||
|
||||
**Several issues were fixed, and usability and stability were improved.**
|
||||
|
||||
## Version 4.4.2
|
||||
|
||||
#### system
|
||||
* ensure correct addresses for bss
|
||||
|
||||
#### miscellaneous
|
||||
* fix timezone to allow +/- and alphanumrics
|
||||
* end compile_commmands generation when elf linked
|
||||
|
||||
## Version 4.4.1
|
||||
|
||||
#### miscellaneous
|
||||
* add missing separator to local path
|
||||
|
||||
**Several issues were fixed, and usability and stability were improved.**
|
||||
|
||||
## Version 4.4.0
|
||||
|
||||
#### services
|
||||
* applet: add appletGetMessageEvent
|
||||
* usbcomms: add async API
|
||||
* usbcomms: expose VID:PID configuration
|
||||
|
||||
#### miscellaneous
|
||||
* correct problems revealed by gcc 13
|
||||
* mitigate race condition bug in nvservices
|
||||
|
||||
**Several issues were fixed, and usability and stability were improved.**
|
||||
|
||||
## Version 4.3.0
|
||||
|
||||
#### services
|
||||
* applet: Updated for [15.0.0+]. Added `__nx_applet_init_timeout`
|
||||
* audctl:
|
||||
* Added audctlGetActiveOutputTarget.
|
||||
* Fixed TargetVolume functions.
|
||||
* auddev: Added auddevGetActiveAudioDeviceName.
|
||||
* bpc: Fixed GetSleepButtonState/GetPowerButton.
|
||||
* fs: Updated for [16.0.0+]
|
||||
* hiddbg: Changed hiddbgAttachHdlsWorkBuffer to accept a user-supplied buffer and size.
|
||||
* ncm: Updated for [15.0.0+] and [16.0.0+].
|
||||
* pdm:
|
||||
* Updated for [16.0.0+].
|
||||
* Fixed pdmqryQueryAccountEvent on older sysvers.
|
||||
* Updated structs.
|
||||
* pl: Added [16.0.0+] sysver checks.
|
||||
* ssl:
|
||||
* Added support for new [16.0.0+] functionality.
|
||||
* Added ssl:s support [15.0.0+].
|
||||
* Added sslClearTls12FallbackFlag [14.0.0+].
|
||||
* Updated SslCaCertificateId enum.
|
||||
* usbhs: Added the remaining cmds and expose more functionality.
|
||||
* vi: Added [16.0.0+] Manager commands.
|
||||
* wlaninf: Added sysver check to account for its removal in \[15.0.0+\].
|
||||
|
||||
#### devices
|
||||
* nxlinkConnectToHost: Added timeout to avoid long hang when -s isn't specified for nxlink.
|
||||
|
||||
#### miscellaneous
|
||||
* Added CMSG macros to BSD headers.
|
||||
|
||||
**Several issues were fixed, and usability and stability were improved.**
|
||||
|
||||
## Version 4.2.2
|
||||
|
||||
#### system
|
||||
* svc: Added svcMapInsecureMemory, svcUnmapInsecureMemory [15.0.0+].
|
||||
* svc: Renamed perm parameter of svcMapDeviceAddressSpaceByForce and svcMapDeviceAddressSpaceAligned to option [15.0.0+].
|
||||
* svc: Corrected svcMapIoRegion, svcUnmapIoRegion.
|
||||
* env: Added HBABI support for hinting SVCs in the extended range 0x80..0xBF.
|
||||
* cache: Added instruction barrier to armICacheInvalidate.
|
||||
|
||||
#### graphics
|
||||
* Added nvGpuGetTimestamp, nvioctlNvhostCtrlGpu_GetGpuTime.
|
||||
|
||||
#### applets
|
||||
* swkbd: Corrected several typos and incorrect floating point values.
|
||||
|
||||
#### network
|
||||
* socket: Added socketNifmRequestRegisterSocketDescriptor, socketNifmRequestUnregisterSocketDescriptor.
|
||||
* nifm: nifmRequestSetKeptInSleep, nifmRequestRegisterSocketDescriptor, nifmRequestUnregisterSocketDescriptor, nifmSetWowlDelayedWakeTime.
|
||||
|
||||
#### other services
|
||||
* set:sys: setsysNeedsToUpdateHeadphoneVolume removed in [15.0.0].
|
||||
* pdm:qry: pdmqryQueryRecentlyPlayedApplication, pdmqryGetRecentlyPlayedApplicationUpdateEvent removed in [15.0.0].
|
||||
|
||||
Several issues were fixed, and usability and stability were improved.
|
||||
|
||||
## Version 4.2.1
|
||||
|
||||
#### system
|
||||
* cache: Adjusted cache maintenance ABI for [14.0.0+].
|
||||
* svc: Added InfoType_IsSvcPermitted [14.0.0+].
|
||||
* svc: Removed svcCallSecureMonitor's non-existent return type.
|
||||
* svc: Fixed definition of MemoryInfo struct.
|
||||
* ldscript: Generated ELFs now start with the `.text` section (required by GDB).
|
||||
|
||||
#### filesystem
|
||||
* Added fsOpenSaveDataInfoReaderWithFilter.
|
||||
* Added fsCreate_TemporaryStorage.
|
||||
* Fixed bug in fsOpen_TemporaryStorage.
|
||||
|
||||
#### graphics
|
||||
* Added nvIoctl3.
|
||||
* Adjusted hos version requirements in nvIoctl2 [3.0.0+].
|
||||
* Adjusted list of IOCTLs that use the cloned NV service session.
|
||||
* console: Added support for SGR 38/48 escape sequences.
|
||||
* console: Bold/Faint attributes no longer applied to the background.
|
||||
|
||||
#### input
|
||||
* hid: Added hidGetNpadLagerType, hidGetNpadStatesLager.
|
||||
* hid: Added HidNpadLagerType enum.
|
||||
* hid: Added HidNpadLagerState struct.
|
||||
* hid: Updated HidNpadStyleTag, HidNpadButton, HidDeviceTypeBits, HidDeviceType, HidAppletFooterUiType enums.
|
||||
* hid: Updated HidNpadInternalState struct.
|
||||
* hidsys: Added hidsysAcquireUniquePadConnectionEventHandle, hidsysGetUniquePadBluetoothAddress, hidsysDisconnectUniquePad, hidsysGetUniquePadType, hidsysGetUniquePadInterface, hidsysGetUniquePadControllerNumber.
|
||||
* hidsys: Added HidsysUniquePadType enum.
|
||||
|
||||
#### other
|
||||
* Added `BITL()` macro (unsigned long, i.e. 64-bit unsigned integer).
|
||||
* bpc: Adjusted for removed commands in [14.0.0+].
|
||||
* bpc: Added bpcGetPowerButton [6.0.0+].
|
||||
* btdrv: Adjusted for removed commands in [14.0.0+].
|
||||
* btm: Corrected inverted hos version check affecting several commands.
|
||||
* nfc: Added nfcSendCommandByPassThrough, nfcKeepPassThroughSession, nfcReleasePassThroughSession.
|
||||
* pm: Added support for [14.0.0+].
|
||||
* ts: Adjusted for removed commands in [14.0.0+].
|
||||
|
||||
Several issues were fixed, and usability and stability were improved.
|
||||
|
||||
## Version 4.2.0
|
||||
|
||||
#### system
|
||||
* Added new SVCs introduced in [13.0.0+].
|
||||
* Thread structures are now pre-populated with information prior to creation.
|
||||
|
||||
#### input
|
||||
* hidsys: Added support for [13.0.0+].
|
||||
* hiddbg: Added support for [13.0.0+].
|
||||
|
||||
#### graphics
|
||||
* Fixed crashes caused by arbitrary sizes in linear framebuffers.
|
||||
|
||||
#### other
|
||||
* ncm: Added support for [13.0.0+].
|
||||
* setsys: Added support for [13.0.0+].
|
||||
* Filled in SetSysNxControllerSettings structure definition (which was previously unpopulated).
|
||||
* btm: Added support for [13.0.0+].
|
||||
* btdrv: Added support for [13.0.0+].
|
||||
* Fixed btdrvRespondToSspRequest for [12.0.0+].
|
||||
* psel: Added support for [13.0.0+] (pselShowUserQualificationPromoter).
|
||||
* Corrected ldr:ro/ro:1 initialization.
|
||||
|
||||
Several issues were fixed, and usability and stability were improved.
|
||||
|
||||
## Version 4.1.3
|
||||
|
||||
#### input
|
||||
* **Removed old deprecated HID API**.
|
||||
|
||||
#### network
|
||||
* Fixed inet_pton implementation.
|
||||
|
||||
Several issues were fixed, and usability and stability were improved.
|
||||
|
||||
## Version 4.1.2
|
||||
|
||||
Several issues were fixed, and usability and stability were improved.
|
||||
|
||||
## Version 4.1.1
|
||||
|
||||
#### system
|
||||
* Fixed deadlock issue when multi-threaded services (e.g. filesystem, sockets) are starved of free sessions.
|
||||
|
||||
Several issues were fixed, and usability and stability were improved.
|
||||
|
||||
## Version 4.1.0
|
||||
|
||||
#### system
|
||||
* **Removed old virtmem API**.
|
||||
* Added mechanism for overriding libnx's dynamic memory allocation behavior.
|
||||
* This also added specific mechanisms for NV and BSD transfer memory handling.
|
||||
* Added hosversionIsAtmosphere, together with support for receiving this information through HBABI.
|
||||
* Added tipc (Tiny IPC) serialization support, introduced in [12.0.0+].
|
||||
* Updated sm, sm:m and pgl wrappers for tipc support.
|
||||
* Fixed certain serialization bug in cmif handling code.
|
||||
* argv setup code can now be overriden.
|
||||
* virtmem RNG algorithm can now be overriden.
|
||||
* Added support for incremental CRC calculations.
|
||||
|
||||
#### fs
|
||||
* Added fsOpenHostFileSystem(WithOption).
|
||||
|
||||
#### input
|
||||
* Added HidKeyboardKey enum.
|
||||
* Added hidKeyboardStateGetKey helper function.
|
||||
* Added support for SleepButton AutoPilot in hiddbg.
|
||||
* Updated hdls service wrapper for [12.0.0+].
|
||||
* Corrected HidGestureAttribute, HidGestureState.
|
||||
* Corrected several swkbd enums and structs.
|
||||
* Minor Palma documentation improvements.
|
||||
|
||||
#### other services
|
||||
* **Updated btdrv service wrapper for [12.0.0+]**, along with fixes and improved support.
|
||||
* Added audctl service wrapper.
|
||||
* Added audrec service wrapper.
|
||||
* Added avm service wrapper.
|
||||
* Added friends service wrapper (minimal functionality needed for retrieving the user's friend code).
|
||||
* Added htcs service wrapper.
|
||||
* Added mm:u service wrapper.
|
||||
* Added new nvioctlChannel_\* wrappers: Submit, GetSyncpt, GetModuleClockRate, MapCommandBuffer, UnmapCommandBuffer.
|
||||
* Added SetSysProductModel enum, now used by setsysGetProductModel.
|
||||
* Added audrvVoiceIsPaused.
|
||||
* Updated BtmDeviceCondition struct, including compatibility with all system versions.
|
||||
* Corrected pscmGetPmModule prototype.
|
||||
* Renamed ChargerType to PsmChargerType, corrected enum names.
|
||||
* Fixed bug in time offset handling.
|
||||
* Fixed bug in BSD (sockets) initialization.
|
||||
|
||||
**Several issues were fixed, and usability and stability were improved.**
|
||||
|
||||
## Version 4.0.0
|
||||
|
||||
#### system
|
||||
* **Added support for the light event synchronization primitive** (needs [4.0.0+] or mesosphère).
|
||||
* **The virtmem API was completely redesigned** to support ASLR and increase thread safety.
|
||||
* **Added diagAbortWithResult**, an overridable user panic function which is intended to replace fatalThrow in order to stop homebrew from treating application errors as fatal system errors that bring the entire OS down.
|
||||
* The default implementation uses svcBreak.
|
||||
* Replaced calls to fatalThrow with diagAbortWithResult throughout libnx.
|
||||
* Added detectMesosphere.
|
||||
* Added svcGetResourceLimitPeakValue [11.0.0+].
|
||||
* Added InfoType_FreeThreadCount [11.0.0+].
|
||||
* Corrected svcBreak definition and added BreakReason enum.
|
||||
* Removed obsolete kernel version detection code.
|
||||
* fatal service wrapper now checks hosversion.
|
||||
* Jit object wrapper now checks syscall hinting provided by the homebrew environment (requires nx-hbloader 2.4.0+).
|
||||
* Miscellaneous crt0/linkscript fixes and optimizations.
|
||||
|
||||
#### input
|
||||
* **Major refactor of the HID service**, including a redesigned API that follows official usage more accurately, allowing more flexibility and improved future maintainability. Summary of changes:
|
||||
* Introduced HidNpadIdType, HidNpadStyleTag, HidNpadButton enums and others.
|
||||
* Enums and structs were updated to more accurately reflect official names; this also affects all other hid related services.
|
||||
* Everything which formerly took HidControllerID parameters now takes HidNpadIdType instead; this also affects all other hid related services.
|
||||
* Handle types (such as vibration and sixaxis sensor handles) are now structs instead of bare integer values; this also affects all other hid related services.
|
||||
* Introduced explicit initialization functions for Npad, TouchScreen, Mouse, Keyboard.
|
||||
* Introduced (or renamed) functions for configuring or retrieving Npad input style and other associated behavior.
|
||||
* Introduced the hidGetNpadStates{X} family of functions, which read the current state of a Npad in the given style.
|
||||
* Likewise introduced hidGetTouchScreenStates, hidGetMouseStates, hidGetKeyboardStates, hidGetSixAxisSensorStates.
|
||||
* Added support for most other miscellaneous hid service commands.
|
||||
* Deprecated the entirety of the old API, including but not limited to: hidScanInput, hidGetKeysDown/Held/Up, hidTouchCount, hidTouchRead, etc.
|
||||
* Removed hidSetControllerLayout/hidGetControllerLayout together with HidControllerLayoutType.
|
||||
* Introduced a new wrapper Pad API that replaces the old API for application usage.
|
||||
* Introduced PadRepeater API.
|
||||
* **Added full support for GameCube, Palma (Poké Ball Plus), Lark (NES) and Lucia (SNES) controllers.**
|
||||
* **Added support for gestures.**
|
||||
* **Improved support for SevenSixAxisSensor.**
|
||||
* Added hiddbg AutoPilot support for DebugPad, TouchScreen, Mouse, Keyboard.
|
||||
* Added hiddbgDeactivateHomeButton.
|
||||
* Added HiddbgNpadButton enum with Home/Capture buttons (exclusive to hiddbg pad state).
|
||||
* Updated hidsys service wrapper for [11.0.0+], including new functionality.
|
||||
* Added hidsysSendKeyboardLockKeyEvent, hidsysGetNpadInterfaceType, hidsysGetNpadLeftRightInterfaceType, hidsysHasBattery, hidsysHasLeftRightBattery, hidsysIsUsbFullKeyControllerEnabled, hidsysEnableUsbFullKeyController, hidsysIsUsbConnected, hidsysIsFirmwareUpdateNeededForNotification.
|
||||
* Improved support for hidsys' Home/Sleep/Capture button commands.
|
||||
* Added HidsysUniquePadSerialNumber struct.
|
||||
* Fixed bug in hidbus/Ring-Con code that could cause a crash following cleanup.
|
||||
|
||||
#### applets
|
||||
* Updated applet service wrapper for [11.0.0+], including new functionality.
|
||||
* Renamed several members in the following enums to more accurately reflect official names: AppletOperationMode, AppletHookType, AppletMessage, AppletFocusState, AppletFocusHandlingMode, AppletId, AppletWirelessPriorityMode, AppletWindowOriginMode.
|
||||
* Added appletHolderGetExitEvent, appletHolderGetPopInteractiveOutDataEvent.
|
||||
* Added libappletRequestToLaunchApplication, libappletRequestJumpToStory [11.0.0+].
|
||||
* Added webConfigSetTransferMemory.
|
||||
* Added swkbdInlineGetMaxHeight, swkbdInlineGetTouchRectangles, swkbdInlineIsUsedTouchPointByKeyboard, swkbdInlineGetMiniaturizedHeight.
|
||||
* Added nfpLa wrapper (amiibo).
|
||||
* Added miiLa wrapper (Mii editor).
|
||||
* Added nifmLa wrapper.
|
||||
* Updated swkbd for [10.0.0+].
|
||||
* Updated web for [10.0.0+].
|
||||
* Updated hidLa for [11.0.0] + misc fixes.
|
||||
* Implemented support for WebSession in web.
|
||||
* Implemented support for UserDisplay mode in swkbd.
|
||||
|
||||
#### filesystem
|
||||
* Added fsCreateSaveDataFileSystem, fsDeleteSaveDataFileSystem, fsDeleteSaveDataFileSystemBySaveDataAttribute.
|
||||
* Added fsOpenDataFileSystemByCurrentProcess, fsOpenDataFileSystemByProgramId, fsOpenDataStorageByProgramId, fsOpenPatchDataStorageByCurrentProcess.
|
||||
* Added fsOutputAccessLogToSdCard, fsGetProgramIndexForAccessLog.
|
||||
* Added romfsMountDataStorageFromProgram.
|
||||
* Fixed stat on romfs devices to report failure properly for non-existent files/directories.
|
||||
|
||||
#### other services
|
||||
* Added Bluetooth (bt, btdrv, btm, btm:u, btm:sys) service wrappers.
|
||||
* Added btdev wrapper API.
|
||||
* Added ins:r and ins:s service wrappers.
|
||||
* Added uart service wrapper.
|
||||
* Added news service wrapper.
|
||||
* Added lp2p service wrapper.
|
||||
* Added ectx:r service wrapper [11.0.0+].
|
||||
* Added capmtp service wrapper [11.0.0+].
|
||||
* Added smDetachClient [11.0.0+].
|
||||
* Added ErrorContextType enum.
|
||||
* Updated gpio service wrapper to add most missing functionality.
|
||||
* Updated psm service wrapper to add more battery functions.
|
||||
* Updated loader service wrapper for [11.0.0+].
|
||||
* Updated usb:ds service wrapper for [11.0.0+].
|
||||
* Updated set service wrapper for [10.1.0+], including new functionality.
|
||||
* Updated ns service wrapper to consider ns:ro if available [11.0.0+].
|
||||
* Updated ssl service enum SslVersion for [11.0.0+].
|
||||
* Renamed several members in the following enums to more accurately reflect official names: ApmPerformanceMode, ApmCpuBoostMode.
|
||||
* Fixed bug in splCryptoGetSecurityEngineEvent service wrapper.
|
||||
* Fixed audoutOpenAudioOut to properly pass aruid, making the service usable once again (and restoring compatibility with [1.0.0]).
|
||||
* Reliability and usability fixes in usb:ds:
|
||||
* Added UsbState enum (now returned by usbDsGetState).
|
||||
* Fixed usbDsWaitReady to properly respect the given timeout.
|
||||
|
||||
**Several issues were fixed, and usability and stability were improved.**
|
||||
|
||||
## Version 3.3.0
|
||||
|
||||
#### system
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Nintendo Switch AArch64-only userland library.
|
||||
Based on libctru.
|
||||
|
||||

|
||||
[](https://doozer.io/switchbrew/libnx)
|
||||
|
||||
# Install instructions
|
||||
See [Switchbrew](https://switchbrew.org/wiki/Setting_up_Development_Environment).
|
||||
|
@ -38,7 +38,7 @@ PROJECT_NAME = "libnx"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = "$(LIBNX_VERSION)"
|
||||
PROJECT_NUMBER = "$(TRAVIS_TAG)"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
24
nx/Makefile
24
nx/Makefile
@ -8,6 +8,13 @@ endif
|
||||
|
||||
include $(DEVKITPRO)/devkitA64/base_rules
|
||||
|
||||
export LIBNX_MAJOR := 3
|
||||
export LIBNX_MINOR := 3
|
||||
export LIBNX_PATCH := 0
|
||||
|
||||
|
||||
VERSION := $(LIBNX_MAJOR).$(LIBNX_MINOR).$(LIBNX_PATCH)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# TARGET is the name of the output
|
||||
# BUILD is the directory where object files & intermediate files will be placed
|
||||
@ -83,19 +90,22 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
||||
-I. \
|
||||
-iquote $(CURDIR)/include/switch/
|
||||
|
||||
.PHONY: clean all lib/libnx.a lib/libnxd.a
|
||||
.PHONY: clean all
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
all: lib/libnx.a lib/libnxd.a
|
||||
|
||||
install: lib/libnx.a lib/libnxd.a
|
||||
@mkdir -p $(DESTDIR)$(DEVKITPRO)/libnx
|
||||
@cp -v default_icon.jpg switch_rules switch.ld switch.specs $(DESTDIR)$(DEVKITPRO)/libnx/
|
||||
@cp -rv include lib $(DESTDIR)$(DEVKITPRO)/libnx/
|
||||
@cp -rv external/bsd/include $(DESTDIR)$(DEVKITPRO)/libnx/
|
||||
dist-bin: all
|
||||
@tar --exclude=*~ -cjf libnx-$(VERSION).tar.bz2 include lib default_icon.jpg switch_rules switch.ld switch.specs -C external/bsd include
|
||||
|
||||
dist-src:
|
||||
@tar -cjf libnx-`git describe --tags | sed 's/^v//'`.tar.bz2 include source data external Makefile default_icon.jpg switch_rules switch.ld switch.specs
|
||||
@tar --exclude=*~ -cjf libnx-src-$(VERSION).tar.bz2 include source data external Makefile default_icon.jpg switch_rules switch.ld switch.specs
|
||||
|
||||
dist: dist-src dist-bin
|
||||
|
||||
install: dist-bin
|
||||
mkdir -p $(DESTDIR)$(DEVKITPRO)/libnx
|
||||
bzip2 -cd libnx-$(VERSION).tar.bz2 | tar -xf - -C $(DESTDIR)$(DEVKITPRO)/libnx
|
||||
|
||||
#dox:
|
||||
# @doxygen Doxyfile
|
||||
|
31
nx/external/bsd/include/sys/socket.h
vendored
31
nx/external/bsd/include/sys/socket.h
vendored
@ -437,35 +437,8 @@ struct cmsghdr {
|
||||
/* followed by u_char cmsg_data[]; */
|
||||
};
|
||||
|
||||
#define _ALIGNBYTES (sizeof(long) - 1)
|
||||
#define _ALIGN(p) (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
|
||||
|
||||
/* given pointer to struct cmsghdr, return pointer to data */
|
||||
#define CMSG_DATA(cmsg) \
|
||||
((unsigned char *)(cmsg) + _ALIGN(sizeof(struct cmsghdr)))
|
||||
|
||||
/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
|
||||
#define CMSG_NXTHDR(mhdr, cmsg) \
|
||||
(((char *)(cmsg) + _ALIGN((cmsg)->cmsg_len) + \
|
||||
_ALIGN(sizeof(struct cmsghdr)) > \
|
||||
((char *)(mhdr)->msg_control) + (mhdr)->msg_controllen) ? \
|
||||
(struct cmsghdr *)NULL : \
|
||||
(struct cmsghdr *)((char *)(cmsg) + _ALIGN((cmsg)->cmsg_len)))
|
||||
|
||||
/*
|
||||
* RFC 2292 requires to check msg_controllen, in case that the kernel returns
|
||||
* an empty list for some reasons.
|
||||
*/
|
||||
#define CMSG_FIRSTHDR(mhdr) \
|
||||
((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
|
||||
(struct cmsghdr *)(mhdr)->msg_control : \
|
||||
(struct cmsghdr *)NULL)
|
||||
|
||||
/* Length of the contents of a control message of length len */
|
||||
#define CMSG_LEN(len) (_ALIGN(sizeof(struct cmsghdr)) + (len))
|
||||
|
||||
/* Length of the space taken up by a padded control message of length len */
|
||||
#define CMSG_SPACE(len) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(len))
|
||||
// socket credential stuff, we don't need this
|
||||
// cmsg macros, uses some obscure macro
|
||||
|
||||
/* "Socket"-level control message types: */
|
||||
#define SCM_RIGHTS 0x01 /* access rights (array of int) */
|
||||
|
@ -25,7 +25,6 @@ extern "C" {
|
||||
#include "switch/kernel/shmem.h"
|
||||
#include "switch/kernel/mutex.h"
|
||||
#include "switch/kernel/event.h"
|
||||
#include "switch/kernel/levent.h"
|
||||
#include "switch/kernel/uevent.h"
|
||||
#include "switch/kernel/utimer.h"
|
||||
#include "switch/kernel/rwlock.h"
|
||||
@ -42,7 +41,6 @@ extern "C" {
|
||||
#include "switch/sf/cmif.h"
|
||||
#include "switch/sf/service.h"
|
||||
#include "switch/sf/sessionmgr.h"
|
||||
#include "switch/sf/tipc.h"
|
||||
|
||||
#include "switch/services/sm.h"
|
||||
#include "switch/services/smm.h"
|
||||
@ -53,10 +51,8 @@ extern "C" {
|
||||
#include "switch/services/apm.h"
|
||||
#include "switch/services/applet.h"
|
||||
#include "switch/services/async.h"
|
||||
#include "switch/services/audctl.h"
|
||||
#include "switch/services/audin.h"
|
||||
#include "switch/services/audout.h"
|
||||
#include "switch/services/audrec.h"
|
||||
#include "switch/services/audren.h"
|
||||
#include "switch/services/auddev.h"
|
||||
#include "switch/services/hwopus.h"
|
||||
@ -64,7 +60,6 @@ extern "C" {
|
||||
#include "switch/services/lbl.h"
|
||||
#include "switch/services/i2c.h"
|
||||
#include "switch/services/gpio.h"
|
||||
#include "switch/services/uart.h"
|
||||
#include "switch/services/bpc.h"
|
||||
#include "switch/services/pcv.h"
|
||||
#include "switch/services/clkrst.h"
|
||||
@ -74,7 +69,6 @@ extern "C" {
|
||||
#include "switch/services/spsm.h"
|
||||
//#include "switch/services/bsd.h" Use <sys/socket.h> instead
|
||||
//#include "switch/services/sfdnsres.h" Use <netdb.h> instead
|
||||
//#include "switch/services/htcs.h"
|
||||
#include "switch/services/fatal.h"
|
||||
#include "switch/services/time.h"
|
||||
#include "switch/services/usb.h"
|
||||
@ -99,11 +93,6 @@ extern "C" {
|
||||
#include "switch/services/set.h"
|
||||
#include "switch/services/ssl.h"
|
||||
#include "switch/services/lr.h"
|
||||
#include "switch/services/bt.h"
|
||||
#include "switch/services/btdrv.h"
|
||||
#include "switch/services/btm.h"
|
||||
#include "switch/services/btmu.h"
|
||||
#include "switch/services/btmsys.h"
|
||||
#include "switch/services/spl.h"
|
||||
#include "switch/services/ncm.h"
|
||||
#include "switch/services/psc.h"
|
||||
@ -114,7 +103,6 @@ extern "C" {
|
||||
#include "switch/services/capsu.h"
|
||||
#include "switch/services/capssc.h"
|
||||
#include "switch/services/capssu.h"
|
||||
#include "switch/services/capmtp.h"
|
||||
#include "switch/services/nfc.h"
|
||||
#include "switch/services/wlaninf.h"
|
||||
#include "switch/services/pctl.h"
|
||||
@ -125,12 +113,6 @@ extern "C" {
|
||||
#include "switch/services/mii.h"
|
||||
#include "switch/services/miiimg.h"
|
||||
#include "switch/services/ldn.h"
|
||||
#include "switch/services/lp2p.h"
|
||||
#include "switch/services/news.h"
|
||||
#include "switch/services/ins.h"
|
||||
#include "switch/services/ectx.h"
|
||||
#include "switch/services/avm.h"
|
||||
#include "switch/services/mm.h"
|
||||
|
||||
#include "switch/display/binder.h"
|
||||
#include "switch/display/parcel.h"
|
||||
@ -153,9 +135,6 @@ extern "C" {
|
||||
#include "switch/applets/album_la.h"
|
||||
#include "switch/applets/friends_la.h"
|
||||
#include "switch/applets/hid_la.h"
|
||||
#include "switch/applets/mii_la.h"
|
||||
#include "switch/applets/nfp_la.h"
|
||||
#include "switch/applets/nifm_la.h"
|
||||
#include "switch/applets/pctlauth.h"
|
||||
#include "switch/applets/psel.h"
|
||||
#include "switch/applets/error.h"
|
||||
@ -164,12 +143,9 @@ extern "C" {
|
||||
|
||||
#include "switch/runtime/env.h"
|
||||
#include "switch/runtime/hosversion.h"
|
||||
#include "switch/runtime/diag.h"
|
||||
#include "switch/runtime/nxlink.h"
|
||||
#include "switch/runtime/resolver.h"
|
||||
#include "switch/runtime/pad.h"
|
||||
#include "switch/runtime/ringcon.h"
|
||||
#include "switch/runtime/btdev.h"
|
||||
|
||||
#include "switch/runtime/util/utf.h"
|
||||
|
||||
|
@ -25,18 +25,9 @@ typedef struct {
|
||||
u32 desc; ///< The error description.
|
||||
} ErrorCode;
|
||||
|
||||
/// Error type for ErrorContext.type
|
||||
typedef enum {
|
||||
ErrorContextType_None = 0, ///< None
|
||||
ErrorContextType_Http = 1, ///< Http
|
||||
ErrorContextType_FileSystem = 2, ///< FileSystem
|
||||
ErrorContextType_WebMediaPlayer = 3, ///< WebMediaPlayer
|
||||
ErrorContextType_LocalContentShare = 4, ///< LocalContentShare
|
||||
} ErrorContextType;
|
||||
|
||||
/// Error context.
|
||||
typedef struct {
|
||||
u8 type; ///< Type, see \ref ErrorContextType.
|
||||
u8 type; ///< Type
|
||||
u8 pad[7]; ///< Padding
|
||||
u8 data[0x1f4]; ///< Data
|
||||
Result res; ///< Result
|
||||
@ -111,7 +102,7 @@ typedef struct {
|
||||
u64 languageCode; ///< See set.h.
|
||||
char dialogMessage[0x800]; ///< UTF-8 Dialog message.
|
||||
char fullscreenMessage[0x800]; ///< UTF-8 Fullscreen message (displayed when the user clicks on "Details").
|
||||
} NX_PACKED ErrorApplicationArg;
|
||||
} PACKED ErrorApplicationArg;
|
||||
|
||||
/// Error application config.
|
||||
typedef struct {
|
||||
@ -283,7 +274,6 @@ void errorSystemSetContext(ErrorSystemConfig* c, const ErrorContext* ctx);
|
||||
* @param fullscreen_message UTF-8 fullscreen message, displayed when the user clicks on "Details". Optional, can be NULL (which disables displaying Details).
|
||||
* @note Sets the following fields: jumpFlag=1, {strings}, and uses ::ErrorType_Application. The rest are cleared.
|
||||
* @note On pre-5.0.0 this will initialize languageCode by using: setInitialize(), setMakeLanguageCode(SetLanguage_ENUS, ...), and setExit(). This is needed since an empty languageCode wasn't supported until [5.0.0+] (which would also use SetLanguage_ENUS).
|
||||
* @note With [10.0.0+] this must only be used when running under an Application, since otherwise the applet will trigger a fatalerr.
|
||||
* @warning This applet creates an error report that is logged in the system. Proceed at your own risk!
|
||||
*/
|
||||
Result errorApplicationCreate(ErrorApplicationConfig* c, const char* dialog_message, const char* fullscreen_message);
|
||||
|
@ -10,10 +10,9 @@
|
||||
|
||||
/// Mode values for HidLaControllerSupportArgPrivate::mode.
|
||||
typedef enum {
|
||||
HidLaControllerSupportMode_ShowControllerSupport = 0, ///< ShowControllerSupport
|
||||
HidLaControllerSupportMode_ShowControllerStrapGuide = 1, ///< [3.0.0+] ShowControllerStrapGuide
|
||||
HidLaControllerSupportMode_ShowControllerFirmwareUpdate = 2, ///< [3.0.0+] ShowControllerFirmwareUpdate
|
||||
HidLaControllerSupportMode_ShowControllerKeyRemappingForSystem = 4, ///< [11.0.0+] ShowControllerKeyRemappingForSystem
|
||||
HidLaControllerSupportMode_ShowControllerSupport = 0, ///< ShowControllerSupport
|
||||
HidLaControllerSupportMode_ShowControllerStrapGuide = 1, ///< [3.0.0+] ShowControllerStrapGuide
|
||||
HidLaControllerSupportMode_ShowControllerFirmwareUpdate = 2, ///< [3.0.0+] ShowControllerFirmwareUpdate
|
||||
} HidLaControllerSupportMode;
|
||||
|
||||
/// ControllerSupportCaller
|
||||
@ -76,18 +75,11 @@ typedef struct {
|
||||
u8 pad[3]; ///< Padding.
|
||||
} HidLaControllerFirmwareUpdateArg;
|
||||
|
||||
/// ControllerKeyRemappingArg
|
||||
typedef struct {
|
||||
u64 unk_x0; ///< Unknown
|
||||
u32 unk_x8; ///< Unknown
|
||||
u8 pad[0x4]; ///< Padding
|
||||
} HidLaControllerKeyRemappingArg;
|
||||
|
||||
/// ControllerSupportResultInfo. First 8-bytes from the applet output storage.
|
||||
typedef struct {
|
||||
s8 player_count; ///< playerCount.
|
||||
u8 pad[3]; ///< Padding.
|
||||
u32 selected_id; ///< \ref HidNpadIdType, selectedId.
|
||||
u32 selected_id; ///< \ref HidControllerID, selectedId.
|
||||
} HidLaControllerSupportResultInfo;
|
||||
|
||||
/// Struct for the applet output storage.
|
||||
@ -111,13 +103,6 @@ void hidLaCreateControllerSupportArg(HidLaControllerSupportArg *arg);
|
||||
*/
|
||||
void hidLaCreateControllerFirmwareUpdateArg(HidLaControllerFirmwareUpdateArg *arg);
|
||||
|
||||
/**
|
||||
* @brief Initializes a \ref HidLaControllerKeyRemappingArg with the defaults.
|
||||
* @note This just uses memset() with the arg.
|
||||
* @param[out] arg \ref HidLaControllerKeyRemappingArg
|
||||
*/
|
||||
void hidLaCreateControllerKeyRemappingArg(HidLaControllerKeyRemappingArg *arg);
|
||||
|
||||
/**
|
||||
* @brief Sets the ExplainText for the specified player and \ref HidLaControllerSupportArg.
|
||||
* @note This string is displayed in the UI box for the player.
|
||||
@ -126,7 +111,7 @@ void hidLaCreateControllerKeyRemappingArg(HidLaControllerKeyRemappingArg *arg);
|
||||
* @param[in] str Input ExplainText UTF-8 string, max length is 0x80 excluding NUL-terminator.
|
||||
+ @oaram[in] id Player controller, must be <8.
|
||||
*/
|
||||
Result hidLaSetExplainText(HidLaControllerSupportArg *arg, const char *str, HidNpadIdType id);
|
||||
Result hidLaSetExplainText(HidLaControllerSupportArg *arg, const char *str, HidControllerID id);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for ControllerSupport.
|
||||
@ -165,11 +150,3 @@ Result hidLaShowControllerSupportForSystem(HidLaControllerSupportResultInfo *res
|
||||
*/
|
||||
Result hidLaShowControllerFirmwareUpdateForSystem(const HidLaControllerFirmwareUpdateArg *arg, HidLaControllerSupportCaller caller);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for ControllerKeyRemappingForSystem.
|
||||
* @note Only available on [11.0.0+].
|
||||
* @param[in] arg \ref HidLaControllerKeyRemappingArg
|
||||
* @param[in] caller \ref HidLaControllerSupportCaller
|
||||
*/
|
||||
Result hidLaShowControllerKeyRemappingForSystem(const HidLaControllerKeyRemappingArg *arg, HidLaControllerSupportCaller caller);
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/applet.h"
|
||||
#include "../services/acc.h"
|
||||
|
||||
/// CommonArguments
|
||||
typedef struct {
|
||||
@ -115,22 +114,3 @@ Result libappletRequestHomeMenu(void);
|
||||
/// Equivalent to entering "System Update" under System Settings. When leaving this, it returns to the main Home Menu.
|
||||
Result libappletRequestJumpToSystemUpdate(void);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref appletPushToGeneralChannel, see appletPushToGeneralChannel regarding the requirements for using this.
|
||||
* @note Only available on [11.0.0+].
|
||||
* @param[in] application_id ApplicationId
|
||||
* @param[in] uid \ref AccountUid
|
||||
* @param[in] buffer Input buffer.
|
||||
* @param[in] size Input buffer size.
|
||||
* @param[in] sender LaunchApplicationRequestSender
|
||||
*/
|
||||
Result libappletRequestToLaunchApplication(u64 application_id, AccountUid uid, const void* buffer, size_t size, u32 sender);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref appletPushToGeneralChannel, see appletPushToGeneralChannel regarding the requirements for using this.
|
||||
* @note Only available on [11.0.0+].
|
||||
* @param[in] uid \ref AccountUid
|
||||
* @param[in] application_id Optional ApplicationId, can be 0.
|
||||
*/
|
||||
Result libappletRequestJumpToStory(AccountUid uid, u64 application_id);
|
||||
|
||||
|
@ -1,101 +0,0 @@
|
||||
/**
|
||||
* @file mii_la.h
|
||||
* @brief Wrapper for using the MiiEdit LibraryApplet.
|
||||
* @author yellows8
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/mii.h"
|
||||
|
||||
/// AppletMode
|
||||
typedef enum {
|
||||
MiiLaAppletMode_ShowMiiEdit = 0, ///< ShowMiiEdit
|
||||
MiiLaAppletMode_AppendMii = 1, ///< AppendMii
|
||||
MiiLaAppletMode_AppendMiiImage = 2, ///< AppendMiiImage
|
||||
MiiLaAppletMode_UpdateMiiImage = 3, ///< UpdateMiiImage
|
||||
MiiLaAppletMode_CreateMii = 4, ///< [10.2.0+] CreateMii
|
||||
MiiLaAppletMode_EditMii = 5, ///< [10.2.0+] EditMii
|
||||
} MiiLaAppletMode;
|
||||
|
||||
/// AppletInput
|
||||
typedef struct {
|
||||
s32 version; ///< Version
|
||||
u32 mode; ///< \ref MiiLaAppletMode
|
||||
s32 special_key_code; ///< \ref MiiSpecialKeyCode
|
||||
union {
|
||||
Uuid valid_uuid_array[8]; ///< ValidUuidArray. Only used with \ref MiiLaAppletMode ::NfpLaMiiLaAppletMode_AppendMiiImage / ::NfpLaMiiLaAppletMode_UpdateMiiImage.
|
||||
struct {
|
||||
MiiCharInfo char_info; ///< \ref MiiCharInfo
|
||||
u8 unused_x64[0x28]; ///< Unused
|
||||
} char_info;
|
||||
};
|
||||
Uuid used_uuid; ///< UsedUuid. Only used with \ref MiiLaAppletMode ::NfpLaMiiLaAppletMode_UpdateMiiImage.
|
||||
u8 unk_x9C[0x64]; ///< Unused
|
||||
} MiiLaAppletInput;
|
||||
|
||||
/// AppletOutput
|
||||
typedef struct {
|
||||
u32 res; ///< Result: 0 = Success, 1 = Cancel.
|
||||
s32 index; ///< Index. Only set when Result is Success, where \ref MiiLaAppletMode isn't ::NfpLaMiiLaAppletMode_ShowMiiEdit.
|
||||
u8 unk_x8[0x18]; ///< Unused
|
||||
} MiiLaAppletOutput;
|
||||
|
||||
/// AppletOutputForCharInfoEditing
|
||||
typedef struct {
|
||||
u32 res; ///< MiiLaAppletOutput::res
|
||||
MiiCharInfo char_info; ///< \ref MiiCharInfo
|
||||
u8 unused[0x24]; ///< Unused
|
||||
} MiiLaAppletOutputForCharInfoEditing;
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for ShowMiiEdit.
|
||||
* @param[in] special_key_code \ref MiiSpecialKeyCode
|
||||
*/
|
||||
Result miiLaShowMiiEdit(MiiSpecialKeyCode special_key_code);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for AppendMii.
|
||||
* @param[in] special_key_code \ref MiiSpecialKeyCode
|
||||
* @param[out] index Output Index.
|
||||
*/
|
||||
Result miiLaAppendMii(MiiSpecialKeyCode special_key_code, s32 *index);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for AppendMiiImage.
|
||||
* @param[in] special_key_code \ref MiiSpecialKeyCode
|
||||
* @param[in] valid_uuid_array Input array of Uuid.
|
||||
* @param[in] count Total entries for the valid_uuid_array. Must be 0-8.
|
||||
* @param[out] index Output Index.
|
||||
*/
|
||||
Result miiLaAppendMiiImage(MiiSpecialKeyCode special_key_code, const Uuid *valid_uuid_array, s32 count, s32 *index);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for UpdateMiiImage.
|
||||
* @param[in] special_key_code \ref MiiSpecialKeyCode
|
||||
* @param[in] valid_uuid_array Input array of Uuid.
|
||||
* @param[in] count Total entries for the valid_uuid_array. Must be 0-8.
|
||||
* @param[in] used_uuid UsedUuid
|
||||
* @param[out] index Output Index.
|
||||
*/
|
||||
Result miiLaUpdateMiiImage(MiiSpecialKeyCode special_key_code, const Uuid *valid_uuid_array, s32 count, Uuid used_uuid, s32 *index);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for CreateMii.
|
||||
* @note This creates a Mii and returns it, without saving it in the database.
|
||||
* @note Only available on [10.2.0+].
|
||||
* @param[in] special_key_code \ref MiiSpecialKeyCode
|
||||
* @param[out] out_char \ref MiiCharInfo
|
||||
*/
|
||||
Result miiLaCreateMii(MiiSpecialKeyCode special_key_code, MiiCharInfo *out_char);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for EditMii.
|
||||
* @note This edits the specified Mii and returns it, without saving it in the database.
|
||||
* @note Only available on [10.2.0+].
|
||||
* @param[in] special_key_code \ref MiiSpecialKeyCode
|
||||
* @param[in] in_char \ref MiiCharInfo
|
||||
* @param[out] out_char \ref MiiCharInfo
|
||||
*/
|
||||
Result miiLaEditMii(MiiSpecialKeyCode special_key_code, const MiiCharInfo *in_char, MiiCharInfo *out_char);
|
||||
|
@ -1,89 +0,0 @@
|
||||
/**
|
||||
* @file nfp_la.h
|
||||
* @brief Wrapper for using the cabinet (amiibo) LibraryApplet.
|
||||
* @author yellows8
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/nfc.h"
|
||||
|
||||
/// Values for NfpLaStartParamForAmiiboSettings::type.
|
||||
typedef enum {
|
||||
NfpLaStartParamTypeForAmiiboSettings_NicknameAndOwnerSettings = 0, ///< NicknameAndOwnerSettings
|
||||
NfpLaStartParamTypeForAmiiboSettings_GameDataEraser = 1, ///< GameDataEraser
|
||||
NfpLaStartParamTypeForAmiiboSettings_Restorer = 2, ///< Restorer
|
||||
NfpLaStartParamTypeForAmiiboSettings_Formatter = 3, ///< Formatter
|
||||
} NfpLaStartParamTypeForAmiiboSettings;
|
||||
|
||||
/// AmiiboSettingsStartParam
|
||||
typedef struct {
|
||||
u8 unk_x0[0x8]; ///< Unknown
|
||||
u8 unk_x8[0x20]; ///< Unknown
|
||||
u8 unk_x28; ///< Unknown
|
||||
} NfpLaAmiiboSettingsStartParam;
|
||||
|
||||
/// StartParamForAmiiboSettings
|
||||
typedef struct {
|
||||
u8 unk_x0; ///< Unknown
|
||||
u8 type; ///< \ref NfpLaStartParamTypeForAmiiboSettings
|
||||
u8 flags; ///< Flags
|
||||
u8 unk_x3; ///< NfpLaAmiiboSettingsStartParam::unk_x28
|
||||
u8 unk_x4[0x8]; ///< NfpLaAmiiboSettingsStartParam::unk_x0
|
||||
NfpTagInfo tag_info; ///< \ref NfpTagInfo, only enabled when flags bit1 is set.
|
||||
NfpRegisterInfo register_info; ///< \ref NfpRegisterInfo, only enabled when flags bit2 is set.
|
||||
u8 unk_x164[0x20]; ///< NfpLaAmiiboSettingsStartParam::unk_x8
|
||||
u8 unk_x184[0x24]; ///< Unknown
|
||||
} NfpLaStartParamForAmiiboSettings;
|
||||
|
||||
/// ReturnValueForAmiiboSettings
|
||||
typedef struct {
|
||||
u8 flags; ///< 0 = error, non-zero = success.
|
||||
u8 pad[3]; ///< Padding
|
||||
NfcDeviceHandle handle; ///< \ref NfcDeviceHandle
|
||||
NfpTagInfo tag_info; ///< \ref NfpTagInfo
|
||||
NfpRegisterInfo register_info; ///< \ref NfpRegisterInfo, only available when flags bit2 is set.
|
||||
u8 unk_x164[0x24]; ///< Unknown
|
||||
} NfpLaReturnValueForAmiiboSettings;
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for NicknameAndOwnerSettings.
|
||||
* @note Official sw does not expose functionality for using input/output \ref NfpTagInfo at the same time.
|
||||
* @param[in] in_param \ref NfpLaAmiiboSettingsStartParam
|
||||
* @param[in] in_tag_info \ref NfpTagInfo. Optional, can be NULL. If specified, this must match the scanned amiibo.
|
||||
* @param[in] in_reg_info \ref NfpRegisterInfo. Optional, can be NULL. If specified, this sets the \ref NfpRegisterInfo which will be used for writing, with an option for the user to change it.
|
||||
* @param[out] out_tag_info \ref NfpTagInfo. Optional, can be NULL.
|
||||
* @param[out] handle \ref NfcDeviceHandle
|
||||
* @param[out] reg_info_flag Flag indicating whether the data for out_reg_info is set. Optional, can be NULL.
|
||||
* @param[out] out_reg_info \ref NfpRegisterInfo, see reg_info_flag. Optional, can be NULL.
|
||||
*/
|
||||
Result nfpLaStartNicknameAndOwnerSettings(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, const NfpRegisterInfo *in_reg_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle, bool *reg_info_flag, NfpRegisterInfo *out_reg_info);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for GameDataEraser.
|
||||
* @note Official sw does not expose functionality for using input/output \ref NfpTagInfo at the same time.
|
||||
* @param[in] in_param \ref NfpLaAmiiboSettingsStartParam
|
||||
* @param[in] in_tag_info \ref NfpTagInfo. Optional, can be NULL. If specified, this must match the scanned amiibo.
|
||||
* @param[out] out_tag_info \ref NfpTagInfo. Optional, can be NULL.
|
||||
* @param[out] handle \ref NfcDeviceHandle
|
||||
*/
|
||||
Result nfpLaStartGameDataEraser(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for Restorer.
|
||||
* @note Official sw does not expose functionality for using input/output \ref NfpTagInfo at the same time.
|
||||
* @param[in] in_param \ref NfpLaAmiiboSettingsStartParam
|
||||
* @param[in] in_tag_info \ref NfpTagInfo. Optional, can be NULL. If specified, this must match the scanned amiibo.
|
||||
* @param[out] out_tag_info \ref NfpTagInfo. Optional, can be NULL.
|
||||
* @param[out] handle \ref NfcDeviceHandle
|
||||
*/
|
||||
Result nfpLaStartRestorer(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for Formatter.
|
||||
* @param[in] in_param \ref NfpLaAmiiboSettingsStartParam
|
||||
* @param[out] out_tag_info \ref NfpTagInfo
|
||||
* @param[out] handle \ref NfcDeviceHandle
|
||||
*/
|
||||
Result nfpLaStartFormatter(const NfpLaAmiiboSettingsStartParam *in_param, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle);
|
||||
|
@ -1,16 +0,0 @@
|
||||
/**
|
||||
* @file nifm_la.h
|
||||
* @brief Wrapper for using the nifm LibraryApplet (the launched applet varies).
|
||||
* @author yellows8
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/nifm.h"
|
||||
|
||||
/**
|
||||
* @brief Uses \ref nifmGetResult, then on failure launches the applet.
|
||||
* @param r \ref NifmRequest
|
||||
*/
|
||||
Result nifmLaHandleNetworkRequestResult(NifmRequest* r);
|
||||
|
@ -23,7 +23,6 @@ typedef enum {
|
||||
PselUiMode_LicenseRequirementsForNetworkService = 10, ///< [6.0.0+] LicenseRequirementsForNetworkService
|
||||
PselUiMode_LicenseRequirementsForNetworkServiceWithUserContextImpl = 11, ///< [7.0.0+] LicenseRequirementsForNetworkServiceWithUserContextImpl
|
||||
PselUiMode_UserCreatorForImmediateNaLoginTest = 12, ///< [7.0.0+] UserCreatorForImmediateNaLoginTest
|
||||
PselUiMode_UserQualificationPromoter = 13, ///< [13.0.0+] UserQualificationPromoter
|
||||
} PselUiMode;
|
||||
|
||||
/// UI message text to display with ::PselUiMode_UserSelector. Invalid values are handled as ::PselUserSelectionPurpose_General.
|
||||
@ -201,10 +200,3 @@ Result pselShowUserCreatorForStarter(void);
|
||||
* @param[in] user Input user ID.
|
||||
*/
|
||||
Result pselShowNintendoAccountNnidLinker(AccountUid user);
|
||||
|
||||
/**
|
||||
* @brief Shows the applet for UserQualificationPromoter.
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[in] user Input user ID.
|
||||
*/
|
||||
Result pselShowUserQualificationPromoter(AccountUid user);
|
||||
|
@ -27,7 +27,6 @@ typedef enum {
|
||||
SwkbdType_ZhHant = 6, ///< Chinese Traditional keyboard only.
|
||||
SwkbdType_Korean = 7, ///< Korean keyboard only.
|
||||
SwkbdType_All = 8, ///< All language keyboards.
|
||||
SwkbdType_Unknown9 = 9, ///< Unknown
|
||||
} SwkbdType;
|
||||
|
||||
/// Bitmask for SwkbdArgCommon::keySetDisableBitmask. This disables keys on the keyboard when the corresponding bit(s) are set.
|
||||
@ -84,17 +83,16 @@ typedef enum {
|
||||
/// SwkbdInline State
|
||||
typedef enum {
|
||||
SwkbdState_Inactive = 0x0, ///< Default state from \ref swkbdInlineCreate, before a state is set by \ref swkbdInlineUpdate when a reply is received. Also indicates that the applet is no longer running.
|
||||
SwkbdState_Initialized = 0x1, ///< Applet is initialized but hidden.
|
||||
SwkbdState_Appearing = 0x2, ///< Applet is appearing.
|
||||
SwkbdState_Shown = 0x3, ///< Applet is fully shown and ready to accept text input.
|
||||
SwkbdState_Disappearing = 0x4, ///< The user pressed the ok or cancel button, causing the applet to disappear.
|
||||
SwkbdState_Initialized = 0x1, ///< Applet is initialized.
|
||||
SwkbdState_Unknown2 = 0x2,
|
||||
SwkbdState_TextAvailable = 0x3, ///< Text is available since a ChangedString* reply was received.
|
||||
SwkbdState_Submitted = 0x4, ///< The user pressed the ok-button, submitting the text and closing the applet.
|
||||
SwkbdState_Unknown5 = 0x5,
|
||||
SwkbdState_Unknown6 = 0x6,
|
||||
} SwkbdState;
|
||||
|
||||
/// Value for \ref SwkbdInitializeArg mode. Controls the LibAppletMode when launching the applet.
|
||||
typedef enum {
|
||||
SwkbdInlineMode_UserDisplay = 0, ///< LibAppletMode_BackgroundIndirect. This is the default. The user-process must handle displaying the swkbd gfx on the screen, by loading the image with \ref swkbdInlineGetImage.
|
||||
SwkbdInlineMode_UserDisplay = 0, ///< LibAppletMode_Unknown3. This is the default. The user-process must handle displaying the swkbd gfx on the screen. Attempting to get the swkbd gfx data for this currently throws an error (unknown why), SwkbdInlineMode_AppletDisplay should be used instead.
|
||||
SwkbdInlineMode_AppletDisplay = 1, ///< LibAppletMode_Background. The applet will handle displaying gfx on the screen.
|
||||
} SwkbdInlineMode;
|
||||
|
||||
@ -116,7 +114,7 @@ typedef struct {
|
||||
u32 buffer_size; ///< 0x1000-byte aligned buffer size.
|
||||
u64 entries[0x18];
|
||||
u16 total_entries;
|
||||
} NX_PACKED SwkbdCustomizedDictionarySet;
|
||||
} PACKED SwkbdCustomizedDictionarySet;
|
||||
|
||||
/// Base swkbd arg struct.
|
||||
typedef struct {
|
||||
@ -133,7 +131,7 @@ typedef struct {
|
||||
u16 guideText[514/2];
|
||||
u16 pad_x3aa;
|
||||
u32 stringLenMax; ///< When non-zero, specifies the max string length. When the input is too long, swkbd will stop accepting more input until text is deleted via the B button (Backspace). See also \ref SwkbdTextDrawType.
|
||||
u32 stringLenMin; ///< When non-zero, specifies the min string length. When the input is too short, swkbd will display an icon and disable the ok-button.
|
||||
u32 stringLenMaxExt; ///< When non-zero, specifies the max string length. When the input is too long, swkbd will display an icon and disable the ok-button.
|
||||
u32 passwordFlag; ///< Use password: 0 = disable, 1 = enable.
|
||||
SwkbdTextDrawType textDrawType; ///< See \ref SwkbdTextDrawType.
|
||||
u16 returnButtonFlag; ///< Controls whether the Return button is enabled, for newlines input. 0 = disabled, non-zero = enabled.
|
||||
@ -186,14 +184,6 @@ typedef struct {
|
||||
u32 version;
|
||||
} SwkbdConfig;
|
||||
|
||||
/// Rect
|
||||
typedef struct {
|
||||
s16 x; ///< X
|
||||
s16 y; ///< Y
|
||||
s16 width; ///< Width
|
||||
s16 height; ///< Height
|
||||
} SwkbdRect;
|
||||
|
||||
/// InitializeArg for SwkbdInline.
|
||||
typedef struct {
|
||||
u32 unk_x0;
|
||||
@ -210,10 +200,10 @@ typedef struct {
|
||||
u8 dicFlag; ///< Enables dictionary usage when non-zero (including the system dictionary).
|
||||
u8 unk_x1b;
|
||||
u32 keySetDisableBitmask; ///< See SwkbdKeyDisableBitmask_*.
|
||||
s32 stringLenMax; ///< When non-negative and non-zero, specifies the max string length. When the input is too long, swkbd will stop accepting more input until text is deleted via the B button (Backspace).
|
||||
s32 stringLenMin; ///< When non-negative and non-zero, specifies the min string length. When the input is too short, swkbd will display an icon and disable the ok-button.
|
||||
s32 unk_x20;
|
||||
s32 unk_x24;
|
||||
u8 returnButtonFlag; ///< Controls whether the Return button is enabled, for newlines input. 0 = disabled, non-zero = enabled.
|
||||
u8 unk_x29; ///< [10.0.0+] When value 1-2, \ref swkbdInlineAppear / \ref swkbdInlineAppearEx will set keytopAsFloating=0 and footerScalable=1.
|
||||
u8 unk_x29;
|
||||
u8 unk_x2a;
|
||||
u8 unk_x2b;
|
||||
u32 flags; ///< Bitmask 0x4: unknown.
|
||||
@ -241,7 +231,7 @@ typedef struct {
|
||||
u8 alphaEnabledInInputMode; ///< Flags bitmask 0x100.
|
||||
u8 inputModeFadeType; ///< Flags bitmask 0x100.
|
||||
u8 disableTouch; ///< Flags bitmask 0x200.
|
||||
u8 disableHardwareKeyboard; ///< Flags bitmask 0x800.
|
||||
u8 disableUSBKeyboard; ///< Flags bitmask 0x800.
|
||||
u8 unk_x468[5];
|
||||
u8 unk_x46d;
|
||||
u8 unk_x46e;
|
||||
@ -381,7 +371,7 @@ void swkbdConfigMakePresetUserName(SwkbdConfig* c);
|
||||
/**
|
||||
* @brief Clears the args in the SwkbdConfig struct and initializes it with the DownloadCode Preset.
|
||||
* @note Do not use this before \ref swkbdCreate.
|
||||
* @note Uses the following: swkbdConfigSetType() with \ref SwkbdType_Normal (\ref SwkbdType_QWERTY on [5.0.0+]), swkbdConfigSetKeySetDisableBitmask() with SwkbdKeyDisableBitmask_DownloadCode, swkbdConfigSetInitialCursorPos() with value 1, and swkbdConfigSetBlurBackground() with value 1. [5.0.0+]: swkbdConfigSetStringLenMax() with value 16, swkbdConfigSetStringLenMin() with value 1, and swkbdConfigSetTextDrawType() with SwkbdTextDrawType_DownloadCode. Uses swkbdConfigSetTextGrouping() for [0-2] with: 0x3, 0x7, and 0xb.
|
||||
* @note Uses the following: swkbdConfigSetType() with \ref SwkbdType_Normal (\ref SwkbdType_QWERTY on [5.0.0+]), swkbdConfigSetKeySetDisableBitmask() with SwkbdKeyDisableBitmask_DownloadCode, swkbdConfigSetInitialCursorPos() with value 1, and swkbdConfigSetBlurBackground() with value 1. [5.0.0+]: swkbdConfigSetStringLenMax() with value 16, swkbdConfigSetStringLenMaxExt() with value 1, and swkbdConfigSetTextDrawType() with SwkbdTextDrawType_DownloadCode. Uses swkbdConfigSetTextGrouping() for [0-2] with: 0x3, 0x7, and 0xb.
|
||||
* @param c SwkbdConfig struct.
|
||||
*/
|
||||
void swkbdConfigMakePresetDownloadCode(SwkbdConfig* c);
|
||||
@ -507,12 +497,12 @@ static inline void swkbdConfigSetStringLenMax(SwkbdConfig* c, u32 stringLenMax)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets SwkbdArgCommon::stringLenMin.
|
||||
* @brief Sets SwkbdArgCommon::stringLenMaxExt.
|
||||
* @param c SwkbdConfig struct.
|
||||
* @param stringLenMin stringLenMin
|
||||
* @param stringLenMaxExt stringLenMaxExt
|
||||
*/
|
||||
static inline void swkbdConfigSetStringLenMin(SwkbdConfig* c, u32 stringLenMin) {
|
||||
c->arg.arg.arg.stringLenMin = stringLenMin;
|
||||
static inline void swkbdConfigSetStringLenMaxExt(SwkbdConfig* c, u32 stringLenMaxExt) {
|
||||
c->arg.arg.arg.stringLenMaxExt = stringLenMaxExt;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -615,63 +605,6 @@ Result swkbdInlineLaunch(SwkbdInline* s);
|
||||
*/
|
||||
Result swkbdInlineLaunchForLibraryApplet(SwkbdInline* s, u8 mode, u8 unk_x5);
|
||||
|
||||
/**
|
||||
* @brief GetWindowSize
|
||||
* @param[out] width Output width.
|
||||
* @param[out] height Output height.
|
||||
*/
|
||||
NX_CONSTEXPR void swkbdInlineGetWindowSize(s32 *width, s32 *height) {
|
||||
*width = 1280;
|
||||
*height = 720;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GetImageMemoryRequirement
|
||||
* @note Wrapper for \ref viGetIndirectLayerImageRequiredMemoryInfo.
|
||||
* @param[out] out_size Output size.
|
||||
* @param[out] out_alignment Output alignment.
|
||||
*/
|
||||
Result swkbdInlineGetImageMemoryRequirement(u64 *out_size, u64 *out_alignment);
|
||||
|
||||
/**
|
||||
* @brief GetImage
|
||||
* @note Only available with ::SwkbdInlineMode_UserDisplay.
|
||||
* @note For width/height, see \ref swkbdInlineGetWindowSize.
|
||||
* @param s SwkbdInline object.
|
||||
* @param[out] buffer Output RGBA8 image buffer, this must use the alignment from \ref swkbdInlineGetImageMemoryRequirement.
|
||||
* @param[in] size Output buffer size, this must match the size from \ref swkbdInlineGetImageMemoryRequirement.
|
||||
* @param[out] data_available Whether data is available.
|
||||
*/
|
||||
Result swkbdInlineGetImage(SwkbdInline* s, void* buffer, u64 size, bool *data_available);
|
||||
|
||||
/**
|
||||
* @brief Gets the image max height, relative to the bottom of the screen.
|
||||
* @param s SwkbdInline object.
|
||||
*/
|
||||
s32 swkbdInlineGetMaxHeight(SwkbdInline* s);
|
||||
|
||||
/**
|
||||
* @brief Gets the MiniaturizedHeight, relative to the bottom of the screen.
|
||||
* @param s SwkbdInline object.
|
||||
*/
|
||||
s32 swkbdInlineGetMiniaturizedHeight(SwkbdInline* s);
|
||||
|
||||
/**
|
||||
* @brief GetTouchRectangles. Returns number of valid Rects: 1 for only keytop, 2 for keytop/footer.
|
||||
* @param s SwkbdInline object.
|
||||
* @param[out] keytop \ref SwkbdRect for keytop. Optional, can be NULL.
|
||||
* @param[out] footer \ref SwkbdRect for footer. Optional, can be NULL.
|
||||
*/
|
||||
s32 swkbdInlineGetTouchRectangles(SwkbdInline* s, SwkbdRect *keytop, SwkbdRect *footer);
|
||||
|
||||
/**
|
||||
* @brief Gets whether the input x/y are within the output from \ref swkbdInlineGetTouchRectangles.
|
||||
* @param s SwkbdInline object.
|
||||
* @param[out] x X
|
||||
* @param[out] y Y
|
||||
*/
|
||||
bool swkbdInlineIsUsedTouchPointByKeyboard(SwkbdInline* s, s32 x, s32 y);
|
||||
|
||||
/**
|
||||
* @brief Handles updating SwkbdInline state, this should be called periodically.
|
||||
* @note Handles applet exit if needed, and also sends the \ref SwkbdInlineCalcArg to the applet if needed. Hence, this should be called at some point after writing to \ref SwkbdInlineCalcArg.
|
||||
@ -805,24 +738,6 @@ void swkbdInlineAppearArgSetLeftButtonText(SwkbdAppearArg* arg, const char* str)
|
||||
*/
|
||||
void swkbdInlineAppearArgSetRightButtonText(SwkbdAppearArg* arg, const char* str);
|
||||
|
||||
/**
|
||||
* @brief Sets the stringLenMax for the specified SwkbdAppearArg, which was previously initialized with \ref swkbdInlineMakeAppearArg.
|
||||
* @param arg \ref SwkbdAppearArg
|
||||
* @param stringLenMax Max string length
|
||||
*/
|
||||
static inline void swkbdInlineAppearArgSetStringLenMax(SwkbdAppearArg* arg, s32 stringLenMax) {
|
||||
arg->stringLenMax = stringLenMax;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the stringLenMin for the specified SwkbdAppearArg, which was previously initialized with \ref swkbdInlineMakeAppearArg.
|
||||
* @param arg \ref SwkbdAppearArg
|
||||
* @param stringLenMin Min string length
|
||||
*/
|
||||
static inline void swkbdInlineAppearArgSetStringLenMin(SwkbdAppearArg* arg, s32 stringLenMin) {
|
||||
arg->stringLenMin = stringLenMin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the audio volume.
|
||||
* @note \ref swkbdInlineUpdate must be called at some point afterwards for this to take affect.
|
||||
@ -850,7 +765,7 @@ void swkbdInlineSetCursorPos(SwkbdInline* s, s32 pos);
|
||||
|
||||
/**
|
||||
* @brief Sets the UserWordInfo.
|
||||
* @note Not available when \ref SwkbdState is above ::SwkbdState_Initialized. Can't be used if this was already used previously.
|
||||
* @note Not avilable when \ref SwkbdState is above ::SwkbdState_Initialized. Can't be used if this was already used previously.
|
||||
* @note The specified buffer must not be used after this, until \ref swkbdInlineClose is used.
|
||||
* @note \ref swkbdInlineUpdate must be called at some point afterwards.
|
||||
* @note If input==NULL or total_entries==0, this will just call \ref swkbdInlineUnsetUserWordInfo internally.
|
||||
@ -863,7 +778,7 @@ Result swkbdInlineSetUserWordInfo(SwkbdInline* s, const SwkbdDictWord *input, s3
|
||||
/**
|
||||
* @brief Request UnsetUserWordInfo.
|
||||
* @note \ref swkbdInlineUpdate must be called at some point afterwards for this to take affect.
|
||||
* @note Not available when \ref SwkbdState is above ::SwkbdState_Initialized.
|
||||
* @note Not avilable when \ref SwkbdState is above ::SwkbdState_Initialized.
|
||||
* @param s SwkbdInline object.
|
||||
*/
|
||||
Result swkbdInlineUnsetUserWordInfo(SwkbdInline* s);
|
||||
@ -879,7 +794,7 @@ void swkbdInlineSetUtf8Mode(SwkbdInline* s, bool flag);
|
||||
|
||||
/**
|
||||
* @brief Sets the CustomizeDic.
|
||||
* @note Not available when \ref SwkbdState is above ::SwkbdState_Initialized. Can't be used if this or \ref swkbdInlineSetCustomizedDictionaries was already used previously.
|
||||
* @note Not avilable when \ref SwkbdState is above ::SwkbdState_Initialized. Can't be used if this or \ref swkbdInlineSetCustomizedDictionaries was already used previously.
|
||||
* @note The specified buffer must not be used after this, until \ref swkbdInlineClose is used. However, it will also become available once \ref swkbdInlineUpdate handles SwkbdReplyType_UnsetCustomizeDic internally.
|
||||
* @param s SwkbdInline object.
|
||||
* @param buffer 0x1000-byte aligned buffer.
|
||||
@ -891,14 +806,14 @@ Result swkbdInlineSetCustomizeDic(SwkbdInline* s, void* buffer, size_t size, Swk
|
||||
/**
|
||||
* @brief Request UnsetCustomizeDic.
|
||||
* @note \ref swkbdInlineUpdate must be called at some point afterwards for this to take affect.
|
||||
* @note Not available when \ref SwkbdState is above ::SwkbdState_Initialized.
|
||||
* @note Not avilable when \ref SwkbdState is above ::SwkbdState_Initialized.
|
||||
* @param s SwkbdInline object.
|
||||
*/
|
||||
void swkbdInlineUnsetCustomizeDic(SwkbdInline* s);
|
||||
|
||||
/**
|
||||
* @brief Sets the CustomizedDictionaries.
|
||||
* @note Not available when \ref SwkbdState is above ::SwkbdState_Initialized. Can't be used if this or \ref swkbdInlineSetCustomizeDic was already used previously.
|
||||
* @note Not avilable when \ref SwkbdState is above ::SwkbdState_Initialized. Can't be used if this or \ref swkbdInlineSetCustomizeDic was already used previously.
|
||||
* @note The specified buffer in dic must not be used after this, until \ref swkbdInlineClose is used. However, it will also become available once \ref swkbdInlineUpdate handles SwkbdReplyType_UnsetCustomizedDictionaries internally.
|
||||
* @note Only available on [6.0.0+].
|
||||
* @param s SwkbdInline object.
|
||||
@ -908,7 +823,7 @@ Result swkbdInlineSetCustomizedDictionaries(SwkbdInline* s, const SwkbdCustomize
|
||||
|
||||
/**
|
||||
* @brief Request UnsetCustomizedDictionaries.
|
||||
* @note Not available when \ref SwkbdState is above ::SwkbdState_Initialized.
|
||||
* @note Not avilable when \ref SwkbdState is above ::SwkbdState_Initialized.
|
||||
* @note Only available on [6.0.0+].
|
||||
* @param s SwkbdInline object.
|
||||
*/
|
||||
@ -949,7 +864,6 @@ void swkbdInlineSetFooterBgAlpha(SwkbdInline* s, float alpha);
|
||||
/**
|
||||
* @brief Sets gfx scaling. Configures KeytopScale* and BalloonScale based on the input value.
|
||||
* @note \ref swkbdInlineUpdate must be called at some point afterwards for this to take affect.
|
||||
* @note The BalloonScale is not updated when \ref SwkbdState is above ::SwkbdState_Initialized.
|
||||
* @param s SwkbdInline object.
|
||||
* @param scale Scale
|
||||
*/
|
||||
@ -967,7 +881,6 @@ void swkbdInlineSetKeytopTranslate(SwkbdInline* s, float x, float y);
|
||||
/**
|
||||
* @brief Sets KeytopAsFloating.
|
||||
* @note \ref swkbdInlineUpdate must be called at some point afterwards for this to take affect.
|
||||
* @note Not available when \ref SwkbdState is above ::SwkbdState_Initialized.
|
||||
* @param s SwkbdInline object.
|
||||
* @param flag Flag
|
||||
*/
|
||||
@ -990,12 +903,12 @@ void swkbdInlineSetFooterScalable(SwkbdInline* s, bool flag);
|
||||
void swkbdInlineSetTouchFlag(SwkbdInline* s, bool flag);
|
||||
|
||||
/**
|
||||
* @brief Sets whether Hardware-keyboard is enabled. The default is enabled.
|
||||
* @brief Sets whether USB-keyboard is enabled. The default is enabled.
|
||||
* @note \ref swkbdInlineUpdate must be called at some point afterwards for this to take affect.
|
||||
* @param s SwkbdInline object.
|
||||
* @param flag Flag
|
||||
*/
|
||||
void swkbdInlineSetHardwareKeyboardFlag(SwkbdInline* s, bool flag);
|
||||
void swkbdInlineSetUSBKeyboardFlag(SwkbdInline* s, bool flag);
|
||||
|
||||
/**
|
||||
* @brief Sets whether DirectionalButtonAssign is enabled. The default is disabled.
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "../services/applet.h"
|
||||
#include "../services/caps.h"
|
||||
#include "../services/acc.h"
|
||||
#include "../kernel/mutex.h"
|
||||
|
||||
/// This indicates the type of web-applet.
|
||||
typedef enum {
|
||||
@ -29,7 +28,6 @@ typedef enum {
|
||||
WebExitReason_Requested = 0x2, ///< The applet exited since \ref webConfigRequestExit was used.
|
||||
WebExitReason_LastUrl = 0x3, ///< The applet exited due to LastUrl handling, see \ref webReplyGetLastUrl.
|
||||
WebExitReason_ErrorDialog = 0x7, ///< The applet exited after displaying an error dialog.
|
||||
WebExitReason_UnknownE = 0xE, ///< Unknown
|
||||
} WebExitReason;
|
||||
|
||||
/// Button values for \ref webConfigSetBootFooterButtonVisible.
|
||||
@ -44,26 +42,6 @@ typedef enum {
|
||||
WebFooterButtonId_Max, ///< Values starting with this are invalid.
|
||||
} WebFooterButtonId;
|
||||
|
||||
/// WebSessionBootMode
|
||||
typedef enum {
|
||||
WebSessionBootMode_AllForeground = 0, ///< AllForeground. This is the default.
|
||||
WebSessionBootMode_AllForegroundInitiallyHidden = 1, ///< AllForegroundInitiallyHidden
|
||||
} WebSessionBootMode;
|
||||
|
||||
/// WebSessionSendMessageKind
|
||||
typedef enum {
|
||||
WebSessionSendMessageKind_BrowserEngineContent = 0x0, ///< BrowserEngine Content
|
||||
WebSessionSendMessageKind_SystemMessageAppear = 0x100, ///< SystemMessage Appear
|
||||
WebSessionSendMessageKind_Ack = 0x1000, ///< Ack
|
||||
} WebSessionSendMessageKind;
|
||||
|
||||
/// WebSessionReceiveMessageKind
|
||||
typedef enum {
|
||||
WebSessionReceiveMessageKind_BrowserEngineContent = 0x0, ///< BrowserEngine Content
|
||||
WebSessionReceiveMessageKind_AckBrowserEngine = 0x1000, ///< Ack BrowserEngine
|
||||
WebSessionReceiveMessageKind_AckSystemMessage = 0x1001, ///< Ack SystemMessage
|
||||
} WebSessionReceiveMessageKind;
|
||||
|
||||
/// Struct for the WebWifi applet input storage.
|
||||
typedef struct {
|
||||
u32 unk_x0; ///< Official sw sets this to 0 with appletStorageWrite, separately from the rest of the config struct.
|
||||
@ -95,21 +73,21 @@ typedef struct {
|
||||
u32 pad; ///< Padding
|
||||
char lastUrl[0x1000]; ///< LastUrl string
|
||||
u64 lastUrlSize; ///< Size of LastUrl, including NUL-terminator.
|
||||
} NX_PACKED WebCommonReturnValue;
|
||||
} PACKED WebCommonReturnValue;
|
||||
|
||||
/// Header struct at offset 0 in the web Arg storage (non-webWifi).
|
||||
typedef struct {
|
||||
u16 total_entries; ///< Total \ref WebArgTLV entries following this struct.
|
||||
u16 pad; ///< Padding
|
||||
WebShimKind shimKind; ///< ShimKind
|
||||
} NX_PACKED WebArgHeader;
|
||||
} PACKED WebArgHeader;
|
||||
|
||||
/// Web TLV used in the web Arg storage.
|
||||
typedef struct {
|
||||
u16 type; ///< Type of this arg.
|
||||
u16 size; ///< Size of the arg data following this struct.
|
||||
u8 pad[4]; ///< Padding
|
||||
} NX_PACKED WebArgTLV;
|
||||
} PACKED WebArgTLV;
|
||||
|
||||
/// Config struct for web applets, non-WebWifi.
|
||||
typedef struct {
|
||||
@ -133,34 +111,7 @@ typedef struct {
|
||||
u8 visible;
|
||||
u16 unk_x5;
|
||||
u8 unk_x7;
|
||||
} NX_PACKED WebBootFooterButtonEntry;
|
||||
|
||||
/// StorageHandleQueue
|
||||
typedef struct {
|
||||
s32 read_pos;
|
||||
s32 write_pos;
|
||||
s32 max_storages;
|
||||
bool is_full;
|
||||
AppletStorage storages[0x10];
|
||||
} WebSessionStorageHandleQueue;
|
||||
|
||||
/// WebSession
|
||||
typedef struct {
|
||||
Mutex mutex;
|
||||
WebCommonConfig *config;
|
||||
struct {
|
||||
u32 count;
|
||||
u32 cur_size;
|
||||
} queue[2];
|
||||
WebSessionStorageHandleQueue storage_queue;
|
||||
} WebSession;
|
||||
|
||||
/// SessionMessageHeader
|
||||
typedef struct {
|
||||
u32 kind; ///< Message Kind (\ref WebSessionSendMessageKind / \ref WebSessionReceiveMessageKind)
|
||||
u32 size; ///< Data size following the header.
|
||||
u8 reserved[0x8]; ///< Unused
|
||||
} WebSessionMessageHeader;
|
||||
} PACKED WebBootFooterButtonEntry;
|
||||
|
||||
/// Types for \ref WebArgTLV, input storage.
|
||||
typedef enum {
|
||||
@ -224,10 +175,9 @@ typedef enum {
|
||||
WebArgType_BootFooterButton = 0x3E, ///< [6.0.0+] Array of \ref WebBootFooterButtonEntry with 0x10 entries.
|
||||
WebArgType_OverrideWebAudioVolume = 0x3F, ///< [6.0.0+] float
|
||||
WebArgType_OverrideMediaAudioVolume = 0x40, ///< [6.0.0+] float
|
||||
WebArgType_SessionBootMode = 0x41, ///< [7.0.0+] u32 enum \ref WebSessionBootMode
|
||||
WebArgType_SessionBootMode = 0x41, ///< [7.0.0+] u32 enum WebSessionBootMode
|
||||
WebArgType_SessionFlag = 0x42, ///< [7.0.0+] u8 bool, enables using WebSession when set.
|
||||
WebArgType_MediaPlayerUi = 0x43, ///< [8.0.0+] u8 bool
|
||||
WebArgType_TransferMemory = 0x44, ///< [11.0.0+] u8 bool
|
||||
} WebArgType;
|
||||
|
||||
/// Types for \ref WebArgTLV, output storage.
|
||||
@ -698,14 +648,6 @@ Result webConfigSetOverrideWebAudioVolume(WebCommonConfig* config, float value);
|
||||
*/
|
||||
Result webConfigSetOverrideMediaAudioVolume(WebCommonConfig* config, float value);
|
||||
|
||||
/**
|
||||
* @brief Sets \ref WebSessionBootMode.
|
||||
* @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [7.0.0+].
|
||||
* @param config WebCommonConfig object.
|
||||
* @param mode \ref WebSessionBootMode
|
||||
*/
|
||||
Result webConfigSetBootMode(WebCommonConfig* config, WebSessionBootMode mode);
|
||||
|
||||
/**
|
||||
* @brief Sets whether MediaPlayerUi is enabled.
|
||||
* @note Only available with config created by \ref webOfflineCreate on [8.0.0+].
|
||||
@ -714,14 +656,6 @@ Result webConfigSetBootMode(WebCommonConfig* config, WebSessionBootMode mode);
|
||||
*/
|
||||
Result webConfigSetMediaPlayerUi(WebCommonConfig* config, bool flag);
|
||||
|
||||
/**
|
||||
* @brief Sets whether TransferMemory is enabled.
|
||||
* @note Only available with config created by \ref webPageCreate on [11.0.0+].
|
||||
* @param config WebCommonConfig object.
|
||||
* @param flag Flag
|
||||
*/
|
||||
Result webConfigSetTransferMemory(WebCommonConfig* config, bool flag);
|
||||
|
||||
/**
|
||||
* @brief Launches the {web applet} with the specified config and waits for it to exit.
|
||||
* @param config WebCommonConfig object.
|
||||
@ -791,72 +725,3 @@ Result webReplyGetPostId(WebCommonReply *reply, char *outstr, size_t outstr_maxs
|
||||
*/
|
||||
Result webReplyGetMediaPlayerAutoClosedByCompletion(WebCommonReply *reply, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief Creates a \ref WebSession object.
|
||||
* @param s \ref WebSession
|
||||
* @param config WebCommonConfig object.
|
||||
*/
|
||||
void webSessionCreate(WebSession *s, WebCommonConfig* config);
|
||||
|
||||
/**
|
||||
* @brief Closes a \ref WebSession object.
|
||||
* @param s \ref WebSession
|
||||
*/
|
||||
void webSessionClose(WebSession *s);
|
||||
|
||||
/**
|
||||
* @brief Launches the applet for \ref WebSession.
|
||||
* @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [7.0.0+].
|
||||
* @note Do not use \ref webConfigShow when using WebSession.
|
||||
* @param s \ref WebSession
|
||||
* @param[out] out_event Output Event with autoclear=false, from \ref appletHolderGetExitEvent. Optional, can be NULL.
|
||||
*/
|
||||
Result webSessionStart(WebSession *s, Event **out_event);
|
||||
|
||||
/**
|
||||
* @brief Waits for the applet to exit.
|
||||
* @note This must be used before \ref webSessionClose, when \ref webSessionStart was used successfully.
|
||||
* @param s \ref WebSession
|
||||
* @param out Optional output applet reply data, can be NULL.
|
||||
*/
|
||||
Result webSessionWaitForExit(WebSession *s, WebCommonReply *out);
|
||||
|
||||
/**
|
||||
* @brief Request the applet to exit.
|
||||
* @note Use this instead of \ref webConfigRequestExit, when using WebSession.
|
||||
* @param s \ref WebSession
|
||||
*/
|
||||
Result webSessionRequestExit(WebSession *s);
|
||||
|
||||
/**
|
||||
* @brief Request the applet to Appear, this is only needed with ::WebSessionBootMode_AllForegroundInitiallyHidden.
|
||||
* @note This should not be used before \ref webSessionStart.
|
||||
* @param s \ref WebSession
|
||||
* @param[out] flag Whether the message was sent successfully.
|
||||
*/
|
||||
Result webSessionAppear(WebSession *s, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief TrySendContentMessage
|
||||
* @note This should not be used before \ref webSessionStart.
|
||||
* @note The JS-side for this is only available when JsExtension is enabled via \ref webConfigSetJsExtension.
|
||||
* @note The JS-side may ignore this if it's sent too soon after the applet launches.
|
||||
* @param s \ref WebSession
|
||||
* @param[in] content Input content NUL-terminated string.
|
||||
* @param[in] size Size of content.
|
||||
* @param[out] flag Whether the message was sent successfully.
|
||||
*/
|
||||
Result webSessionTrySendContentMessage(WebSession *s, const char *content, u32 size, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief TryReceiveContentMessage
|
||||
* @note This should not be used before \ref webSessionStart.
|
||||
* @note The JS-side for this is only available when JsExtension is enabled via \ref webConfigSetJsExtension.
|
||||
* @param s \ref WebSession
|
||||
* @param[out] content Output content string, always NUL-terminated.
|
||||
* @param[in] size Max size of content.
|
||||
* @param[out] out_size Original content size, prior to being clamped to the specified size param.
|
||||
* @param[out] flag Whether the message was received successfully.
|
||||
*/
|
||||
Result webSessionTryReceiveContentMessage(WebSession *s, char *content, u64 size, u64 *out_size, bool *flag);
|
||||
|
||||
|
@ -62,7 +62,6 @@ struct AudioDriverWaveBuf {
|
||||
bool audrvVoiceInit(AudioDriver* d, int id, int num_channels, PcmFormat format, int sample_rate);
|
||||
void audrvVoiceDrop(AudioDriver* d, int id);
|
||||
void audrvVoiceStop(AudioDriver* d, int id);
|
||||
bool audrvVoiceIsPaused(AudioDriver* d, int id);
|
||||
bool audrvVoiceIsPlaying(AudioDriver* d, int id);
|
||||
bool audrvVoiceAddWaveBuf(AudioDriver* d, int id, AudioDriverWaveBuf* wavebuf);
|
||||
u32 audrvVoiceGetWaveBufSeq(AudioDriver* d, int id);
|
||||
|
@ -24,12 +24,11 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/// Calculate a CRC32 over data using a seed.
|
||||
/// Can be used to calculate a CRC32 in chunks using an initial seed of zero for the first chunk.
|
||||
static inline u32 crc32CalculateWithSeed(u32 seed, const void *src, size_t size) {
|
||||
/// Calculate a CRC32 over data.
|
||||
static inline u32 crc32Calculate(const void *src, size_t size) {
|
||||
const u8 *src_u8 = (const u8 *)src;
|
||||
|
||||
u32 crc = ~seed;
|
||||
u32 crc = 0xFFFFFFFF;
|
||||
s64 len = size;
|
||||
|
||||
_CRC_ALIGN(u8, b);
|
||||
@ -45,20 +44,14 @@ static inline u32 crc32CalculateWithSeed(u32 seed, const void *src, size_t size)
|
||||
_CRC_REMAINDER(u16, h);
|
||||
_CRC_REMAINDER(u8, b);
|
||||
|
||||
return ~crc;
|
||||
return crc ^ 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
/// Calculate a CRC32 over data.
|
||||
static inline u32 crc32Calculate(const void *src, size_t size) {
|
||||
return crc32CalculateWithSeed(0, src, size);
|
||||
}
|
||||
|
||||
/// Calculate a CRC32C over data using a seed.
|
||||
/// Can be used to calculate a CRC32C in chunks using an initial seed of zero for the first chunk.
|
||||
static inline u32 crc32cCalculateWithSeed(u32 seed, const void *src, size_t size) {
|
||||
/// Calculate a CRC32C over data.
|
||||
static inline u32 crc32cCalculate(const void *src, size_t size) {
|
||||
const u8 *src_u8 = (const u8 *)src;
|
||||
|
||||
u32 crc = ~seed;
|
||||
u32 crc = 0xFFFFFFFF;
|
||||
s64 len = size;
|
||||
|
||||
_CRC_ALIGN(u8, cb);
|
||||
@ -74,12 +67,7 @@ static inline u32 crc32cCalculateWithSeed(u32 seed, const void *src, size_t size
|
||||
_CRC_REMAINDER(u16, ch);
|
||||
_CRC_REMAINDER(u8, cb);
|
||||
|
||||
return ~crc;
|
||||
}
|
||||
|
||||
/// Calculate a CRC32C over data.
|
||||
static inline u32 crc32cCalculate(const void *src, size_t size) {
|
||||
return crc32cCalculateWithSeed(0, src, size);
|
||||
return crc ^ 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
#undef _CRC_REMAINDER
|
||||
|
@ -11,7 +11,7 @@ typedef struct {
|
||||
} BqRect;
|
||||
|
||||
typedef struct {
|
||||
struct { s64 timestamp; } NX_PACKED;
|
||||
struct { s64 timestamp; } PACKED;
|
||||
s32 isAutoTimestamp;
|
||||
BqRect crop;
|
||||
s32 scalingMode;
|
||||
|
@ -6,19 +6,37 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../result.h"
|
||||
#include "svc.h"
|
||||
|
||||
/// Returns the kernel version that can be detected by checking kernel capabilities. This only goes from 1 (representing 1.0.0) up to 6 (representing 6.0.0 and above). Generally, \ref hosversionGet should be used instead of this function.
|
||||
int detectKernelVersion(void);
|
||||
/// Returns true if the process has a debugger attached.
|
||||
NX_INLINE bool detectDebugger(void) {
|
||||
u64 tmp = 0;
|
||||
Result rc = svcGetInfo(&tmp, InfoType_DebuggerAttached, INVALID_HANDLE, 0);
|
||||
return R_SUCCEEDED(rc) && tmp != 0;
|
||||
bool detectDebugger(void);
|
||||
/// Returns true if the kernel is patched to allow self-process-jit.
|
||||
bool detectJitKernelPatch(void);
|
||||
/// After this has been called, libnx will ignore the self-process-jit kernel patch. For testing purposes only.
|
||||
void detectIgnoreJitKernelPatch(void);
|
||||
|
||||
/// Returns true if the kernel version is equal to or above 2.0.0. Generally, \ref hosversionAtLeast should be used instead of this function.
|
||||
static inline bool kernelAbove200(void) {
|
||||
return detectKernelVersion() >= 2;
|
||||
}
|
||||
|
||||
/// Returns true if the underlying kernel is Mesosphère.
|
||||
NX_INLINE bool detectMesosphere(void) {
|
||||
u64 dummy = 0;
|
||||
Result rc = svcGetInfo(&dummy, 65000, INVALID_HANDLE, 0); // InfoType_MesosphereMeta
|
||||
return R_SUCCEEDED(rc);
|
||||
/// Returns true if the kernel version is equal to or above 3.0.0. Generally, \ref hosversionAtLeast should be used instead of this function.
|
||||
static inline bool kernelAbove300(void) {
|
||||
return detectKernelVersion() >= 3;
|
||||
}
|
||||
|
||||
/// Returns true if the kernel version is equal to or above 4.0.0. Generally, \ref hosversionAtLeast should be used instead of this function.
|
||||
static inline bool kernelAbove400(void) {
|
||||
return detectKernelVersion() >= 4;
|
||||
}
|
||||
|
||||
/// Returns true if the kernel version is equal to or above 5.0.0. Generally, \ref hosversionAtLeast should be used instead of this function.
|
||||
static inline bool kernelAbove500(void) {
|
||||
return detectKernelVersion() >= 5;
|
||||
}
|
||||
|
||||
/// Returns true if the kernel version is equal to or above 6.0.0. Generally, \ref hosversionAtLeast should be used instead of this function.
|
||||
static inline bool kernelAbove600(void) {
|
||||
return detectKernelVersion() >= 6;
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "virtmem.h"
|
||||
|
||||
/// JIT implementation type.
|
||||
typedef enum {
|
||||
@ -22,10 +21,7 @@ typedef struct {
|
||||
void* rx_addr;
|
||||
void* rw_addr;
|
||||
bool is_executable;
|
||||
union {
|
||||
Handle handle;
|
||||
VirtmemReservation* rv;
|
||||
};
|
||||
Handle handle;
|
||||
} Jit;
|
||||
|
||||
/**
|
||||
|
@ -1,54 +0,0 @@
|
||||
/**
|
||||
* @file levent.h
|
||||
* @brief Light event synchronization primitive [4.0.0+]
|
||||
* @author fincs
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../result.h"
|
||||
#include "svc.h"
|
||||
|
||||
/// User-mode light event structure.
|
||||
typedef struct LEvent {
|
||||
u32 counter;
|
||||
bool autoclear;
|
||||
} LEvent;
|
||||
|
||||
/**
|
||||
* @brief Initializes a user-mode light event.
|
||||
* @param[out] le Pointer to \ref LEvent structure.
|
||||
* @param[in] signaled Whether the event starts off in signaled state.
|
||||
* @param[in] autoclear Autoclear flag.
|
||||
*/
|
||||
NX_CONSTEXPR void leventInit(LEvent* le, bool signaled, bool autoclear) {
|
||||
le->counter = signaled ? 2 : 0;
|
||||
le->autoclear = autoclear;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Waits on a user-mode light event.
|
||||
* @param[in] le Pointer to \ref LEvent structure.
|
||||
* @param[in] timeout_ns Timeout in nanoseconds (pass UINT64_MAX to wait indefinitely).
|
||||
* @return true if wait succeeded, false if wait timed out.
|
||||
*/
|
||||
bool leventWait(LEvent* le, u64 timeout_ns);
|
||||
|
||||
/**
|
||||
* @brief Polls a user-mode light event.
|
||||
* @param[in] le Pointer to \ref LEvent structure.
|
||||
* @return true if event is signaled, false otherwise.
|
||||
*/
|
||||
bool leventTryWait(LEvent* le);
|
||||
|
||||
/**
|
||||
* @brief Signals a user-mode light event.
|
||||
* @param[in] le Pointer to \ref LEvent structure.
|
||||
*/
|
||||
void leventSignal(LEvent* le);
|
||||
|
||||
/**
|
||||
* @brief Clears a user-mode light event.
|
||||
* @param[in] le Pointer to \ref LEvent structure.
|
||||
*/
|
||||
void leventClear(LEvent* le);
|
@ -40,8 +40,6 @@ typedef enum {
|
||||
MemType_KernelStack=0x13, ///< Mapped in kernel during \ref svcCreateThread.
|
||||
MemType_CodeReadOnly=0x14, ///< Mapped in kernel during \ref svcControlCodeMemory.
|
||||
MemType_CodeWritable=0x15, ///< Mapped in kernel during \ref svcControlCodeMemory.
|
||||
MemType_Coverage=0x16, ///< Not available.
|
||||
MemType_Insecure=0x17, ///< Mapped in kernel during \ref svcMapInsecurePhysicalMemory.
|
||||
} MemoryType;
|
||||
|
||||
/// Memory state bitmasks.
|
||||
@ -69,11 +67,10 @@ typedef enum {
|
||||
|
||||
/// Memory attribute bitmasks.
|
||||
typedef enum {
|
||||
MemAttr_IsBorrowed=BIT(0), ///< Is borrowed memory.
|
||||
MemAttr_IsIpcMapped=BIT(1), ///< Is IPC mapped (when IpcRefCount > 0).
|
||||
MemAttr_IsDeviceMapped=BIT(2), ///< Is device mapped (when DeviceRefCount > 0).
|
||||
MemAttr_IsUncached=BIT(3), ///< Is uncached.
|
||||
MemAttr_IsPermissionLocked=BIT(4), ///< Is permission locked.
|
||||
MemAttr_IsBorrowed=BIT(0), ///< Is borrowed memory.
|
||||
MemAttr_IsIpcMapped=BIT(1), ///< Is IPC mapped (when IpcRefCount > 0).
|
||||
MemAttr_IsDeviceMapped=BIT(2), ///< Is device mapped (when DeviceRefCount > 0).
|
||||
MemAttr_IsUncached=BIT(3), ///< Is uncached.
|
||||
} MemoryAttribute;
|
||||
|
||||
/// Memory permission bitmasks.
|
||||
@ -94,8 +91,8 @@ typedef struct {
|
||||
u32 type; ///< Memory type (see lower 8 bits of \ref MemoryState).
|
||||
u32 attr; ///< Memory attributes (see \ref MemoryAttribute).
|
||||
u32 perm; ///< Memory permissions (see \ref Permission).
|
||||
u32 ipc_refcount; ///< IPC reference count.
|
||||
u32 device_refcount; ///< Device reference count.
|
||||
u32 ipc_refcount; ///< IPC reference count.
|
||||
u32 padding; ///< Padding.
|
||||
} MemoryInfo;
|
||||
|
||||
@ -109,21 +106,7 @@ typedef struct {
|
||||
/// Secure monitor arguments.
|
||||
typedef struct {
|
||||
u64 X[8]; ///< Values of X0 through X7.
|
||||
} NX_PACKED SecmonArgs;
|
||||
|
||||
/// Break reasons
|
||||
typedef enum {
|
||||
BreakReason_Panic = 0,
|
||||
BreakReason_Assert = 1,
|
||||
BreakReason_User = 2,
|
||||
BreakReason_PreLoadDll = 3,
|
||||
BreakReason_PostLoadDll = 4,
|
||||
BreakReason_PreUnloadDll = 5,
|
||||
BreakReason_PostUnloadDll = 6,
|
||||
BreakReason_CppException = 7,
|
||||
|
||||
BreakReason_NotificationOnlyFlag = 0x80000000,
|
||||
} BreakReason;
|
||||
} PACKED SecmonArgs;
|
||||
|
||||
/// Code memory mapping operations
|
||||
typedef enum {
|
||||
@ -206,15 +189,8 @@ typedef enum {
|
||||
InfoType_TotalNonSystemMemorySize = 21, ///< [6.0.0+] Total amount of memory available for process, excluding that for process memory management.
|
||||
InfoType_UsedNonSystemMemorySize = 22, ///< [6.0.0+] Amount of memory used by process, excluding that for process memory management.
|
||||
InfoType_IsApplication = 23, ///< [9.0.0+] Whether the specified process is an Application.
|
||||
InfoType_FreeThreadCount = 24, ///< [11.0.0+] The number of free threads available to the process's resource limit.
|
||||
InfoType_ThreadTickCount = 25, ///< [13.0.0+] Number of ticks spent on thread.
|
||||
InfoType_IsSvcPermitted = 26, ///< [14.0.0+] Does process have access to SVC (only usable with \ref svcSynchronizePreemptionState at present).
|
||||
InfoType_IoRegionHint = 27, ///< [16.0.0+] Low bits of the physical address for a KIoRegion.
|
||||
InfoType_AliasRegionExtraSize = 28, ///< [18.0.0+] Extra size added to the reserved region.
|
||||
|
||||
InfoType_TransferMemoryHint = 34, ///< [19.0.0+] Low bits of the process address for a KTransferMemory.
|
||||
|
||||
InfoType_ThreadTickCountDeprecated = 0xF0000002, ///< [1.0.0-12.1.0] Number of ticks spent on thread.
|
||||
InfoType_ThreadTickCount = 0xF0000002, ///< Number of ticks spent on thread.
|
||||
} InfoType;
|
||||
|
||||
/// GetSystemInfo IDs.
|
||||
@ -264,10 +240,9 @@ typedef enum {
|
||||
|
||||
/// WaitForAddress behaviors.
|
||||
typedef enum {
|
||||
ArbitrationType_WaitIfLessThan = 0, ///< Wait if the 32-bit value is less than argument.
|
||||
ArbitrationType_DecrementAndWaitIfLessThan = 1, ///< Decrement the 32-bit value and wait if it is less than argument.
|
||||
ArbitrationType_WaitIfEqual = 2, ///< Wait if the 32-bit value is equal to argument.
|
||||
ArbitrationType_WaitIfEqual64 = 3, ///< [19.0.0+] Wait if the 64-bit value is equal to argument.
|
||||
ArbitrationType_WaitIfLessThan = 0, ///< Wait if the value is less than argument.
|
||||
ArbitrationType_DecrementAndWaitIfLessThan = 1, ///< Decrement the value and wait if it is less than argument.
|
||||
ArbitrationType_WaitIfEqual = 2, ///< Wait if the value is equal to argument.
|
||||
} ArbitrationType;
|
||||
|
||||
/// Context of a scheduled thread.
|
||||
@ -278,25 +253,13 @@ typedef struct {
|
||||
u64 pc; ///< Program Counter for the thread.
|
||||
} LastThreadContext;
|
||||
|
||||
/// Memory mapping type.
|
||||
typedef enum {
|
||||
MemoryMapping_IoRegister = 0, ///< Mapping IO registers.
|
||||
MemoryMapping_Uncached = 1, ///< Mapping normal memory without cache.
|
||||
MemoryMapping_Memory = 2, ///< Mapping normal memory.
|
||||
} MemoryMapping;
|
||||
|
||||
/// Io Pools.
|
||||
typedef enum {
|
||||
IoPoolType_PcieA2 = 0, ///< Physical address range 0x12000000-0x1FFFFFFF
|
||||
} IoPoolType;
|
||||
|
||||
///@name Memory management
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Set the process heap to a given size. It can both extend and shrink the heap.
|
||||
* @param[out] out_addr Variable to which write the address of the heap (which is randomized and fixed by the kernel)
|
||||
* @param[in] size Size of the heap, must be a multiple of 0x200000 and [2.0.0+] less than 0x18000000.
|
||||
* @param[in] size Size of the heap, must be a multiple of 0x2000000 and [2.0.0+] less than 0x18000000.
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x01.
|
||||
*/
|
||||
@ -367,7 +330,7 @@ Result svcQueryMemory(MemoryInfo* meminfo_ptr, u32 *pageinfo, u64 addr);
|
||||
* @note Syscall number 0x07.
|
||||
*/
|
||||
|
||||
void NX_NORETURN svcExitProcess(void);
|
||||
void NORETURN svcExitProcess(void);
|
||||
|
||||
/**
|
||||
* @brief Creates a thread.
|
||||
@ -387,7 +350,7 @@ Result svcStartThread(Handle handle);
|
||||
* @brief Exits the current thread.
|
||||
* @note Syscall number 0x0A.
|
||||
*/
|
||||
void NX_NORETURN svcExitThread(void);
|
||||
void NORETURN svcExitThread(void);
|
||||
|
||||
/**
|
||||
* @brief Sleeps the current thread for the specified amount of time.
|
||||
@ -640,14 +603,14 @@ Result svcGetThreadId(u64 *threadID, Handle handle);
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Breaks execution.
|
||||
* @param[in] breakReason Break reason (see \ref BreakReason).
|
||||
* @param[in] address Address of the buffer to pass to the debugger.
|
||||
* @param[in] size Size of the buffer to pass to the debugger.
|
||||
* @brief Breaks execution. Panic.
|
||||
* @param[in] breakReason Break reason.
|
||||
* @param[in] inval1 First break parameter.
|
||||
* @param[in] inval2 Second break parameter.
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x26.
|
||||
*/
|
||||
Result svcBreak(u32 breakReason, uintptr_t address, uintptr_t size);
|
||||
Result svcBreak(u32 breakReason, u64 inval1, u64 inval2);
|
||||
|
||||
///@}
|
||||
|
||||
@ -673,7 +636,7 @@ Result svcOutputDebugString(const char *str, u64 size);
|
||||
* @param[in] res Result code.
|
||||
* @note Syscall number 0x28.
|
||||
*/
|
||||
void NX_NORETURN svcReturnFromException(Result res);
|
||||
void NORETURN svcReturnFromException(Result res);
|
||||
|
||||
/**
|
||||
* @brief Retrieves information about the system, or a certain kernel object.
|
||||
@ -812,7 +775,7 @@ Result svcGetThreadContext3(ThreadContext* ctx, Handle thread);
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x34.
|
||||
*/
|
||||
Result svcWaitForAddress(void *address, u32 arb_type, s64 value, s64 timeout);
|
||||
Result svcWaitForAddress(void *address, u32 arb_type, s32 value, s64 timeout);
|
||||
|
||||
/**
|
||||
* @brief Signals (and updates) an address depending on type and value. [4.0.0+]
|
||||
@ -838,40 +801,6 @@ void svcSynchronizePreemptionState(void);
|
||||
|
||||
///@}
|
||||
|
||||
///@name Resource Limit Management
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Gets the peak value a LimitableResource has had, for a Resource Limit handle. [11.0.0+]
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x37.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
*/
|
||||
Result svcGetResourceLimitPeakValue(s64 *out, Handle reslimit_h, LimitableResource which);
|
||||
|
||||
///@}
|
||||
|
||||
///@name Memory Management
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Creates an IO Pool. [13.0.0+]
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x39.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
*/
|
||||
Result svcCreateIoPool(Handle *out_handle, u32 pool_type);
|
||||
|
||||
/**
|
||||
* @brief Creates an IO Region. [13.0.0+]
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x3A.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
*/
|
||||
Result svcCreateIoRegion(Handle *out_handle, Handle io_pool_h, u64 physical_address, u64 size, u32 memory_mapping, u32 perm);
|
||||
|
||||
///@}
|
||||
|
||||
///@name Debugging
|
||||
///@{
|
||||
/**
|
||||
@ -966,22 +895,6 @@ Result svcCreateEvent(Handle* server_handle, Handle* client_handle);
|
||||
///@name Memory management
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Maps an IO Region. [13.0.0+]
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x46.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
*/
|
||||
Result svcMapIoRegion(Handle io_region_h, void *address, u64 size, u32 perm);
|
||||
|
||||
/**
|
||||
* @brief Undoes the effects of \ref svcMapIoRegion. [13.0.0+]
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x47.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
*/
|
||||
Result svcUnmapIoRegion(Handle io_region_h, void *address, u64 size);
|
||||
|
||||
/**
|
||||
* @brief Maps unsafe memory (usable for GPU DMA) for a system module at the desired address. [5.0.0+]
|
||||
* @return Result code.
|
||||
@ -1123,14 +1036,14 @@ Result svcQueryPhysicalAddress(PhysicalMemoryInfo *out, u64 virtaddr);
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
* @warning Only exists on [10.0.0+]. For older versions use \ref svcLegacyQueryIoMapping.
|
||||
*/
|
||||
Result svcQueryMemoryMapping(u64* virtaddr, u64* out_size, u64 physaddr, u64 size);
|
||||
Result svcQueryIoMapping(u64* virtaddr, u64* out_size, u64 physaddr, u64 size);
|
||||
|
||||
/**
|
||||
* @brief Returns a virtual address mapped to a given IO range.
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x55.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
* @warning Only exists on [1.0.0-9.2.0]. For newer versions use \ref svcQueryMemoryMapping.
|
||||
* @warning Only exists on [1.0.0-9.2.0]. For newer versions use \ref svcQueryIoMapping.
|
||||
*/
|
||||
Result svcLegacyQueryIoMapping(u64* virtaddr, u64 physaddr, u64 size);
|
||||
|
||||
@ -1170,7 +1083,7 @@ Result svcDetachDeviceAddressSpace(u64 device, Handle handle);
|
||||
* @note Syscall number 0x59.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
*/
|
||||
Result svcMapDeviceAddressSpaceByForce(Handle handle, Handle proc_handle, u64 map_addr, u64 dev_size, u64 dev_addr, u32 option);
|
||||
Result svcMapDeviceAddressSpaceByForce(Handle handle, Handle proc_handle, u64 map_addr, u64 dev_size, u64 dev_addr, u32 perm);
|
||||
|
||||
/**
|
||||
* @brief Maps an attached device address space to an userspace address.
|
||||
@ -1179,10 +1092,10 @@ Result svcMapDeviceAddressSpaceByForce(Handle handle, Handle proc_handle, u64 ma
|
||||
* @note Syscall number 0x5A.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
*/
|
||||
Result svcMapDeviceAddressSpaceAligned(Handle handle, Handle proc_handle, u64 map_addr, u64 dev_size, u64 dev_addr, u32 option);
|
||||
Result svcMapDeviceAddressSpaceAligned(Handle handle, Handle proc_handle, u64 map_addr, u64 dev_size, u64 dev_addr, u32 perm);
|
||||
|
||||
/**
|
||||
* @brief Maps an attached device address space to an userspace address. [1.0.0-12.1.0]
|
||||
* @brief Maps an attached device address space to an userspace address.
|
||||
* @return Result code.
|
||||
* @remark The userspace destination address must have the \ref MemState_MapDeviceAlignedAllowed bit set.
|
||||
* @note Syscall number 0x5B.
|
||||
@ -1570,28 +1483,10 @@ Result svcSetResourceLimitLimitValue(Handle reslimit, LimitableResource which, u
|
||||
/**
|
||||
* @brief Calls a secure monitor function (TrustZone, EL3).
|
||||
* @param regs Arguments to pass to the secure monitor.
|
||||
* @return Return value from the secure monitor.
|
||||
* @note Syscall number 0x7F.
|
||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||
*/
|
||||
void svcCallSecureMonitor(SecmonArgs* regs);
|
||||
u64 svcCallSecureMonitor(SecmonArgs* regs);
|
||||
|
||||
///@}
|
||||
|
||||
///@name Memory management
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Maps new insecure memory at the desired address. [15.0.0+]
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x90.
|
||||
*/
|
||||
Result svcMapInsecurePhysicalMemory(void *address, u64 size);
|
||||
|
||||
/**
|
||||
* @brief Undoes the effects of \ref svcMapInsecureMemory. [15.0.0+]
|
||||
* @return Result code.
|
||||
* @note Syscall number 0x91.
|
||||
*/
|
||||
Result svcUnmapInsecurePhysicalMemory(void *address, u64 size);
|
||||
|
||||
///@}
|
@ -52,7 +52,7 @@ Result threadStart(Thread* t);
|
||||
/**
|
||||
* @brief Exits the current thread immediately.
|
||||
*/
|
||||
void NX_NORETURN threadExit(void);
|
||||
void NORETURN threadExit(void);
|
||||
|
||||
/**
|
||||
* @brief Waits for a thread to finish executing.
|
||||
|
@ -72,21 +72,6 @@ static inline void* tmemGetAddr(TransferMemory* t){
|
||||
return t->map_addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Closes handle of a transfer memory object.
|
||||
* @param t Transfer memory information structure.
|
||||
* @return Result code.
|
||||
*/
|
||||
Result tmemCloseHandle(TransferMemory* t);
|
||||
|
||||
/**
|
||||
* @brief Waits until source backing memory permissions match perm.
|
||||
* @param t Transfer memory information structure.
|
||||
* @param perm Permissions which the source backing memory is expected to have before return.
|
||||
* @return Result code.
|
||||
*/
|
||||
Result tmemWaitForPermission(TransferMemory* t, Permission perm);
|
||||
|
||||
/**
|
||||
* @brief Frees up resources used by a transfer memory object, unmapping and closing handles, etc.
|
||||
* @param t Transfer memory information structure.
|
||||
|
@ -7,55 +7,30 @@
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
|
||||
/// Address space reservation type (see \ref virtmemAddReservation)
|
||||
typedef struct VirtmemReservation VirtmemReservation;
|
||||
|
||||
/// Locks the virtual memory manager mutex.
|
||||
void virtmemLock(void);
|
||||
|
||||
/// Unlocks the virtual memory manager mutex.
|
||||
void virtmemUnlock(void);
|
||||
|
||||
/**
|
||||
* @brief Finds a random slice of free general purpose address space.
|
||||
* @param size Desired size of the slice (rounded up to page alignment).
|
||||
* @param guard_size Desired size of the unmapped guard areas surrounding the slice (rounded up to page alignment).
|
||||
* @brief Reserves a slice of general purpose address space.
|
||||
* @param size The size of the slice of address space that will be reserved (rounded up to page alignment).
|
||||
* @return Pointer to the slice of address space, or NULL on failure.
|
||||
* @note The virtual memory manager mutex must be held during the find-and-map process (see \ref virtmemLock and \ref virtmemUnlock).
|
||||
*/
|
||||
void* virtmemFindAslr(size_t size, size_t guard_size);
|
||||
void* virtmemReserve(size_t size);
|
||||
|
||||
/**
|
||||
* @brief Finds a random slice of free stack address space.
|
||||
* @param size Desired size of the slice (rounded up to page alignment).
|
||||
* @param guard_size Desired size of the unmapped guard areas surrounding the slice (rounded up to page alignment).
|
||||
* @return Pointer to the slice of address space, or NULL on failure.
|
||||
* @note The virtual memory manager mutex must be held during the find-and-map process (see \ref virtmemLock and \ref virtmemUnlock).
|
||||
*/
|
||||
void* virtmemFindStack(size_t size, size_t guard_size);
|
||||
|
||||
/**
|
||||
* @brief Finds a random slice of free code memory address space.
|
||||
* @param size Desired size of the slice (rounded up to page alignment).
|
||||
* @param guard_size Desired size of the unmapped guard areas surrounding the slice (rounded up to page alignment).
|
||||
* @return Pointer to the slice of address space, or NULL on failure.
|
||||
* @note The virtual memory manager mutex must be held during the find-and-map process (see \ref virtmemLock and \ref virtmemUnlock).
|
||||
*/
|
||||
void* virtmemFindCodeMemory(size_t size, size_t guard_size);
|
||||
|
||||
/**
|
||||
* @brief Reserves a range of memory address space.
|
||||
* @param mem Pointer to the address space slice.
|
||||
* @brief Relinquishes a slice of address space reserved with virtmemReserve (currently no-op).
|
||||
* @param addr Pointer to the slice.
|
||||
* @param size Size of the slice.
|
||||
* @return Pointer to a reservation object, or NULL on failure.
|
||||
* @remark This function is intended to be used in lieu of a memory map operation when the memory won't be mapped straight away.
|
||||
* @note The virtual memory manager mutex must be held during the find-and-reserve process (see \ref virtmemLock and \ref virtmemUnlock).
|
||||
*/
|
||||
VirtmemReservation* virtmemAddReservation(void* mem, size_t size);
|
||||
void virtmemFree(void* addr, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Releases a memory address space reservation.
|
||||
* @param rv Reservation to release.
|
||||
* @note The virtual memory manager mutex must be held before calling this function (see \ref virtmemLock and \ref virtmemUnlock).
|
||||
* @brief Reserves a slice of address space inside the stack memory mapping region (for use with svcMapMemory).
|
||||
* @param size The size of the slice of address space that will be reserved (rounded up to page alignment).
|
||||
* @return Pointer to the slice of address space, or NULL on failure.
|
||||
*/
|
||||
void virtmemRemoveReservation(VirtmemReservation* rv);
|
||||
void* virtmemReserveStack(size_t size);
|
||||
|
||||
/**
|
||||
* @brief Relinquishes a slice of address space reserved with virtmemReserveStack (currently no-op).
|
||||
* @param addr Pointer to the slice.
|
||||
* @param size Size of the slice.
|
||||
*/
|
||||
void virtmemFreeStack(void* addr, size_t size);
|
||||
|
@ -10,7 +10,6 @@ typedef struct {
|
||||
|
||||
Result nvFenceInit(void);
|
||||
void nvFenceExit(void);
|
||||
u32 nvFenceGetFd(void);
|
||||
|
||||
Result nvFenceWait(NvFence* f, s32 timeout_us);
|
||||
|
||||
|
@ -13,4 +13,3 @@ const u32* nvGpuGetTpcMasks(u32 *num_masks_out);
|
||||
Result nvGpuZbcGetActiveSlotMask(u32 *out_slot, u32 *out_mask);
|
||||
Result nvGpuZbcAddColor(const u32 color_l2[4], const u32 color_ds[4], u32 format);
|
||||
Result nvGpuZbcAddDepth(float depth);
|
||||
Result nvGpuGetTimestamp(u64 *ts);
|
||||
|
@ -117,11 +117,6 @@ typedef struct {
|
||||
u32 mask;
|
||||
} nvioctl_zbc_slot_mask;
|
||||
|
||||
typedef struct {
|
||||
u64 timestamp;
|
||||
u64 reserved;
|
||||
} nvioctl_gpu_time;
|
||||
|
||||
typedef struct {
|
||||
u32 id;
|
||||
u32 value;
|
||||
@ -134,41 +129,6 @@ typedef struct {
|
||||
};
|
||||
} nvioctl_gpfifo_entry;
|
||||
|
||||
typedef struct {
|
||||
u32 mem;
|
||||
u32 offset;
|
||||
u32 words;
|
||||
} nvioctl_cmdbuf;
|
||||
|
||||
typedef struct {
|
||||
u32 cmdbuf_mem;
|
||||
u32 cmdbuf_offset;
|
||||
u32 target;
|
||||
u32 target_offset;
|
||||
} nvioctl_reloc;
|
||||
|
||||
typedef struct {
|
||||
u32 shift;
|
||||
} nvioctl_reloc_shift;
|
||||
|
||||
typedef struct {
|
||||
u32 syncpt_id;
|
||||
u32 syncpt_incrs;
|
||||
u32 waitbase_id; // Always -1
|
||||
u32 next; //< Next valid incr index, or -1
|
||||
u32 prev; //< Previous valid incr index, or -1
|
||||
} nvioctl_syncpt_incr;
|
||||
|
||||
typedef struct {
|
||||
u32 handle;
|
||||
u32 iova;
|
||||
} nvioctl_command_buffer_map;
|
||||
|
||||
typedef struct {
|
||||
u32 rate;
|
||||
u32 moduleid;
|
||||
} nvioctl_clk_rate;
|
||||
|
||||
#define NVGPU_ZBC_TYPE_INVALID 0
|
||||
#define NVGPU_ZBC_TYPE_COLOR 1
|
||||
#define NVGPU_ZBC_TYPE_DEPTH 2
|
||||
@ -259,7 +219,6 @@ Result nvioctlNvhostCtrlGpu_ZbcQueryTable(u32 fd, u32 index, nvioctl_zbc_entry *
|
||||
Result nvioctlNvhostCtrlGpu_GetCharacteristics(u32 fd, nvioctl_gpu_characteristics *out);
|
||||
Result nvioctlNvhostCtrlGpu_GetTpcMasks(u32 fd, void *buffer, size_t size);
|
||||
Result nvioctlNvhostCtrlGpu_ZbcGetActiveSlotMask(u32 fd, nvioctl_zbc_slot_mask *out);
|
||||
Result nvioctlNvhostCtrlGpu_GetGpuTime(u32 fd, nvioctl_gpu_time *out);
|
||||
|
||||
Result nvioctlNvhostAsGpu_BindChannel(u32 fd, u32 channel_fd);
|
||||
Result nvioctlNvhostAsGpu_AllocSpace(u32 fd, u32 pages, u32 page_size, u32 flags, u64 align_or_offset, u64 *offset);
|
||||
@ -288,11 +247,3 @@ Result nvioctlChannel_SetPriority(u32 fd, u32 priority);
|
||||
Result nvioctlChannel_SetTimeout(u32 fd, u32 timeout);
|
||||
Result nvioctlChannel_AllocGpfifoEx2(u32 fd, u32 num_entries, u32 flags, u32 unk0, u32 unk1, u32 unk2, u32 unk3, nvioctl_fence *fence_out);
|
||||
Result nvioctlChannel_SetUserData(u32 fd, void* addr);
|
||||
Result nvioctlChannel_Submit(u32 fd, const nvioctl_cmdbuf *cmdbufs, u32 num_cmdbufs, const nvioctl_reloc *relocs, const nvioctl_reloc_shift *reloc_shifts, u32 num_relocs,
|
||||
const nvioctl_syncpt_incr *syncpt_incrs, u32 num_syncpt_incrs, nvioctl_fence *fences, u32 num_fences);
|
||||
Result nvioctlChannel_GetSyncpt(u32 fd, u32 module_id, u32 *syncpt);
|
||||
Result nvioctlChannel_GetModuleClockRate(u32 fd, u32 module_id, u32 *freq);
|
||||
Result nvioctlChannel_SetModuleClockRate(u32 fd, u32 module_id, u32 freq);
|
||||
Result nvioctlChannel_MapCommandBuffer(u32 fd, nvioctl_command_buffer_map *maps, u32 num_maps, bool compressed);
|
||||
Result nvioctlChannel_UnmapCommandBuffer(u32 fd, const nvioctl_command_buffer_map *maps, u32 num_maps, bool compressed);
|
||||
Result nvioctlChannel_SetSubmitTimeout(u32 fd, u32 timeout);
|
||||
|
@ -125,7 +125,6 @@ enum {
|
||||
LibnxError_LibAppletBadExit,
|
||||
LibnxError_InvalidCmifOutHeader,
|
||||
LibnxError_ShouldNotHappen,
|
||||
LibnxError_Timeout,
|
||||
};
|
||||
|
||||
/// libnx binder error codes
|
||||
|
@ -1,445 +0,0 @@
|
||||
/**
|
||||
* @file btdev.h
|
||||
* @brief Wrapper around the bt/btmu services for using bluetooth BLE.
|
||||
* @note Only available on [5.0.0+].
|
||||
* @note See also: https://switchbrew.org/wiki/BTM_services
|
||||
* @author yellows8
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../services/btdrv_types.h"
|
||||
|
||||
/// GattAttribute
|
||||
typedef struct {
|
||||
u8 type; ///< Type
|
||||
BtdrvGattAttributeUuid uuid; ///< \ref BtdrvGattAttributeUuid
|
||||
u16 handle; ///< Handle
|
||||
u32 connection_handle; ///< ConnectionHandle
|
||||
} BtdevGattAttribute;
|
||||
|
||||
/// GattService
|
||||
typedef struct {
|
||||
BtdevGattAttribute attr; ///< \ref BtdevGattAttribute
|
||||
u16 instance_id; ///< InstanceId
|
||||
u16 end_group_handle; ///< EndGroupHandle
|
||||
bool primary_service; ///< PrimaryService
|
||||
} BtdevGattService;
|
||||
|
||||
/// GattCharacteristic
|
||||
typedef struct {
|
||||
BtdevGattAttribute attr; ///< \ref BtdevGattAttribute
|
||||
u16 instance_id; ///< InstanceId
|
||||
u8 properties; ///< Properties
|
||||
u64 value_size; ///< Size of value.
|
||||
u8 value[0x200]; ///< Value
|
||||
} BtdevGattCharacteristic;
|
||||
|
||||
/// GattDescriptor
|
||||
typedef struct {
|
||||
BtdevGattAttribute attr; ///< \ref BtdevGattAttribute
|
||||
u64 value_size; ///< Size of value.
|
||||
u8 value[0x200]; ///< Value
|
||||
} BtdevGattDescriptor;
|
||||
|
||||
/// Initialize bt/btmu.
|
||||
Result btdevInitialize(void);
|
||||
|
||||
/// Exit bt/btmu.
|
||||
void btdevExit(void);
|
||||
|
||||
/// Compares two \ref BtdrvGattAttributeUuid, returning whether these match.
|
||||
bool btdevGattAttributeUuidIsSame(const BtdrvGattAttributeUuid *a, const BtdrvGattAttributeUuid *b);
|
||||
|
||||
/// Wrapper for \ref btmuAcquireBleScanEvent.
|
||||
Result btdevAcquireBleScanEvent(Event* out_event);
|
||||
|
||||
/// Wrapper for \ref btmuGetBleScanFilterParameter.
|
||||
Result btdevGetBleScanParameter(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out);
|
||||
|
||||
/// Wrapper for \ref btmuGetBleScanFilterParameter2.
|
||||
Result btdevGetBleScanParameter2(u16 parameter_id, BtdrvGattAttributeUuid *out);
|
||||
|
||||
/// Wrapper for \ref btdevStartBleScanGeneral.
|
||||
Result btdevStartBleScanGeneral(BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/// Wrapper for \ref btmuStopBleScanForGeneral.
|
||||
Result btdevStopBleScanGeneral(void);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetBleScanResultsForGeneral and \ref btmuGetBleScanResultsForSmartDevice.
|
||||
* @param[out] results Output array of \ref BtdrvBleScanResult.
|
||||
* @param[in] count Size of the results array in entries.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btdevGetBleScanResult(BtdrvBleScanResult *results, u8 count, u8 *total_out);
|
||||
|
||||
/// Wrapper for \ref btmuStartBleScanForPaired.
|
||||
Result btdevEnableBleAutoConnection(BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/// Wrapper for \ref btmuStopBleScanForPaired.
|
||||
Result btdevDisableBleAutoConnection(void);
|
||||
|
||||
/// Wrapper for \ref btmuStartBleScanForSmartDevice.
|
||||
Result btdevStartBleScanSmartDevice(const BtdrvGattAttributeUuid *uuid);
|
||||
|
||||
/// Wrapper for \ref btmuStopBleScanForSmartDevice.
|
||||
Result btdevStopBleScanSmartDevice(void);
|
||||
|
||||
/// Wrapper for \ref btmuAcquireBleConnectionEvent.
|
||||
Result btdevAcquireBleConnectionStateChangedEvent(Event* out_event);
|
||||
|
||||
/// Wrapper for \ref btmuBleConnect.
|
||||
Result btdevConnectToGattServer(BtdrvAddress addr);
|
||||
|
||||
/// Wrapper for \ref btmuBleDisconnect.
|
||||
Result btdevDisconnectFromGattServer(u32 connection_handle);
|
||||
|
||||
/// Wrapper for \ref btmuBleGetConnectionState.
|
||||
Result btdevGetBleConnectionInfoList(BtdrvBleConnectionInfo *info, u8 count, u8 *total_out);
|
||||
|
||||
/// Wrapper for \ref btmuAcquireBleServiceDiscoveryEvent.
|
||||
Result btdevAcquireBleServiceDiscoveryEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetGattServices.
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[out] services Output array of \ref BtdevGattService.
|
||||
* @param[in] count Size of the services array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btdevGetGattServices(u32 connection_handle, BtdevGattService *services, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetGattService.
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[out] service \ref BtdevGattService
|
||||
* @param[out] flag Whether a \ref BtdevGattService was returned.
|
||||
*/
|
||||
Result btdevGetGattService(u32 connection_handle, const BtdrvGattAttributeUuid *uuid, BtdevGattService *service, bool *flag);
|
||||
|
||||
/// Wrapper for \ref btmuAcquireBlePairingEvent.
|
||||
Result btdevAcquireBlePairingEvent(Event* out_event);
|
||||
|
||||
/// Wrapper for \ref btmuBlePairDevice.
|
||||
Result btdevPairGattServer(u32 connection_handle, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/// Wrapper for \ref btmuBleUnPairDevice.
|
||||
Result btdevUnpairGattServer(u32 connection_handle, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/// Wrapper for \ref btmuBleUnPairDevice2.
|
||||
Result btdevUnpairGattServer2(BtdrvAddress addr, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/// Wrapper for \ref btmuBleGetPairedDevices.
|
||||
Result btdevGetPairedGattServerAddress(BtdrvBleAdvertisePacketParameter param, BtdrvAddress *addrs, u8 count, u8 *total_out);
|
||||
|
||||
/// Wrapper for \ref btmuAcquireBleMtuConfigEvent.
|
||||
Result btdevAcquireBleMtuConfigEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuConfigureBleMtu.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] mtu MTU, must be 0x18-0x200.
|
||||
*/
|
||||
Result btdevConfigureBleMtu(u32 connection_handle, u16 mtu);
|
||||
|
||||
/// Wrapper for \ref btmuGetBleMtu.
|
||||
Result btdevGetBleMtu(u32 connection_handle, u16 *out);
|
||||
|
||||
/// Wrapper for \ref btRegisterBleEvent.
|
||||
Result btdevAcquireBleGattOperationEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuRegisterBleGattDataPath.
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
*/
|
||||
Result btdevRegisterGattOperationNotification(const BtdrvGattAttributeUuid *uuid);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuUnregisterBleGattDataPath.
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
*/
|
||||
Result btdevUnregisterGattOperationNotification(const BtdrvGattAttributeUuid *uuid);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btGetLeEventInfo.
|
||||
* @param[out] out \ref BtdrvBleClientGattOperationInfo
|
||||
*/
|
||||
Result btdevGetGattOperationResult(BtdrvBleClientGattOperationInfo *out);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btLeClientReadCharacteristic.
|
||||
* @note An error is thrown if the properties from \ref btdevGattCharacteristicGetProperties don't allow using this.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
*/
|
||||
Result btdevReadGattCharacteristic(BtdevGattCharacteristic *c);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btLeClientWriteCharacteristic.
|
||||
* @note An error is thrown if the properties from \ref btdevGattCharacteristicGetProperties don't allow using this.
|
||||
* @note This uses the Value from \ref btdevGattCharacteristicSetValue.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
*/
|
||||
Result btdevWriteGattCharacteristic(BtdevGattCharacteristic *c);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btLeClientRegisterNotification / \ref btLeClientDeregisterNotification.
|
||||
* @note An error is thrown if the properties from \ref btdevGattCharacteristicGetProperties don't allow using this.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
* @param[in] flag Whether to enable/disable, controls which func to call.
|
||||
*/
|
||||
Result btdevEnableGattCharacteristicNotification(BtdevGattCharacteristic *c, bool flag);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btLeClientReadDescriptor.
|
||||
* @param d \ref BtdevGattDescriptor
|
||||
*/
|
||||
Result btdevReadGattDescriptor(BtdevGattDescriptor *d);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btLeClientWriteDescriptor.
|
||||
* @note This uses the Value from \ref btdevGattDescriptorSetValue.
|
||||
* @param d \ref BtdevGattDescriptor
|
||||
*/
|
||||
Result btdevWriteGattDescriptor(BtdevGattDescriptor *d);
|
||||
|
||||
///@name GattAttribute
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Creates a \ref BtdevGattAttribute object. This is intended for internal use.
|
||||
* @param a \ref BtdevGattAttribute
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[in] handle Handle
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
*/
|
||||
void btdevGattAttributeCreate(BtdevGattAttribute *a, const BtdrvGattAttributeUuid *uuid, u16 handle, u32 connection_handle);
|
||||
|
||||
/**
|
||||
* @brief Gets the Type.
|
||||
* @param a \ref BtdevGattAttribute
|
||||
*/
|
||||
NX_CONSTEXPR u8 btdevGattAttributeGetType(BtdevGattAttribute *a) {
|
||||
return a->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the Uuid.
|
||||
* @param a \ref BtdevGattAttribute
|
||||
* @param[out] out \ref BtdrvGattAttributeUuid
|
||||
*/
|
||||
NX_CONSTEXPR void btdevGattAttributeGetUuid(BtdevGattAttribute *a, BtdrvGattAttributeUuid *out) {
|
||||
*out = a->uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the Handle.
|
||||
* @param a \ref BtdevGattAttribute
|
||||
*/
|
||||
NX_CONSTEXPR u16 btdevGattAttributeGetHandle(BtdevGattAttribute *a) {
|
||||
return a->handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the ConnectionHandle.
|
||||
* @param a \ref BtdevGattAttribute
|
||||
*/
|
||||
NX_CONSTEXPR u32 btdevGattAttributeGetConnectionHandle(BtdevGattAttribute *a) {
|
||||
return a->connection_handle;
|
||||
}
|
||||
|
||||
///@}
|
||||
|
||||
///@name GattService
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Creates a \ref BtdevGattService object. This is intended for internal use.
|
||||
* @param s \ref BtdevGattService
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[in] handle Handle
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] instance_id InstanceId
|
||||
* @param[in] end_group_handle EndGroupHandle
|
||||
* @param[in] primary_service PrimaryService
|
||||
*/
|
||||
void btdevGattServiceCreate(BtdevGattService *s, const BtdrvGattAttributeUuid *uuid, u16 handle, u32 connection_handle, u16 instance_id, u16 end_group_handle, bool primary_service);
|
||||
|
||||
/**
|
||||
* @brief Gets the InstanceId.
|
||||
* @param s \ref BtdevGattService
|
||||
*/
|
||||
NX_CONSTEXPR u16 btdevGattServiceGetInstanceId(BtdevGattService *s) {
|
||||
return s->instance_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the EndGroupHandle.
|
||||
* @param s \ref BtdevGattService
|
||||
*/
|
||||
NX_CONSTEXPR u16 btdevGattServiceGetEndGroupHandle(BtdevGattService *s) {
|
||||
return s->end_group_handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets whether this is the PrimaryService.
|
||||
* @param s \ref BtdevGattService
|
||||
*/
|
||||
NX_CONSTEXPR u16 btdevGattServiceIsPrimaryService(BtdevGattService *s) {
|
||||
return s->primary_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetGattIncludedServices.
|
||||
* @param s \ref BtdevGattService
|
||||
* @param[out] services Output array of \ref BtdevGattService.
|
||||
* @param[in] count Size of the services array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btdevGattServiceGetIncludedServices(BtdevGattService *s, BtdevGattService *services, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetGattCharacteristics.
|
||||
* @param s \ref BtdevGattService
|
||||
* @param[out] characteristics Output array of \ref BtdevGattCharacteristic.
|
||||
* @param[in] count Size of the characteristics array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btdevGattServiceGetCharacteristics(BtdevGattService *s, BtdevGattCharacteristic *characteristics, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Same as \ref btdevGattServiceGetCharacteristics except this only returns the \ref BtdevGattCharacteristic which contains a matching \ref BtdrvGattAttributeUuid.
|
||||
* @param s \ref BtdevGattService
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[out] characteristic \ref BtdevGattCharacteristic
|
||||
* @param[out] flag Whether a \ref BtdevGattService was returned.
|
||||
*/
|
||||
Result btdevGattServiceGetCharacteristic(BtdevGattService *s, const BtdrvGattAttributeUuid *uuid, BtdevGattCharacteristic *characteristic, bool *flag);
|
||||
|
||||
///@}
|
||||
|
||||
///@name GattCharacteristic
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Creates a \ref BtdevGattCharacteristic object. This is intended for internal use.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[in] handle Handle
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] instance_id InstanceId
|
||||
* @param[in] properties Properties
|
||||
*/
|
||||
void btdevGattCharacteristicCreate(BtdevGattCharacteristic *c, const BtdrvGattAttributeUuid *uuid, u16 handle, u32 connection_handle, u16 instance_id, u8 properties);
|
||||
|
||||
/**
|
||||
* @brief Gets the InstanceId.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
*/
|
||||
NX_CONSTEXPR u16 btdevGattCharacteristicGetInstanceId(BtdevGattCharacteristic *c) {
|
||||
return c->instance_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the Properties.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
*/
|
||||
NX_CONSTEXPR u8 btdevGattCharacteristicGetProperties(BtdevGattCharacteristic *c) {
|
||||
return c->properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetBelongingGattService.
|
||||
* @note Gets the \ref BtdevGattService which belongs to this object.
|
||||
* @param c \ref BtdevGattCharacteristic.
|
||||
* @param[out] service \ref BtdevGattService
|
||||
*/
|
||||
Result btdevGattCharacteristicGetService(BtdevGattCharacteristic *c, BtdevGattService *service);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetGattDescriptors.
|
||||
* @note Gets the descriptors which belongs to this object.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
* @param[out] descriptors Output array of \ref BtdevGattDescriptor.
|
||||
* @param[in] count Size of the descriptors array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btdevGattCharacteristicGetDescriptors(BtdevGattCharacteristic *c, BtdevGattDescriptor *descriptors, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Same as \ref btdevGattCharacteristicGetDescriptors except this only returns a \ref BtdevGattDescriptor which contains a matching \ref BtdrvGattAttributeUuid.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[out] descriptor \ref BtdevGattDescriptor
|
||||
* @param[out] flag Whether a \ref BtdevGattDescriptor was returned.
|
||||
*/
|
||||
Result btdevGattCharacteristicGetDescriptor(BtdevGattCharacteristic *c, const BtdrvGattAttributeUuid *uuid, BtdevGattDescriptor *descriptor, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief Sets the Value in the object.
|
||||
* @note See also \ref btdevWriteGattCharacteristic.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
* @param[in] buffer Input buffer.
|
||||
* @param[in] size Input buffer size, max is 0x200.
|
||||
*/
|
||||
void btdevGattCharacteristicSetValue(BtdevGattCharacteristic *c, const void* buffer, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Gets the Value in the object, returns the copied value size.
|
||||
* @param c \ref BtdevGattCharacteristic
|
||||
* @param[out] buffer Output buffer.
|
||||
* @param[in] size Output buffer size, max is 0x200.
|
||||
*/
|
||||
u64 btdevGattCharacteristicGetValue(BtdevGattCharacteristic *c, void* buffer, size_t size);
|
||||
|
||||
///@}
|
||||
|
||||
///@name GattDescriptor
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Creates a \ref BtdevGattDescriptor object. This is intended for internal use.
|
||||
* @param d \ref BtdevGattDescriptor
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[in] handle Handle
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
*/
|
||||
void btdevGattDescriptorCreate(BtdevGattDescriptor *d, const BtdrvGattAttributeUuid *uuid, u16 handle, u32 connection_handle);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetBelongingGattService.
|
||||
* @note Gets the \ref BtdevGattService which belongs to this object.
|
||||
* @param d \ref BtdevGattDescriptor
|
||||
* @param[out] service \ref BtdevGattService
|
||||
*/
|
||||
Result btdevGattDescriptorGetService(BtdevGattDescriptor *d, BtdevGattService *service);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for \ref btmuGetGattCharacteristics.
|
||||
* @note Gets the \ref BtdevGattCharacteristic which belongs to this object.
|
||||
* @param d \ref BtdevGattDescriptor
|
||||
* @param[out] characteristic \ref BtdevGattCharacteristic
|
||||
*/
|
||||
Result btdevGattDescriptorGetCharacteristic(BtdevGattDescriptor *d, BtdevGattCharacteristic *characteristic);
|
||||
|
||||
/**
|
||||
* @brief Sets the Value in the object.
|
||||
* @note See also \ref btdevWriteGattDescriptor.
|
||||
* @param d \ref BtdevGattDescriptor
|
||||
* @param[in] buffer Input buffer.
|
||||
* @param[in] size Input buffer size, max is 0x200.
|
||||
*/
|
||||
void btdevGattDescriptorSetValue(BtdevGattDescriptor *d, const void* buffer, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Gets the Value in the object, returns the copied value size.
|
||||
* @param d \ref BtdevGattDescriptor
|
||||
* @param[out] buffer Output buffer.
|
||||
* @param[in] size Output buffer size, max is 0x200.
|
||||
*/
|
||||
u64 btdevGattDescriptorGetValue(BtdevGattDescriptor *d, void* buffer, size_t size);
|
||||
|
||||
///@}
|
||||
|
@ -103,8 +103,8 @@ struct PrintConsole
|
||||
int windowHeight; ///< Window height in characters
|
||||
|
||||
int tabSize; ///< Size of a tab
|
||||
u16 fg; ///< Foreground color
|
||||
u16 bg; ///< Background color
|
||||
int fg; ///< Foreground color
|
||||
int bg; ///< Background color
|
||||
int flags; ///< Reverse/bright flags
|
||||
|
||||
bool consoleInitialised; ///< True if the console is initialized
|
||||
@ -119,14 +119,13 @@ struct PrintConsole
|
||||
#define CONSOLE_COLOR_REVERSE (1<<6) ///< Reversed color text
|
||||
#define CONSOLE_CONCEAL (1<<7) ///< Concealed text
|
||||
#define CONSOLE_CROSSED_OUT (1<<8) ///< Crossed out text
|
||||
#define CONSOLE_FG_CUSTOM (1<<9) ///< Foreground custom color
|
||||
#define CONSOLE_BG_CUSTOM (1<<10) ///< Background custom color
|
||||
|
||||
/// Console debug devices supported by libnx.
|
||||
typedef enum {
|
||||
debugDevice_NULL, ///< Swallows prints to stderr
|
||||
debugDevice_SVC, ///< Outputs stderr debug statements using svcOutputDebugString, which can then be captured by interactive debuggers
|
||||
debugDevice_CONSOLE, ///< Directs stderr debug statements to Switch console window
|
||||
debugDevice_3DMOO = debugDevice_SVC,
|
||||
} debugDevice;
|
||||
|
||||
/**
|
||||
|
@ -82,14 +82,6 @@ Result romfsMountFromStorage(FsStorage storage, u64 offset, const char *name);
|
||||
*/
|
||||
Result romfsMountFromCurrentProcess(const char *name);
|
||||
|
||||
/**
|
||||
* @brief Mounts RomFS of a running program.
|
||||
* @note Permission needs to be set in the NPDM.
|
||||
* @param program_id ProgramId to mount.
|
||||
* @param name Device mount name.
|
||||
*/
|
||||
Result romfsMountDataStorageFromProgram(u64 program_id, const char *name);
|
||||
|
||||
/**
|
||||
* @brief Mounts RomFS from a file path in a mounted fsdev device.
|
||||
* @param path File path.
|
||||
|
@ -10,8 +10,10 @@ typedef enum {
|
||||
|
||||
/// Configuration structure for socketInitalize
|
||||
typedef struct {
|
||||
u32 bsdsockets_version; ///< Observed 1 on 2.0 LibAppletWeb, 2 on 3.0.
|
||||
|
||||
u32 tcp_tx_buf_size; ///< Size of the TCP transfer (send) buffer (initial or fixed).
|
||||
u32 tcp_rx_buf_size; ///< Size of the TCP receive buffer (initial or fixed).
|
||||
u32 tcp_rx_buf_size; ///< Size of the TCP recieve buffer (initial or fixed).
|
||||
u32 tcp_tx_buf_max_size; ///< Maximum size of the TCP transfer (send) buffer. If it is 0, the size of the buffer is fixed to its initial value.
|
||||
u32 tcp_rx_buf_max_size; ///< Maximum size of the TCP receive buffer. If it is 0, the size of the buffer is fixed to its initial value.
|
||||
|
||||
@ -44,15 +46,3 @@ int socketSslConnectionSetSocketDescriptor(SslConnection *c, int sockfd);
|
||||
/// Wrapper for \ref sslConnectionGetSocketDescriptor. Returns the output sockfd on success and -1 on error.
|
||||
int socketSslConnectionGetSocketDescriptor(SslConnection *c);
|
||||
|
||||
#ifdef _SOCKLEN_T_DECLARED
|
||||
struct sockaddr;
|
||||
/// Wrapper for \ref sslConnectionSetDtlsSocketDescriptor. Returns the output sockfd on success and -1 on error. errno==ENOENT indicates that no sockfd was returned, this error must be ignored.
|
||||
int socketSslConnectionSetDtlsSocketDescriptor(SslConnection *c, int sockfd, const struct sockaddr *addr, socklen_t addrlen);
|
||||
#endif
|
||||
|
||||
/// Wrapper for \ref nifmRequestRegisterSocketDescriptor. Returns 0 on success and -1 on error.
|
||||
int socketNifmRequestRegisterSocketDescriptor(NifmRequest* r, int sockfd);
|
||||
|
||||
/// Wrapper for \ref nifmRequestUnregisterSocketDescriptor. Returns 0 on success and -1 on error.
|
||||
int socketNifmRequestUnregisterSocketDescriptor(NifmRequest* r, int sockfd);
|
||||
|
||||
|
@ -18,7 +18,7 @@ typedef struct {
|
||||
Result usbCommsInitialize(void);
|
||||
|
||||
/// Initializes usbComms with a specific number of interfaces.
|
||||
Result usbCommsInitializeEx(u32 num_interfaces, const UsbCommsInterfaceInfo *infos, u16 idVendor, u16 idProduct);
|
||||
Result usbCommsInitializeEx(u32 num_interfaces, const UsbCommsInterfaceInfo *infos);
|
||||
|
||||
/// Exits usbComms.
|
||||
void usbCommsExit(void);
|
||||
@ -26,9 +26,6 @@ void usbCommsExit(void);
|
||||
/// Sets whether to throw a fatal error in usbComms{Read/Write}* on failure, or just return the transferred size. By default (false) the latter is used.
|
||||
void usbCommsSetErrorHandling(bool flag);
|
||||
|
||||
///@name Synchronous API
|
||||
///@{
|
||||
|
||||
/// Read data with the default interface.
|
||||
size_t usbCommsRead(void* buffer, size_t size);
|
||||
|
||||
@ -40,31 +37,3 @@ size_t usbCommsReadEx(void* buffer, size_t size, u32 interface);
|
||||
|
||||
/// Same as usbCommsWrite except with the specified interface.
|
||||
size_t usbCommsWriteEx(const void* buffer, size_t size, u32 interface);
|
||||
|
||||
///@}
|
||||
|
||||
///@name Asynchronous API
|
||||
///@{
|
||||
|
||||
/// Retrieve event used for read completion with the given interface.
|
||||
Event *usbCommsGetReadCompletionEvent(u32 interface);
|
||||
|
||||
/// Start an asynchronous read. The completion event will be signaled when the read completes.
|
||||
/// The buffer must be page-aligned and no larger than one page.
|
||||
Result usbCommsReadAsync(void *buffer, size_t size, u32 *urbId, u32 interface);
|
||||
|
||||
/// Complete an asynchronous read, clearing the completion event, and return the amount of data which was read.
|
||||
Result usbCommsGetReadResult(u32 urbId, u32 *transferredSize, u32 interface);
|
||||
|
||||
|
||||
/// Retrieve event used for write completion with the given interface.
|
||||
Event *usbCommsGetWriteCompletionEvent(u32 interface);
|
||||
|
||||
/// Start an asynchronous write. The completion event will be signaled when the write completes.
|
||||
/// The buffer must be page-aligned and no larger than one page.
|
||||
Result usbCommsWriteAsync(void *buffer, size_t size, u32 *urbId, u32 interface);
|
||||
|
||||
/// Complete an asynchronous write, clearing the completion event, and return the amount of data which was written.
|
||||
Result usbCommsGetWriteResult(u32 urbId, u32 *transferredSize, u32 interface);
|
||||
|
||||
///@}
|
||||
|
@ -1,15 +0,0 @@
|
||||
/**
|
||||
* @file diag.h
|
||||
* @brief Debugging and diagnostics utilities
|
||||
* @author fincs
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../result.h"
|
||||
|
||||
/**
|
||||
* @brief Aborts program execution with a result code.
|
||||
* @param[in] res Result code.
|
||||
*/
|
||||
void NX_NORETURN diagAbortWithResult(Result res);
|
@ -28,7 +28,7 @@ enum {
|
||||
EntryType_OverrideHeap=3, ///< Provides heap override information.
|
||||
EntryType_OverrideService=4, ///< Provides service override information.
|
||||
EntryType_Argv=5, ///< Provides argv.
|
||||
EntryType_SyscallAvailableHint=6, ///< Provides syscall availability hints (SVCs 0x00..0x7F).
|
||||
EntryType_SyscallAvailableHint=6, ///< Provides syscall availability hints.
|
||||
EntryType_AppletType=7, ///< Provides APT applet type.
|
||||
EntryType_AppletWorkaround=8, ///< Indicates that APT is broken and should not be used.
|
||||
EntryType_Reserved9=9, ///< Unused/reserved entry type, formerly used by StdioSockets.
|
||||
@ -37,7 +37,6 @@ enum {
|
||||
EntryType_RandomSeed=14, ///< Provides random data used to seed the pseudo-random number generator.
|
||||
EntryType_UserIdStorage=15, ///< Provides persistent storage for the preselected user id.
|
||||
EntryType_HosVersion=16, ///< Provides the currently running Horizon OS version.
|
||||
EntryType_SyscallAvailableHint2=17, ///< Provides syscall availability hints (SVCs 0x80..0xBF).
|
||||
};
|
||||
|
||||
enum {
|
||||
@ -45,7 +44,7 @@ enum {
|
||||
};
|
||||
|
||||
/// Loader return function.
|
||||
typedef void NX_NORETURN (*LoaderReturnFn)(int result_code);
|
||||
typedef void NORETURN (*LoaderReturnFn)(int result_code);
|
||||
|
||||
/**
|
||||
* @brief Parses the homebrew loader environment block (internally called).
|
||||
@ -82,7 +81,7 @@ void* envGetArgv(void);
|
||||
* @param svc Syscall number to test.
|
||||
* @returns true if the syscall is available.
|
||||
*/
|
||||
bool envIsSyscallHinted(unsigned svc);
|
||||
bool envIsSyscallHinted(u8 svc);
|
||||
|
||||
/// Returns the handle to the running homebrew process.
|
||||
Handle envGetOwnProcessHandle(void);
|
||||
|
@ -25,9 +25,6 @@ u32 hosversionGet(void);
|
||||
/// Sets or overrides the current HOS version. This function is normally called automatically by libnx on startup with the version info obtained with \ref setsysGetFirmwareVersion.
|
||||
void hosversionSet(u32 version);
|
||||
|
||||
/// Returns whether the current HOS version is augmented by running the Atmosphère custom firmware.
|
||||
bool hosversionIsAtmosphere(void);
|
||||
|
||||
/// Returns true if the current HOS version is equal to or above the specified major/minor/micro version.
|
||||
static inline bool hosversionAtLeast(u8 major, u8 minor, u8 micro) {
|
||||
return hosversionGet() >= MAKEHOSVERSION(major,minor,micro);
|
||||
|
@ -1,224 +0,0 @@
|
||||
/**
|
||||
* @file pad.h
|
||||
* @brief Simple wrapper for the HID Npad API.
|
||||
* @author fincs
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/hid.h"
|
||||
|
||||
/// Mask including all existing controller IDs.
|
||||
#define PAD_ANY_ID_MASK 0x1000100FFUL
|
||||
|
||||
/// Pad state object.
|
||||
typedef struct {
|
||||
u8 id_mask;
|
||||
u8 active_id_mask;
|
||||
bool read_handheld;
|
||||
bool active_handheld;
|
||||
u32 style_set;
|
||||
u32 attributes;
|
||||
u64 buttons_cur;
|
||||
u64 buttons_old;
|
||||
HidAnalogStickState sticks[2];
|
||||
u32 gc_triggers[2];
|
||||
} PadState;
|
||||
|
||||
/// Pad button repeater state object.
|
||||
typedef struct {
|
||||
u64 button_mask;
|
||||
s32 counter;
|
||||
u16 delay;
|
||||
u16 repeat;
|
||||
} PadRepeater;
|
||||
|
||||
/**
|
||||
* @brief Configures the input layout supported by the application.
|
||||
* @param[in] max_players The maximum supported number of players (1 to 8).
|
||||
* @param[in] style_set Bitfield of supported controller styles (see \ref HidNpadStyleTag).
|
||||
*/
|
||||
void padConfigureInput(u32 max_players, u32 style_set);
|
||||
|
||||
/**
|
||||
* @brief Initializes a \ref PadState object to read input from one or more controller input sources.
|
||||
* @param[in] _pad Pointer to \ref PadState.
|
||||
* @remarks This is a variadic macro, pass the \ref HidNpadIdType value of each controller to add to the set.
|
||||
*/
|
||||
#define padInitialize(_pad, ...) ({ \
|
||||
const HidNpadIdType _pad_ids[] = { __VA_ARGS__ }; \
|
||||
u64 _pad_mask = 0; \
|
||||
for (unsigned _pad_i = 0; _pad_i < (sizeof(_pad_ids)/sizeof(_pad_ids[0])); ++_pad_i) \
|
||||
_pad_mask |= 1UL << (_pad_ids[_pad_i]); \
|
||||
padInitializeWithMask((_pad), _pad_mask); \
|
||||
})
|
||||
|
||||
/**
|
||||
* @brief Same as \ref padInitialize, but taking a bitfield of controller IDs directly.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @param[in] mask Bitfield of controller IDs (each bit's position indicates a different \ref HidNpadIdType value).
|
||||
*/
|
||||
void padInitializeWithMask(PadState* pad, u64 mask);
|
||||
|
||||
/**
|
||||
* @brief Same as \ref padInitialize, but including every single controller input source.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @remark Use this function if you want to accept input from any controller.
|
||||
*/
|
||||
NX_INLINE void padInitializeAny(PadState* pad) {
|
||||
padInitializeWithMask(pad, PAD_ANY_ID_MASK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Same as \ref padInitialize, but including \ref HidNpadIdType_No1 and \ref HidNpadIdType_Handheld.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @remark Use this function if you just want to accept input for a single-player application.
|
||||
*/
|
||||
NX_INLINE void padInitializeDefault(PadState* pad) {
|
||||
padInitialize(pad, HidNpadIdType_No1, HidNpadIdType_Handheld);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Updates pad state by reading from the controller input sources specified during initialization.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
*/
|
||||
void padUpdate(PadState* pad);
|
||||
|
||||
/**
|
||||
* @brief Retrieves whether \ref HidNpadIdType_Handheld is an active input source (i.e. it was possible to read from it).
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @return Boolean value.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR bool padIsHandheld(const PadState* pad) {
|
||||
return pad->active_handheld;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves whether the specified controller is an active input source (i.e. it was possible to read from it).
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @param[in] id ID of the controller input source (see \ref HidNpadIdType)
|
||||
* @return Boolean value.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR bool padIsNpadActive(const PadState* pad, HidNpadIdType id) {
|
||||
if (id <= HidNpadIdType_No8)
|
||||
return pad->active_id_mask & BIT(id);
|
||||
else if (id == HidNpadIdType_Handheld)
|
||||
return pad->active_handheld;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves the set of input styles supported by the selected controller input sources.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @return Bitfield of \ref HidNpadStyleTag.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR u32 padGetStyleSet(const PadState* pad) {
|
||||
return pad->style_set;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves the set of attributes reported by the system for the selected controller input sources.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @return Bitfield of \ref HidNpadAttribute.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR u32 padGetAttributes(const PadState* pad) {
|
||||
return pad->attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves whether any of the selected controller input sources is connected.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @return Boolean value.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR bool padIsConnected(const PadState* pad) {
|
||||
return pad->attributes & HidNpadAttribute_IsConnected;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves the current set of pressed buttons across all selected controller input sources.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @return Bitfield of \ref HidNpadButton.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR u64 padGetButtons(const PadState* pad) {
|
||||
return pad->buttons_cur;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves the set of buttons that are newly pressed.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @return Bitfield of \ref HidNpadButton.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR u64 padGetButtonsDown(const PadState* pad) {
|
||||
return ~pad->buttons_old & pad->buttons_cur;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves the set of buttons that are newly released.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @return Bitfield of \ref HidNpadButton.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR u64 padGetButtonsUp(const PadState* pad) {
|
||||
return pad->buttons_old & ~pad->buttons_cur;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves the position of an analog stick in a controller.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @param[in] i ID of the analog stick to read (0=left, 1=right).
|
||||
* @return \ref HidAnalogStickState.
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
*/
|
||||
NX_CONSTEXPR HidAnalogStickState padGetStickPos(const PadState* pad, unsigned i) {
|
||||
return pad->sticks[i];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves the position of an analog trigger in a GameCube controller.
|
||||
* @param[in] pad Pointer to \ref PadState.
|
||||
* @param[in] i ID of the analog trigger to read (0=left, 1=right).
|
||||
* @return Analog trigger position (range is 0 to 0x7fff).
|
||||
* @remark \ref padUpdate must have been previously called.
|
||||
* @remark \ref HidNpadStyleTag_NpadGc must have been previously configured as a supported style in \ref padConfigureInput for GC trigger data to be readable.
|
||||
*/
|
||||
NX_CONSTEXPR u32 padGetGcTriggerPos(const PadState* pad, unsigned i) {
|
||||
return pad->gc_triggers[i];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes a \ref PadRepeater object with the specified settings.
|
||||
* @param[in] r Pointer to \ref PadRepeater.
|
||||
* @param[in] delay Number of input updates between button presses being first detected and them being considered for repeat.
|
||||
* @param[in] repeat Number of input updates between autogenerated repeat button presses.
|
||||
*/
|
||||
NX_CONSTEXPR void padRepeaterInitialize(PadRepeater* r, u16 delay, u16 repeat) {
|
||||
r->button_mask = 0;
|
||||
r->counter = 0;
|
||||
r->delay = delay;
|
||||
r->repeat = repeat;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Updates pad repeat state.
|
||||
* @param[in] r Pointer to \ref PadRepeater.
|
||||
* @param[in] button_mask Bitfield of currently pressed \ref HidNpadButton that will be considered for repeat.
|
||||
*/
|
||||
void padRepeaterUpdate(PadRepeater* r, u64 button_mask);
|
||||
|
||||
/**
|
||||
* @brief Retrieves the set of buttons that are being repeated according to the parameters specified in \ref padRepeaterInitialize.
|
||||
* @param[in] r Pointer to \ref PadRepeater.
|
||||
* @return Bitfield of \ref HidNpadButton.
|
||||
* @remark It is suggested to bitwise-OR the return value of this function with that of \ref padGetButtonsDown.
|
||||
*/
|
||||
NX_CONSTEXPR u64 padRepeaterGetButtons(const PadRepeater* r) {
|
||||
return r->counter == 0 ? r->button_mask : 0;
|
||||
}
|
@ -49,7 +49,7 @@ typedef struct {
|
||||
/// Polling data extracted from \ref HidbusJoyPollingReceivedData.
|
||||
typedef struct {
|
||||
s16 data; ///< Sensor state data.
|
||||
u64 sampling_number; ///< SamplingNumber
|
||||
u64 timestamp; ///< Sample timestamp.
|
||||
} RingConPollingData;
|
||||
|
||||
/// Ring-Con state object.
|
||||
@ -58,7 +58,7 @@ typedef struct {
|
||||
HidbusBusHandle handle;
|
||||
void* workbuf;
|
||||
size_t workbuf_size;
|
||||
u64 polling_last_sampling_number;
|
||||
u64 polling_last_timestamp;
|
||||
u32 error_flags;
|
||||
|
||||
u64 id_l, id_h;
|
||||
@ -74,9 +74,9 @@ typedef struct {
|
||||
/**
|
||||
* @brief Creates a \ref RingCon object, and handles the various initialization for it.
|
||||
* @param c \ref RingCon
|
||||
* @param[in] id \ref HidNpadIdType. A Ring-Con must be attached to this controller.
|
||||
* @param[in] id \ref HidControllerID. A Ring-Con must be attached to this controller.
|
||||
*/
|
||||
Result ringconCreate(RingCon *c, HidNpadIdType id);
|
||||
Result ringconCreate(RingCon *c, HidControllerID id);
|
||||
|
||||
/**
|
||||
* @brief Close a \ref RingCon.
|
||||
|
@ -10,16 +10,15 @@
|
||||
|
||||
/// PerformanceMode
|
||||
typedef enum {
|
||||
ApmPerformanceMode_Invalid = -1, ///< Invalid
|
||||
ApmPerformanceMode_Normal = 0, ///< Normal
|
||||
ApmPerformanceMode_Boost = 1, ///< Boost
|
||||
ApmPerformanceMode_Handheld = 0, ///< Handheld
|
||||
ApmPerformanceMode_Docked = 1, ///< Docked
|
||||
} ApmPerformanceMode;
|
||||
|
||||
/// CpuBoostMode. With \ref appletSetCpuBoostMode, only values 0/1 are available. This allows using higher clock rates.
|
||||
typedef enum {
|
||||
ApmCpuBoostMode_Normal = 0, ///< Default, boost-mode disabled.
|
||||
ApmCpuBoostMode_FastLoad = 1, ///< Boost CPU. Additionally, throttle GPU to minimum. Use performance configurations 0x92220009 (Docked) and 0x9222000A (Handheld), or 0x9222000B and 0x9222000C.
|
||||
ApmCpuBoostMode_Type2 = 2, ///< Conserve power. Only throttle GPU to minimum. Use performance configurations 0x9222000B and 0x9222000C.
|
||||
ApmCpuBoostMode_Disabled = 0, ///< Default, use normal PerformanceConfiguration.
|
||||
ApmCpuBoostMode_Type1 = 1, ///< Use performance configurations 0x92220009 (Docked) and 0x9222000A (Handheld), or 0x9222000B and 0x9222000C. All of these use the normal GPU clock rate for Docked-mode. The latter pair uses the normal CPU clock rate, while the former pair uses the maximum TX1 CPU clock rate. Memory clock rate is the same as normal.
|
||||
ApmCpuBoostMode_Type2 = 2, ///< Use performance configurations 0x9222000B and 0x9222000C.
|
||||
} ApmCpuBoostMode;
|
||||
|
||||
/// Initialize apm. Used automatically by \ref appletInitialize with AppletType_Application.
|
||||
|
@ -32,8 +32,8 @@ typedef enum {
|
||||
|
||||
/// OperationMode
|
||||
typedef enum {
|
||||
AppletOperationMode_Handheld = 0, ///< Handheld
|
||||
AppletOperationMode_Console = 1, ///< Console (Docked / TV-mode)
|
||||
AppletOperationMode_Handheld = 0,
|
||||
AppletOperationMode_Docked = 1,
|
||||
} AppletOperationMode;
|
||||
|
||||
/// applet hook types.
|
||||
@ -42,9 +42,9 @@ typedef enum {
|
||||
AppletHookType_OnOperationMode, ///< ::AppletMessage_OperationModeChanged
|
||||
AppletHookType_OnPerformanceMode, ///< ::AppletMessage_PerformanceModeChanged
|
||||
AppletHookType_OnExitRequest, ///< ::AppletMessage_ExitRequested
|
||||
AppletHookType_OnResume, ///< ::AppletMessage_Resume
|
||||
AppletHookType_OnRestart, ///< ::AppletMessage_Restart
|
||||
AppletHookType_OnCaptureButtonShortPressed, ///< ::AppletMessage_CaptureButtonShortPressed
|
||||
AppletHookType_OnAlbumScreenShotTaken, ///< ::AppletMessage_AlbumScreenShotTaken
|
||||
AppletHookType_OnAlbumImageTaken, ///< ::AppletMessage_AlbumImageTaken
|
||||
AppletHookType_RequestToDisplay, ///< ::AppletMessage_RequestToDisplay
|
||||
|
||||
AppletHookType_Max, ///< Number of applet hook types.
|
||||
@ -52,32 +52,31 @@ typedef enum {
|
||||
|
||||
/// AppletMessage, for \ref appletGetMessage. See also \ref AppletHookType.
|
||||
typedef enum {
|
||||
AppletMessage_ExitRequest = 4, ///< Exit request.
|
||||
AppletMessage_FocusStateChanged = 15, ///< FocusState changed.
|
||||
AppletMessage_Resume = 16, ///< Current applet execution was resumed.
|
||||
AppletMessage_OperationModeChanged = 30, ///< OperationMode changed.
|
||||
AppletMessage_PerformanceModeChanged = 31, ///< PerformanceMode changed.
|
||||
AppletMessage_RequestToDisplay = 51, ///< Display requested, see \ref appletApproveToDisplay.
|
||||
AppletMessage_CaptureButtonShortPressed = 90, ///< Capture button was short-pressed.
|
||||
AppletMessage_AlbumScreenShotTaken = 92, ///< Screenshot was taken.
|
||||
AppletMessage_AlbumRecordingSaved = 93, ///< AlbumRecordingSaved
|
||||
AppletMessage_ExitRequested = 0x4, ///< Exit requested.
|
||||
AppletMessage_FocusStateChanged = 0xF, ///< FocusState changed.
|
||||
AppletMessage_Restart = 0x10, ///< Current applet execution was resumed.
|
||||
AppletMessage_OperationModeChanged = 0x1E, ///< OperationMode changed.
|
||||
AppletMessage_PerformanceModeChanged = 0x1F, ///< PerformanceMode changed.
|
||||
AppletMessage_RequestToDisplay = 0x33, ///< Display requested, see \ref appletApproveToDisplay.
|
||||
AppletMessage_CaptureButtonShortPressed = 0x5A, ///< Capture button was short-pressed.
|
||||
AppletMessage_AlbumImageTaken = 0x5C, ///< Screenshot was taken.
|
||||
} AppletMessage;
|
||||
|
||||
/// FocusState
|
||||
typedef enum {
|
||||
AppletFocusState_InFocus = 1, ///< Applet is focused.
|
||||
AppletFocusState_OutOfFocus = 2, ///< Out of focus - LibraryApplet open.
|
||||
AppletFocusState_Background = 3 ///< Out of focus - HOME menu open / console is sleeping.
|
||||
AppletFocusState_Focused = 1, ///< Applet is focused.
|
||||
AppletFocusState_NotFocusedLibraryApplet = 2, ///< Out of focus - LibraryApplet open.
|
||||
AppletFocusState_NotFocusedHomeSleep = 3 ///< Out of focus - HOME menu open / console is sleeping.
|
||||
} AppletFocusState;
|
||||
|
||||
/// FocusHandlingMode
|
||||
typedef enum {
|
||||
AppletFocusHandlingMode_SuspendHomeSleep = 0, ///< Suspend only when HOME menu is open / console is sleeping (default).
|
||||
AppletFocusHandlingMode_NoSuspend, ///< Don't suspend when out of focus.
|
||||
AppletFocusHandlingMode_SuspendHomeSleepNotify, ///< Suspend only when HOME menu is open / console is sleeping but still receive OnFocusState hook.
|
||||
AppletFocusHandlingMode_AlwaysSuspend, ///< Always suspend when out of focus, regardless of the reason.
|
||||
AppletFocusHandlingMode_SuspendHomeSleep = 0, ///< Suspend only when HOME menu is open / console is sleeping (default).
|
||||
AppletFocusHandlingMode_NoSuspend, ///< Don't suspend when out of focus.
|
||||
AppletFocusHandlingMode_SuspendHomeSleepNotify, ///< Suspend only when HOME menu is open / console is sleeping but still receive OnFocusState hook.
|
||||
AppletFocusHandlingMode_AlwaysSuspend, ///< Always suspend when out of focus, regardless of the reason.
|
||||
|
||||
AppletFocusHandlingMode_Max, ///< Number of focus handling modes.
|
||||
AppletFocusHandlingMode_Max, ///< Number of focus handling modes.
|
||||
} AppletFocusHandlingMode;
|
||||
|
||||
/// LaunchParameterKind
|
||||
@ -89,28 +88,27 @@ typedef enum {
|
||||
|
||||
/// AppletId
|
||||
typedef enum {
|
||||
AppletId_None = 0x00, ///< None
|
||||
AppletId_application = 0x01, ///< Application. Not valid for use with LibraryApplets.
|
||||
AppletId_OverlayApplet = 0x02, ///< 010000000000100C "overlayDisp"
|
||||
AppletId_SystemAppletMenu = 0x03, ///< 0100000000001000 "qlaunch" (SystemAppletMenu)
|
||||
AppletId_SystemApplication = 0x04, ///< 0100000000001012 "starter" SystemApplication.
|
||||
AppletId_LibraryAppletAuth = 0x0A, ///< 0100000000001001 "auth"
|
||||
AppletId_LibraryAppletCabinet = 0x0B, ///< 0100000000001002 "cabinet"
|
||||
AppletId_LibraryAppletController = 0x0C, ///< 0100000000001003 "controller"
|
||||
AppletId_LibraryAppletDataErase = 0x0D, ///< 0100000000001004 "dataErase"
|
||||
AppletId_LibraryAppletError = 0x0E, ///< 0100000000001005 "error"
|
||||
AppletId_LibraryAppletNetConnect = 0x0F, ///< 0100000000001006 "netConnect"
|
||||
AppletId_LibraryAppletPlayerSelect = 0x10, ///< 0100000000001007 "playerSelect"
|
||||
AppletId_LibraryAppletSwkbd = 0x11, ///< 0100000000001008 "swkbd"
|
||||
AppletId_LibraryAppletMiiEdit = 0x12, ///< 0100000000001009 "miiEdit"
|
||||
AppletId_LibraryAppletWeb = 0x13, ///< 010000000000100A "LibAppletWeb" WebApplet applet
|
||||
AppletId_LibraryAppletShop = 0x14, ///< 010000000000100B "LibAppletShop" ShopN applet
|
||||
AppletId_LibraryAppletPhotoViewer = 0x15, ///< 010000000000100D "photoViewer"
|
||||
AppletId_LibraryAppletSet = 0x16, ///< 010000000000100E "set" (This applet is currently not present on retail devices.)
|
||||
AppletId_LibraryAppletOfflineWeb = 0x17, ///< 010000000000100F "LibAppletOff" offlineWeb applet
|
||||
AppletId_LibraryAppletLoginShare = 0x18, ///< 0100000000001010 "LibAppletLns" loginShare web-applet
|
||||
AppletId_LibraryAppletWifiWebAuth = 0x19, ///< 0100000000001011 "LibAppletAuth" wifiWebAuth applet
|
||||
AppletId_LibraryAppletMyPage = 0x1A, ///< 0100000000001013 "myPage"
|
||||
AppletId_application = 0x01, ///< Application. Not valid for use with LibraryApplets.
|
||||
AppletId_overlayDisp = 0x02, ///< 010000000000100C "overlayDisp"
|
||||
AppletId_qlaunch = 0x03, ///< 0100000000001000 "qlaunch" (SystemAppletMenu)
|
||||
AppletId_starter = 0x04, ///< 0100000000001012 "starter" SystemApplication.
|
||||
AppletId_auth = 0x0A, ///< 0100000000001001 "auth"
|
||||
AppletId_cabinet = 0x0B, ///< 0100000000001002 "cabinet"
|
||||
AppletId_controller = 0x0C, ///< 0100000000001003 "controller"
|
||||
AppletId_dataErase = 0x0D, ///< 0100000000001004 "dataErase"
|
||||
AppletId_error = 0x0E, ///< 0100000000001005 "error"
|
||||
AppletId_netConnect = 0x0F, ///< 0100000000001006 "netConnect"
|
||||
AppletId_playerSelect = 0x10, ///< 0100000000001007 "playerSelect"
|
||||
AppletId_swkbd = 0x11, ///< 0100000000001008 "swkbd"
|
||||
AppletId_miiEdit = 0x12, ///< 0100000000001009 "miiEdit"
|
||||
AppletId_web = 0x13, ///< 010000000000100A "LibAppletWeb" WebApplet applet
|
||||
AppletId_shop = 0x14, ///< 010000000000100B "LibAppletShop" ShopN applet
|
||||
AppletId_photoViewer = 0x15, ///< 010000000000100D "photoViewer"
|
||||
AppletId_set = 0x16, ///< 010000000000100E "set" (This applet is currently not present on retail devices.)
|
||||
AppletId_offlineWeb = 0x17, ///< 010000000000100F "LibAppletOff" Offline web-applet
|
||||
AppletId_loginShare = 0x18, ///< 0100000000001010 "LibAppletLns" Whitelisted web-applet
|
||||
AppletId_wifiWebAuth = 0x19, ///< 0100000000001011 "LibAppletAuth" WifiWebAuth applet
|
||||
AppletId_myPage = 0x1A, ///< 0100000000001013 "myPage"
|
||||
} AppletId;
|
||||
|
||||
/// LibraryAppletMode
|
||||
@ -188,8 +186,8 @@ typedef enum {
|
||||
|
||||
/// Input mode values for \ref appletSetWirelessPriorityMode.
|
||||
typedef enum {
|
||||
AppletWirelessPriorityMode_Default = 1, ///< Default
|
||||
AppletWirelessPriorityMode_OptimizedForWlan = 2, ///< OptimizedForWlan
|
||||
AppletWirelessPriorityMode_Unknown1 = 1, ///< Unknown.
|
||||
AppletWirelessPriorityMode_Unknown2 = 2, ///< Unknown.
|
||||
} AppletWirelessPriorityMode;
|
||||
|
||||
/// CaptureSharedBuffer for the IDisplayController commands.
|
||||
@ -199,12 +197,6 @@ typedef enum {
|
||||
AppletCaptureSharedBuffer_CallerApplet = 2, ///< CallerApplet
|
||||
} AppletCaptureSharedBuffer;
|
||||
|
||||
/// WindowOriginMode
|
||||
typedef enum {
|
||||
AppletWindowOriginMode_LowerLeft = 0, ///< LowerLeft
|
||||
AppletWindowOriginMode_UpperLeft = 1, ///< UpperLeft
|
||||
} AppletWindowOriginMode;
|
||||
|
||||
/// ProgramSpecifyKind for the ExecuteProgram cmd. Controls the type of the u64 passed to the ExecuteProgram cmd.
|
||||
typedef enum {
|
||||
AppletProgramSpecifyKind_ExecuteProgram = 0, ///< u8 ProgramIndex.
|
||||
@ -255,11 +247,6 @@ typedef struct {
|
||||
AppletApplicationExitReason exitreason; ///< Set by \ref appletApplicationJoin using the output from cmd GetResult, see \ref AppletApplicationExitReason.
|
||||
} AppletApplication;
|
||||
|
||||
/// GpuErrorHandler
|
||||
typedef struct {
|
||||
Service s; ///< IGpuErrorHandler
|
||||
} AppletGpuErrorHandler;
|
||||
|
||||
/// Used by \ref appletInitialize with __nx_applet_AppletAttribute for cmd OpenLibraryAppletProxy (AppletType_LibraryApplet), on [3.0.0+]. The default for this struct is all-zero.
|
||||
typedef struct {
|
||||
u8 flag; ///< Flag. When non-zero, two state fields are set to 1.
|
||||
@ -344,10 +331,10 @@ Service* appletGetServiceSession_Proxy(void);
|
||||
/// Gets the Service object for IAppletCommonFunctions. Only initialized with AppletType_SystemApplet, AppletType_LibraryApplet, or AppletType_OverlayApplet, on [7.0.0+].
|
||||
Service* appletGetServiceSession_AppletCommonFunctions(void);
|
||||
|
||||
/// Gets the Service object for I*Functions, specific to each AppletType (IApplicationFunctions for AppletType_*Application). Not initialized with AppletType_LibraryApplet pre-15.0.0. On [15.0.0+] with AppletType_LibraryApplet this returns the object for IHomeMenuFunctions.
|
||||
/// Gets the Service object for I*Functions, specific to each AppletType (IApplicationFunctions for AppletType_*Application). Not initialized with AppletType_LibraryApplet.
|
||||
Service* appletGetServiceSession_Functions(void);
|
||||
|
||||
/// Gets the Service object for IGlobalStateController. Only initialized with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
/// Gets the Service object for IGlobalStateController. Only initialized with AppletType_SystemApplet.
|
||||
Service* appletGetServiceSession_GlobalStateController(void);
|
||||
|
||||
/// Gets the Service object for IApplicationCreator. Only initialized with AppletType_SystemApplet.
|
||||
@ -424,13 +411,6 @@ Result appletReleaseSleepLock(void);
|
||||
*/
|
||||
Result appletReleaseSleepLockTransiently(void);
|
||||
|
||||
/**
|
||||
* @brief GetWakeupCount
|
||||
* @note Only available with [11.0.0+].
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result appletGetWakeupCount(u64 *out);
|
||||
|
||||
/**
|
||||
* @brief Pushes a storage to the general channel. Used for sending requests to SystemApplet.
|
||||
* @note This is not usable under an Application, however it is usable under a LibraryApplet.
|
||||
@ -502,17 +482,6 @@ Result appletSetLcdBacklightOffEnabled(bool flag);
|
||||
*/
|
||||
Result appletIsInControllerFirmwareUpdateSection(bool *out);
|
||||
|
||||
/**
|
||||
* @brief SetVrPositionForDebug
|
||||
* @note The cached value loaded from \ref setsysGetDebugModeFlag must be 1, otherwise an error is returned.
|
||||
* @note Only available with [11.0.0+].
|
||||
* @param[in] x X, must not be negative. x+width must be <=1280.
|
||||
* @param[in] y Y, must not be negative. y+height must be <=720.
|
||||
* @param[in] width Width, must be 1-1280.
|
||||
* @param[in] height Height, must be 1-720.
|
||||
*/
|
||||
Result appletSetVrPositionForDebug(s32 x, s32 y, s32 width, s32 height);
|
||||
|
||||
/**
|
||||
* @brief Gets the DefaultDisplayResolution.
|
||||
* @note Only available with [3.0.0+].
|
||||
@ -572,13 +541,6 @@ Result appletSetCpuBoostMode(ApmCpuBoostMode mode);
|
||||
*/
|
||||
Result appletCancelCpuBoostMode(void);
|
||||
|
||||
/**
|
||||
* @brief GetBuiltInDisplayType
|
||||
* @note Only available with [11.0.0+].
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result appletGetBuiltInDisplayType(s32 *out);
|
||||
|
||||
/**
|
||||
* @brief Perform SystemButtonPressing with the specified \ref AppletSystemButtonType. Internally this cmd checks a state field, verifies that the type is allowed, then runs the same func as \ref appletPerformSystemButtonPressing internally.
|
||||
* @note Only available with [6.0.0+].
|
||||
@ -600,14 +562,6 @@ Result appletSetPerformanceConfigurationChangedNotification(bool flag);
|
||||
*/
|
||||
Result appletGetCurrentPerformanceConfiguration(u32 *PerformanceConfiguration);
|
||||
|
||||
/**
|
||||
* @brief Opens an \ref AppletGpuErrorHandler.
|
||||
* @note The cached value loaded from \ref setsysGetDebugModeFlag must be 1, otherwise an error is returned.
|
||||
* @note Only available with [11.0.0+].
|
||||
* @param[out] g \ref AppletGpuErrorHandler
|
||||
*/
|
||||
Result appletOpenMyGpuErrorHandler(AppletGpuErrorHandler *g);
|
||||
|
||||
/**
|
||||
* @brief Gets the OperationModeSystemInfo.
|
||||
* @note Only available with [7.0.0+].
|
||||
@ -634,66 +588,6 @@ Result appletActivateMigrationService(void);
|
||||
*/
|
||||
Result appletDeactivateMigrationService(void);
|
||||
|
||||
/**
|
||||
* @brief DisableSleepTillShutdown
|
||||
* @note Only available with [11.0.0+].
|
||||
*/
|
||||
Result appletDisableSleepTillShutdown(void);
|
||||
|
||||
/**
|
||||
* @brief SuppressDisablingSleepTemporarily
|
||||
* @param[in] val Nanoseconds value.
|
||||
* @note Only available with [11.0.0+].
|
||||
*/
|
||||
Result appletSuppressDisablingSleepTemporarily(u64 val);
|
||||
|
||||
/**
|
||||
* @brief SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled
|
||||
* @note Only available with [11.0.0+].
|
||||
*/
|
||||
Result appletSetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(void);
|
||||
|
||||
///@}
|
||||
|
||||
///@name IGpuErrorHandler
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Close an \ref AppletGpuErrorHandler.
|
||||
* @param g \ref AppletGpuErrorHandler
|
||||
*/
|
||||
void appletGpuErrorHandlerClose(AppletGpuErrorHandler *g);
|
||||
|
||||
/**
|
||||
* @brief Gets the size of the info available with \ref appletGpuErrorHandlerGetManualGpuErrorInfo.
|
||||
* @param g \ref AppletGpuErrorHandler
|
||||
* @param[out] out Output size.
|
||||
*/
|
||||
Result appletGpuErrorHandlerGetManualGpuErrorInfoSize(AppletGpuErrorHandler *g, u64 *out);
|
||||
|
||||
/**
|
||||
* @brief GetManualGpuErrorInfo
|
||||
* @param g \ref AppletGpuErrorHandler
|
||||
* @param[out] buffer Output buffer.
|
||||
* @param[in] size Output buffer size, must be >= the output size from \ref appletGpuErrorHandlerGetManualGpuErrorInfoSize.
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result appletGpuErrorHandlerGetManualGpuErrorInfo(AppletGpuErrorHandler *g, void* buffer, size_t size, u64 *out);
|
||||
|
||||
/**
|
||||
* @brief GetManualGpuErrorDetectionSystemEvent
|
||||
* @param g \ref AppletGpuErrorHandler
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=false.
|
||||
*/
|
||||
Result appletGpuErrorHandlerGetManualGpuErrorDetectionSystemEvent(AppletGpuErrorHandler *g, Event *out_event);
|
||||
|
||||
/**
|
||||
* @brief FinishManualGpuErrorHandling
|
||||
* @param g \ref AppletGpuErrorHandler
|
||||
*/
|
||||
Result appletGpuErrorHandlerFinishManualGpuErrorHandling(AppletGpuErrorHandler *g);
|
||||
|
||||
///@}
|
||||
|
||||
///@name ISelfController
|
||||
@ -727,7 +621,7 @@ Result appletLeaveFatalSection(void);
|
||||
Result appletSetScreenShotPermission(AppletScreenShotPermission permission);
|
||||
|
||||
/**
|
||||
* @brief Sets whether ::AppletMessage_Resume is enabled.
|
||||
* @brief Sets whether ::AppletMessage_Restart is enabled.
|
||||
* @param[in] flag Whether to enable the notification.
|
||||
*/
|
||||
Result appletSetRestartMessageEnabled(bool flag);
|
||||
@ -909,7 +803,7 @@ Result appletSetWirelessPriorityMode(AppletWirelessPriorityMode mode);
|
||||
Result appletGetProgramTotalActiveTime(u64 *activeTime);
|
||||
|
||||
/**
|
||||
* @brief Sets whether ::AppletMessage_AlbumScreenShotTaken is enabled.
|
||||
* @brief Sets whether ::AppletMessage_AlbumImageTaken is enabled.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] flag Whether to enable the notification.
|
||||
*/
|
||||
@ -923,13 +817,6 @@ Result appletSetAlbumImageTakenNotificationEnabled(bool flag);
|
||||
*/
|
||||
Result appletSetApplicationAlbumUserData(const void* buffer, size_t size);
|
||||
|
||||
/**
|
||||
* @brief SaveCurrentScreenshot
|
||||
* @note Only available with [11.0.0+].
|
||||
* @param[in] option \ref AlbumReportOption
|
||||
*/
|
||||
Result appletSaveCurrentScreenshot(AlbumReportOption option);
|
||||
|
||||
///@}
|
||||
|
||||
///@name IWindowController
|
||||
@ -1251,14 +1138,6 @@ Result appletHolderRequestExitOrTerminate(AppletHolder *h, u64 timeout);
|
||||
*/
|
||||
void appletHolderJoin(AppletHolder *h);
|
||||
|
||||
/**
|
||||
* @brief Gets the LibraryApplet StateChangedEvent.
|
||||
* @param h AppletHolder object.
|
||||
*/
|
||||
NX_CONSTEXPR Event *appletHolderGetExitEvent(AppletHolder *h) {
|
||||
return &h->StateChangedEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Waits on the LibraryApplet StateChangedEvent with timeout=0, and returns whether it was successful.
|
||||
* @param h AppletHolder object.
|
||||
@ -1286,13 +1165,6 @@ Result appletHolderSetOutOfFocusApplicationSuspendingEnabled(AppletHolder *h, bo
|
||||
*/
|
||||
Result appletHolderPresetLibraryAppletGpuTimeSliceZero(AppletHolder *h);
|
||||
|
||||
/**
|
||||
* @brief Gets the PopInteractiveOutDataEvent.
|
||||
* @param h AppletHolder object.
|
||||
* @param[out] out_event Output Event.
|
||||
*/
|
||||
Result appletHolderGetPopInteractiveOutDataEvent(AppletHolder *h, Event **out_event);
|
||||
|
||||
/**
|
||||
* @brief Waits for the PopInteractiveOutDataEvent and StateChangedEvent.
|
||||
* @return false for error / when StateChangedEvent was signaled, and true when PopInteractiveOutDataEvent was signaled. The latter is signaled when a new storage is available with \ref appletHolderPopInteractiveOutData where previously no storage was available (this willl not clear the event), this event is automatically cleared by the system once the last storage is popped.
|
||||
@ -1583,9 +1455,9 @@ Result appletInitializeApplicationCopyrightFrameBuffer(void);
|
||||
* @param[in] y Y coordinate. Must not be negative.
|
||||
* @param[in] width Image width. Must be >=1.
|
||||
* @param[in] height Image height. Must be >=1.
|
||||
* @param[in] mode \ref AppletWindowOriginMode
|
||||
* @param[in] mode WindowOriginMode. Should be at least 1.
|
||||
*/
|
||||
Result appletSetApplicationCopyrightImage(const void* buffer, size_t size, s32 x, s32 y, s32 width, s32 height, AppletWindowOriginMode mode);
|
||||
Result appletSetApplicationCopyrightImage(const void* buffer, size_t size, s32 x, s32 y, s32 width, s32 height, s32 mode);
|
||||
|
||||
/**
|
||||
* @brief Sets the visibility for the image set by \ref appletSetApplicationCopyrightImage, in screenshots.
|
||||
@ -1652,13 +1524,6 @@ Result appletRestartProgram(const void* buffer, size_t size);
|
||||
*/
|
||||
Result appletGetPreviousProgramIndex(s32 *programIndex);
|
||||
|
||||
/**
|
||||
* @brief SetDelayTimeToAbortOnGpuError
|
||||
* @note Only available with AppletType_*Application on [11.0.0+].
|
||||
* @param[in] val Input nanoseconds value.
|
||||
*/
|
||||
Result appletSetDelayTimeToAbortOnGpuError(u64 val);
|
||||
|
||||
/**
|
||||
* @brief Gets an Event which is signaled when a new storage is available with \ref appletTryPopFromFriendInvitationStorageChannel where previously no storage was available, this event is automatically cleared by the system once the last storage is popped.
|
||||
* @note This is used by \ref friendsGetFriendInvitationNotificationEvent.
|
||||
@ -1708,13 +1573,6 @@ Result appletGetHealthWarningDisappearedSystemEvent(Event *out_event);
|
||||
*/
|
||||
Result appletSetHdcpAuthenticationActivated(bool flag);
|
||||
|
||||
/**
|
||||
* @brief GetLastApplicationExitReason
|
||||
* @note Only available with AppletType_*Application on [11.0.0+].
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result appletGetLastApplicationExitReason(s32 *out);
|
||||
|
||||
/**
|
||||
* @brief CreateMovieMaker. Do not use this directly, use \ref grcCreateMovieMaker instead.
|
||||
* @note Only available with AppletType_*Application on [5.0.0+].
|
||||
@ -1732,37 +1590,37 @@ Result appletPrepareForJit(void);
|
||||
|
||||
///@}
|
||||
|
||||
///@name IHomeMenuFunctions: IFunctions for AppletType_SystemApplet and on [15.0.0+] for AppletType_LibraryApplet.
|
||||
///@name IHomeMenuFunctions: IFunctions for AppletType_SystemApplet.
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief RequestToGetForeground
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
*/
|
||||
Result appletRequestToGetForeground(void);
|
||||
|
||||
/**
|
||||
* @brief LockForeground
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
*/
|
||||
Result appletLockForeground(void);
|
||||
|
||||
/**
|
||||
* @brief UnlockForeground
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
*/
|
||||
Result appletUnlockForeground(void);
|
||||
|
||||
/**
|
||||
* @brief Pops a storage from the general channel.
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
* @param[out] s Storage object.
|
||||
*/
|
||||
Result appletPopFromGeneralChannel(AppletStorage *s);
|
||||
|
||||
/**
|
||||
* @brief Gets an Event which is signaled when a new storage is available with \ref appletPopFromGeneralChannel where previously no storage was available, this event is automatically cleared by the system once the last storage is popped.
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=false.
|
||||
*/
|
||||
@ -1770,22 +1628,15 @@ Result appletGetPopFromGeneralChannelEvent(Event *out_event);
|
||||
|
||||
/**
|
||||
* @brief Gets a \ref AppletLockAccessor for HomeButtonWriter.
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
* @note Similar to using \ref appletGetWriterLockAccessorEx with inval=0.
|
||||
* @param a LockAccessor object.
|
||||
*/
|
||||
Result appletGetHomeButtonWriterLockAccessor(AppletLockAccessor *a);
|
||||
|
||||
/**
|
||||
* @brief IsSleepEnabled
|
||||
* @note Only available with AppletType_SystemApplet on [11.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result appletIsSleepEnabled(bool *out);
|
||||
|
||||
/**
|
||||
* @brief PopRequestLaunchApplicationForDebug
|
||||
* @note Only available with AppletType_SystemApplet on [6.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [6.0.0+].
|
||||
* @param[out] uids Output array of \ref AccountUid.
|
||||
* @param[in] count Size of the uids array in entries, must be at least the size stored in state.
|
||||
* @param[out] application_id Output ApplicationId.
|
||||
@ -1795,25 +1646,18 @@ Result appletPopRequestLaunchApplicationForDebug(AccountUid *uids, s32 count, u6
|
||||
|
||||
/**
|
||||
* @brief IsForceTerminateApplicationDisabledForDebug
|
||||
* @note Only available with AppletType_SystemApplet on [9.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [9.0.0+].
|
||||
* @param[out] out Output flag. 0 when DebugMode is not enabled, otherwise this is loaded from a system-setting.
|
||||
*/
|
||||
Result appletIsForceTerminateApplicationDisabledForDebug(bool *out);
|
||||
|
||||
/**
|
||||
* @brief Launches DevMenu and the dev Overlay-applet. This will enter an infinite-sleep-loop on success.
|
||||
* @note Only available with AppletType_SystemApplet on [8.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [8.0.0+].
|
||||
* @note This verifies that DebugMode is enabled, then uses a ns cmd. That cmd then loads the system-settings for these two ProgramIds (which normally only exist on devunits), and verifies that these programs are installed + launches them.
|
||||
*/
|
||||
Result appletLaunchDevMenu(void);
|
||||
|
||||
/**
|
||||
* @brief SetLastApplicationExitReason
|
||||
* @note Only available with AppletType_SystemApplet on [11.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||
* @param[in] reason Reason
|
||||
*/
|
||||
Result appletSetLastApplicationExitReason(s32 reason);
|
||||
|
||||
///@}
|
||||
|
||||
///@name IGlobalStateController
|
||||
@ -1821,65 +1665,65 @@ Result appletSetLastApplicationExitReason(s32 reason);
|
||||
|
||||
/**
|
||||
* @brief Start the sequence for entering sleep-mode.
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
* @param[in] flag Flag, official sw uses hard-coded value = true.
|
||||
*/
|
||||
Result appletStartSleepSequence(bool flag);
|
||||
|
||||
/**
|
||||
* @brief Start the system-shutdown sequence.
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
*/
|
||||
Result appletStartShutdownSequence(void);
|
||||
|
||||
/**
|
||||
* @brief Start the system-reboot sequence.
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
*/
|
||||
Result appletStartRebootSequence(void);
|
||||
|
||||
/**
|
||||
* @brief IsAutoPowerDownRequested. Uses an idle:sys cmd internally.
|
||||
* @note Only available with AppletType_SystemApplet on [7.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [7.0.0+].
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result appletIsAutoPowerDownRequested(bool *out);
|
||||
|
||||
/**
|
||||
* @brief LoadAndApplyIdlePolicySettings. Uses an idle:sys cmd internally.
|
||||
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet.
|
||||
*/
|
||||
Result appletLoadAndApplyIdlePolicySettings(void);
|
||||
|
||||
/**
|
||||
* @brief NotifyCecSettingsChanged. Uses an omm cmd internally.
|
||||
* @note Only available with AppletType_SystemApplet on [2.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [2.0.0+].
|
||||
*/
|
||||
Result appletNotifyCecSettingsChanged(void);
|
||||
|
||||
/**
|
||||
* @brief Sets the DefaultHomeButtonLongPressTime.
|
||||
* @note Only available with AppletType_SystemApplet on [3.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [3.0.0+].
|
||||
* @param[in] val Input value.
|
||||
*/
|
||||
Result appletSetDefaultHomeButtonLongPressTime(s64 val);
|
||||
|
||||
/**
|
||||
* @brief UpdateDefaultDisplayResolution. Uses an omm cmd internally.
|
||||
* @note Only available with AppletType_SystemApplet on [3.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [3.0.0+].
|
||||
*/
|
||||
Result appletUpdateDefaultDisplayResolution(void);
|
||||
|
||||
/**
|
||||
* @brief ShouldSleepOnBoot. Uses an omm cmd internally.
|
||||
* @note Only available with AppletType_SystemApplet on [3.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [3.0.0+].
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result appletShouldSleepOnBoot(bool *out);
|
||||
|
||||
/**
|
||||
* @brief Gets an Event which is signaled for HdcpAuthenticationFailed.
|
||||
* @note Only available with AppletType_SystemApplet on [4.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||
* @note Only available with AppletType_SystemApplet on [4.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=false.
|
||||
*/
|
||||
@ -2521,20 +2365,6 @@ Result appletGetHomeButtonDoubleClickEnabled(bool *out);
|
||||
*/
|
||||
Result appletIsHomeButtonShortPressedBlocked(bool *out);
|
||||
|
||||
/**
|
||||
* @brief IsVrModeCurtainRequired
|
||||
* @note Only available with AppletType_SystemApplet, AppletType_LibraryApplet, or AppletType_OverlayApplet, on [11.0.0+].
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result appletIsVrModeCurtainRequired(bool *out);
|
||||
|
||||
/**
|
||||
* @brief SetCpuBoostRequestPriority
|
||||
* @note Only available with AppletType_SystemApplet, AppletType_LibraryApplet, or AppletType_OverlayApplet, on [11.0.0+].
|
||||
* @param[in] priority Priority
|
||||
*/
|
||||
Result appletSetCpuBoostRequestPriority(s32 priority);
|
||||
|
||||
///@}
|
||||
|
||||
///@name IDebugFunctions
|
||||
@ -2689,11 +2519,6 @@ Result appletSetHandlingHomeButtonShortPressedEnabled(bool flag);
|
||||
*/
|
||||
AppletInfo *appletGetAppletInfo(void);
|
||||
|
||||
/**
|
||||
* @brief Gets the event associated with notification messages.
|
||||
*/
|
||||
Event *appletGetMessageEvent(void);
|
||||
|
||||
/**
|
||||
* @brief Gets a notification message, see \ref AppletMessage.
|
||||
*/
|
||||
|
@ -1,70 +0,0 @@
|
||||
/**
|
||||
* @file audctl.h
|
||||
* @brief Audio Control IPC wrapper.
|
||||
* @author plutoo
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../types.h"
|
||||
#include "../audio/audio.h"
|
||||
#include "../sf/service.h"
|
||||
#include "../kernel/event.h"
|
||||
|
||||
typedef enum {
|
||||
AudioTarget_Invalid = 0,
|
||||
AudioTarget_Speaker = 1,
|
||||
AudioTarget_Headphone = 2,
|
||||
AudioTarget_Tv = 3,
|
||||
AudioTarget_UsbOutputDevice = 4,
|
||||
AudioTarget_Bluetooth = 5,
|
||||
} AudioTarget;
|
||||
|
||||
typedef enum {
|
||||
AudioOutputMode_Invalid = 0,
|
||||
AudioOutputMode_Pcm1ch = 1,
|
||||
AudioOutputMode_Pcm2ch = 2,
|
||||
AudioOutputMode_Pcm6ch = 3,
|
||||
AudioOutputMode_PcmAuto = 4,
|
||||
} AudioOutputMode;
|
||||
|
||||
typedef enum {
|
||||
AudioForceMutePolicy_Disable = 0,
|
||||
AudioForceMutePolicy_SpeakerMuteOnHeadphoneUnplugged = 1,
|
||||
} AudioForceMutePolicy;
|
||||
|
||||
typedef enum {
|
||||
AudioHeadphoneOutputLevelMode_Normal = 0,
|
||||
AudioHeadphoneOutputLevelMode_HighPower = 1,
|
||||
} AudioHeadphoneOutputLevelMode;
|
||||
|
||||
Result audctlInitialize(void);
|
||||
void audctlExit(void);
|
||||
Service* audctlGetServiceSession(void);
|
||||
|
||||
Result audctlGetTargetVolume(s32* volume_out, AudioTarget target);
|
||||
Result audctlSetTargetVolume(AudioTarget target, s32 volume);
|
||||
Result audctlGetTargetVolumeMin(s32* volume_out);
|
||||
Result audctlGetTargetVolumeMax(s32* volume_out);
|
||||
Result audctlIsTargetMute(bool* mute_out, AudioTarget target);
|
||||
Result audctlSetTargetMute(AudioTarget target, bool mute);
|
||||
Result audctlIsTargetConnected(bool* connected_out, AudioTarget target); ///< [1.0.0-17.0.1]
|
||||
Result audctlSetDefaultTarget(AudioTarget target, u64 fade_in_ns, u64 fade_out_ns);
|
||||
Result audctlGetDefaultTarget(AudioTarget* target_out);
|
||||
Result audctlGetAudioOutputMode(AudioOutputMode* mode_out, AudioTarget target);
|
||||
Result audctlSetAudioOutputMode(AudioTarget target, AudioOutputMode mode);
|
||||
Result audctlSetForceMutePolicy(AudioForceMutePolicy policy); ///< [1.0.0-13.2.1]
|
||||
Result audctlGetForceMutePolicy(AudioForceMutePolicy* policy_out); ///< [1.0.0-13.2.1]
|
||||
Result audctlGetOutputModeSetting(AudioOutputMode* mode_out, AudioTarget target);
|
||||
Result audctlSetOutputModeSetting(AudioTarget target, AudioOutputMode mode);
|
||||
Result audctlSetOutputTarget(AudioTarget target);
|
||||
Result audctlSetInputTargetForceEnabled(bool enable);
|
||||
Result audctlSetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode mode); ///< [3.0.0+]
|
||||
Result audctlGetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode* mode_out); ///< [3.0.0+]
|
||||
Result audctlAcquireAudioVolumeUpdateEventForPlayReport(Event* event_out); ///< [3.0.0-13.2.1]
|
||||
Result audctlAcquireAudioOutputDeviceUpdateEventForPlayReport(Event* event_out); ///< [3.0.0-13.2.1]
|
||||
Result audctlGetAudioOutputTargetForPlayReport(AudioTarget* target_out); ///< [3.0.0+]
|
||||
Result audctlNotifyHeadphoneVolumeWarningDisplayedEvent(void); ///< [3.0.0+]
|
||||
Result audctlSetSystemOutputMasterVolume(float volume); ///< [4.0.0+]
|
||||
Result audctlGetSystemOutputMasterVolume(float* volume_out); ///< [4.0.0+]
|
||||
Result audctlGetActiveOutputTarget(AudioTarget* target);
|
@ -22,4 +22,4 @@ Service* auddevGetServiceSession(void);
|
||||
Result auddevListAudioDeviceName(AudioDeviceName *DeviceNames, s32 max_names, s32 *total_names);
|
||||
Result auddevSetAudioDeviceOutputVolume(const AudioDeviceName *DeviceName, float volume);
|
||||
Result auddevGetAudioDeviceOutputVolume(const AudioDeviceName *DeviceName, float *volume);
|
||||
Result auddevGetActiveAudioDeviceName(AudioDeviceName *DeviceName);
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
/**
|
||||
* @file audrec.h
|
||||
* @brief Audio Recorder IPC wrapper.
|
||||
* @author plutoo
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../types.h"
|
||||
#include "../audio/audio.h"
|
||||
#include "../sf/service.h"
|
||||
#include "../kernel/event.h"
|
||||
|
||||
typedef struct {
|
||||
u64 released_ns;
|
||||
u64 next_buffer_ptr;
|
||||
u64 sample_buffer_ptr;
|
||||
u64 sample_buffer_capacity;
|
||||
u64 data_size;
|
||||
u64 data_offset;
|
||||
} FinalOutputRecorderBuffer;
|
||||
|
||||
typedef struct {
|
||||
u32 sample_rate;
|
||||
u32 channel_count;
|
||||
} FinalOutputRecorderParameter;
|
||||
|
||||
typedef struct {
|
||||
u32 sample_rate;
|
||||
u32 channel_count;
|
||||
u32 sample_format;
|
||||
u32 state;
|
||||
} FinalOutputRecorderParameterInternal;
|
||||
|
||||
typedef struct {
|
||||
Service s;
|
||||
} AudrecRecorder;
|
||||
|
||||
Result audrecInitialize(void);
|
||||
void audrecExit(void);
|
||||
Service* audrecGetServiceSession(void);
|
||||
|
||||
Result audrecOpenFinalOutputRecorder(AudrecRecorder* recorder_out, FinalOutputRecorderParameter* param_in, u64 aruid, FinalOutputRecorderParameterInternal* param_out);
|
||||
|
||||
Result audrecRecorderStart(AudrecRecorder* recorder);
|
||||
Result audrecRecorderStop(AudrecRecorder* recorder);
|
||||
Result audrecRecorderRegisterBufferEvent(AudrecRecorder* recorder, Event* out_event);
|
||||
Result audrecRecorderAppendFinalOutputRecorderBuffer(AudrecRecorder* recorder, u64 buffer_client_ptr, FinalOutputRecorderBuffer* param);
|
||||
Result audrecRecorderGetReleasedFinalOutputRecorderBuffers(AudrecRecorder* recorder, u64* out_buffers, u64* inout_count, u64* out_released);
|
||||
void audrecRecorderClose(AudrecRecorder* recorder);
|
@ -1,45 +0,0 @@
|
||||
/**
|
||||
* @file avm.h
|
||||
* @brief AVM services IPC wrapper. Only available on [6.0.0+].
|
||||
* @author Behemoth
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../types.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
typedef struct {
|
||||
u64 application_id;
|
||||
u32 version;
|
||||
u32 required;
|
||||
} AvmVersionListEntry;
|
||||
|
||||
typedef struct {
|
||||
u64 application_id;
|
||||
u32 version;
|
||||
} AvmRequiredVersionEntry;
|
||||
|
||||
typedef struct {
|
||||
Service s;
|
||||
} AvmVersionListImporter;
|
||||
|
||||
Result avmInitialize(void);
|
||||
void avmExit(void);
|
||||
|
||||
Service *avmGetServiceSession(void);
|
||||
|
||||
Result avmGetHighestAvailableVersion(u64 id_1, u64 id_2, u32 *version);
|
||||
Result avmGetHighestRequiredVersion(u64 id_1, u64 id_2, u32 *version);
|
||||
Result avmGetVersionListEntry(u64 application_id, AvmVersionListEntry *entry);
|
||||
Result avmGetVersionListImporter(AvmVersionListImporter *out);
|
||||
Result avmGetLaunchRequiredVersion(u64 application_id, u32 *version);
|
||||
Result avmUpgradeLaunchRequiredVersion(u64 application_id, u32 version);
|
||||
Result avmPushLaunchVersion(u64 application_id, u32 version);
|
||||
Result avmListVersionList(AvmVersionListEntry *buffer, size_t count, u32 *out);
|
||||
Result avmListRequiredVersion(AvmRequiredVersionEntry *buffer, size_t count, u32 *out);
|
||||
|
||||
void avmVersionListImporterClose(AvmVersionListImporter *srv);
|
||||
Result avmVersionListImporterSetTimestamp(AvmVersionListImporter *srv, u64 timestamp);
|
||||
Result avmVersionListImporterSetData(AvmVersionListImporter *srv, const AvmVersionListEntry *entries, u32 count);
|
||||
Result avmVersionListImporterFlush(AvmVersionListImporter *srv);
|
@ -24,5 +24,4 @@ Service* bpcGetServiceSession(void);
|
||||
|
||||
Result bpcShutdownSystem(void);
|
||||
Result bpcRebootSystem(void);
|
||||
Result bpcGetSleepButtonState(BpcSleepButtonState *out); ///< [2.0.0-13.2.1]
|
||||
Result bpcGetPowerButton(bool* out_is_pushed); ///< [6.0.0+]
|
||||
Result bpcGetSleepButtonState(BpcSleepButtonState *out); ///< [2.0.0+]
|
||||
|
@ -18,11 +18,8 @@
|
||||
typedef struct {
|
||||
u32 version; ///< Observed 1 on [2.0.0+] LibAppletWeb, 2 on [3.0.0+].
|
||||
|
||||
void *tmem_buffer; ///< User-provided buffer to use as backing for transfer memory. If NULL, a buffer will be allocated automatically. Must be large enough and page-aligned.
|
||||
size_t tmem_buffer_size; ///< Size of the user-provided transfer memory backing buffer. Must be large enough and page-aligned.
|
||||
|
||||
u32 tcp_tx_buf_size; ///< Size of the TCP transfer (send) buffer (initial or fixed).
|
||||
u32 tcp_rx_buf_size; ///< Size of the TCP receive buffer (initial or fixed).
|
||||
u32 tcp_rx_buf_size; ///< Size of the TCP recieve buffer (initial or fixed).
|
||||
u32 tcp_tx_buf_max_size; ///< Maximum size of the TCP transfer (send) buffer. If it is 0, the size of the buffer is fixed to its initial value.
|
||||
u32 tcp_rx_buf_max_size; ///< Maximum size of the TCP receive buffer. If it is 0, the size of the buffer is fixed to its initial value.
|
||||
|
||||
|
@ -1,132 +0,0 @@
|
||||
/**
|
||||
* @file bt.h
|
||||
* @brief Bluetooth user (bt) service IPC wrapper.
|
||||
* @note See also btdev.
|
||||
* @author yellows8, ndeadly
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../services/btdrv.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
/// Initialize bt. Only available on [5.0.0+].
|
||||
Result btInitialize(void);
|
||||
|
||||
/// Exit bt.
|
||||
void btExit(void);
|
||||
|
||||
/// Gets the Service object for the actual bt service session.
|
||||
Service* btGetServiceSession(void);
|
||||
|
||||
/**
|
||||
* @brief LeClientReadCharacteristic
|
||||
* @note This is essentially the same as \ref btdrvReadGattCharacteristic.
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] is_primary Is a primary service or not
|
||||
* @param[in] serv_id Service GATT ID \ref BtdrvGattId
|
||||
* @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
|
||||
* @param[in] auth_req \ref BtdrvGattAuthReqType
|
||||
*/
|
||||
Result btLeClientReadCharacteristic(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, u8 auth_req);
|
||||
|
||||
/**
|
||||
* @brief LeClientReadDescriptor
|
||||
* @note This is essentially the same as \ref btdrvReadGattDescriptor.
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] is_primary Is a primary service or not
|
||||
* @param[in] serv_id Service GATT ID \ref BtdrvGattId
|
||||
* @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
|
||||
* @param[in] desc_id Descriptor GATT ID \ref BtdrvGattId
|
||||
* @param[in] auth_req \ref BtdrvGattAuthReqType
|
||||
*/
|
||||
Result btLeClientReadDescriptor(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, u8 auth_req);
|
||||
|
||||
/**
|
||||
* @brief LeClientWriteCharacteristic
|
||||
* @note This is essentially the same as \ref btdrvWriteGattCharacteristic.
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] is_primary Is a primary service or not
|
||||
* @param[in] serv_id Service GATT ID \ref BtdrvGattId
|
||||
* @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
|
||||
* @param[in] buffer Input buffer.
|
||||
* @param[in] size Input buffer size, must be <=0x258.
|
||||
* @param[in] auth_req \ref BtdrvGattAuthReqType
|
||||
* @param[in] with_response Whether to use Write-With-Response write type or not
|
||||
*/
|
||||
Result btLeClientWriteCharacteristic(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const void* buffer, size_t size, u8 auth_req, bool with_response);
|
||||
|
||||
/**
|
||||
* @brief LeClientWriteDescriptor
|
||||
* @note This is essentially the same as \ref btdrvWriteGattDescriptor.
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] is_primary Is a primary service or not
|
||||
* @param[in] serv_id Service GATT ID \ref BtdrvGattId
|
||||
* @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
|
||||
* @param[in] desc_id Descriptor GATT ID \ref BtdrvGattId
|
||||
* @param[in] buffer Input buffer.
|
||||
* @param[in] size Input buffer size, must be <=0x258.
|
||||
* @param[in] auth_req \ref BtdrvGattAuthReqType
|
||||
*/
|
||||
Result btLeClientWriteDescriptor(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, const void* buffer, size_t size, u8 auth_req);
|
||||
|
||||
/**
|
||||
* @brief LeClientRegisterNotification
|
||||
* @note This is essentially the same as \ref btdrvRegisterGattNotification.
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] is_primary Is a primary service or not
|
||||
* @param[in] serv_id Service GATT ID \ref BtdrvGattId
|
||||
* @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
|
||||
*/
|
||||
Result btLeClientRegisterNotification(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id);
|
||||
|
||||
/**
|
||||
* @brief LeClientDeregisterNotification
|
||||
* @note This is essentially the same as \ref btdrvUnregisterGattNotification.
|
||||
* @param[in] connection_handle ConnectionHandle
|
||||
* @param[in] is_primary Is a primary service or not
|
||||
* @param[in] serv_id Service GATT ID \ref BtdrvGattId
|
||||
* @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
|
||||
*/
|
||||
Result btLeClientDeregisterNotification(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id);
|
||||
|
||||
/**
|
||||
* @brief SetLeResponse
|
||||
* @param[in] server_if Server interface ID
|
||||
* @param[in] serv_uuid Service UUID \ref BtdrvGattAttributeUuid
|
||||
* @param[in] char_uuid Characteristic UUID \ref BtdrvGattAttributeUuid
|
||||
* @param[in] buffer Input buffer.
|
||||
* @param[in] size Input buffer size, must be <=0x258.
|
||||
*/
|
||||
Result btSetLeResponse(u8 server_if, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *char_uuid, const void* buffer, size_t size);
|
||||
|
||||
/**
|
||||
* @brief LeSendIndication
|
||||
* @param[in] server_if Server interface ID
|
||||
* @param[in] serv_uuid Service UUID \ref BtdrvGattAttributeUuid
|
||||
* @param[in] char_uuid Characteristic UUID \ref BtdrvGattAttributeUuid
|
||||
* @param[in] buffer Input buffer.
|
||||
* @param[in] size Input buffer size, clamped to max size 0x258.
|
||||
* @param[in] noconfirm Whether no confirmation is required (notification) or not (indication)
|
||||
*/
|
||||
Result btLeSendIndication(u8 server_if, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *char_uuid, const void* buffer, size_t size, bool noconfirm);
|
||||
|
||||
/**
|
||||
* @brief GetLeEventInfo
|
||||
* @note This is identical to \ref btdrvGetLeHidEventInfo except different state is used.
|
||||
* @note The state used by this is reset after writing the data to output.
|
||||
* @param[in] buffer Output buffer. 0x400-bytes from state is written here. See \ref BtdrvLeEventInfo.
|
||||
* @param[in] size Output buffer size.
|
||||
* @param[out] type Output BtdrvBleEventType.
|
||||
*/
|
||||
Result btGetLeEventInfo(void* buffer, size_t size, BtdrvBleEventType *type);
|
||||
|
||||
/**
|
||||
* @brief RegisterBleEvent
|
||||
* @note This is identical to \ref btdrvRegisterBleHidEvent except different state is used.
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btRegisterBleEvent(Event* out_event);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,917 +0,0 @@
|
||||
/**
|
||||
* @file btdrv_ids.h
|
||||
* @brief Bluetooth SIG assigned number definitions (see https://www.bluetooth.com/specifications/assigned-numbers/).
|
||||
* @author ndeadly
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/// Extract \ref BtdrvAppearanceCategoryType from \ref BtdrvAppearanceType.
|
||||
#define APPEARANCE_CATEGORY(x) ((x & 0xFFC0) >> 6)
|
||||
|
||||
/// AdType
|
||||
typedef enum {
|
||||
BtdrvAdType_Flags = 0x01, ///< Flags
|
||||
BtdrvAdType_ServiceClassUuid16ListIncomplete = 0x02, ///< Incomplete List of 16-bit Service Class UUIDs
|
||||
BtdrvAdType_ServiceClassUuid16ListComplete = 0x03, ///< Complete List of 16-bit Service Class UUIDs
|
||||
BtdrvAdType_ServiceClassUuid32ListIncomplete = 0x04, ///< Incomplete List of 32-bit Service Class UUIDs
|
||||
BtdrvAdType_ServiceClassUuid32ListComplete = 0x05, ///< Complete List of 32-bit Service Class UUIDs
|
||||
BtdrvAdType_ServiceClassUuid128ListIncomplete = 0x06, ///< Incomplete List of 128-bit Service Class UUIDs
|
||||
BtdrvAdType_ServiceClassUuid128ListComplete = 0x07, ///< Complete List of 128-bit Service Class UUIDs
|
||||
BtdrvAdType_ShortenedLocalName = 0x08, ///< Shortened Local Name
|
||||
BtdrvAdType_CompleteLocalName = 0x09, ///< Complete Local Name
|
||||
BtdrvAdType_TxPowerLevel = 0x0A, ///< Tx Power Level
|
||||
BtdrvAdType_ClassOfDevice = 0x0D, ///< Class of Device
|
||||
BtdrvAdType_SimplePairingHashC192 = 0x0E, ///< Simple Pairing Hash C-192
|
||||
BtdrvAdType_SimplePairingRandomizerR192 = 0x0F, ///< Simple Pairing Randomizer R-192
|
||||
BtdrvAdType_DeviceId = 0x10, ///< Device ID
|
||||
BtdrvAdType_SecurityManagerTkValue = 0x10, ///< Security Manager TK Value
|
||||
BtdrvAdType_SecurityManagerOutOfBandFlags = 0x11, ///< Security Manager Out of Band Flags
|
||||
BtdrvAdType_PeripheralConnectionIntervalRange = 0x12, ///< Peripheral Connection Interval Range
|
||||
BtdrvAdType_ServiceSolicitationUuid16List = 0x14, ///< List of 16-bit Service Solicitation UUIDs
|
||||
BtdrvAdType_ServiceSolicitationUuid128List = 0x15, ///< List of 128-bit Service Solicitation UUIDs
|
||||
BtdrvAdType_ServiceDataUuid16 = 0x16, ///< Service Data - 16-bit UUID
|
||||
BtdrvAdType_PublicTargetAddress = 0x17, ///< Public Target Address
|
||||
BtdrvAdType_RandomTargetAddress = 0x18, ///< Random Target Address
|
||||
BtdrvAdType_Appearance = 0x19, ///< Appearance
|
||||
BtdrvAdType_AdvertisingInterval = 0x1A, ///< Advertising Interval
|
||||
BtdrvAdType_LeBluetoothDeviceAddress = 0x1B, ///< LE Bluetooth Device Address
|
||||
BtdrvAdType_LeRole = 0x1C, ///< LE Role
|
||||
BtdrvAdType_SimplePairingHashC256 = 0x1D, ///< Simple Pairing Hash C-256
|
||||
BtdrvAdType_SimplePairingRandomizerR256 = 0x1E, ///< Simple Pairing Randomizer R-256
|
||||
BtdrvAdType_ServiceSolicitationUuid32List = 0x1F, ///< List of 32-bit Service Solicitation UUIDs
|
||||
BtdrvAdType_ServiceDataUuid32 = 0x20, ///< Service Data - 32-bit UUID
|
||||
BtdrvAdType_ServiceDataUuid128 = 0x21, ///< Service Data - 128-bit UUID
|
||||
BtdrvAdType_LeSecureConnectionsConfirmationValue = 0x22, ///< LE Secure Connections Confirmation Value
|
||||
BtdrvAdType_LeSecureConnectionsRandomValue = 0x23, ///< LE Secure Connections Random Value
|
||||
BtdrvAdType_Uri = 0x24, ///< URI
|
||||
BtdrvAdType_IndoorPositioning = 0x25, ///< Indoor Positioning
|
||||
BtdrvAdType_TransportDiscoveryData = 0x26, ///< Transport Discovery Data
|
||||
BtdrvAdType_LeSupportedFeatures = 0x27, ///< LE Supported Features
|
||||
BtdrvAdType_ChannelMapUpdateIndication = 0x28, ///< Channel Map Update Indication
|
||||
BtdrvAdType_PbAdv = 0x29, ///< PB-ADV
|
||||
BtdrvAdType_MeshMessage = 0x2A, ///< Mesh Message
|
||||
BtdrvAdType_MeshBeacon = 0x2B, ///< Mesh Beacon
|
||||
BtdrvAdType_Biginfo = 0x2C, ///< BIGInfo
|
||||
BtdrvAdType_BroadcastCode = 0x2D, ///< Broadcast_Code
|
||||
BtdrvAdType_ResolvableSetIdentifier = 0x2E, ///< Resolvable Set Identifier
|
||||
BtdrvAdType_AdvertisingIntervalLong = 0x2F, ///< Advertising Interval - long
|
||||
BtdrvAdType_BroadcastName = 0x30, ///< Broadcast_Name
|
||||
BtdrvAdType_EncryptedAdvertisingData = 0x31, ///< Encrypted Advertising Data
|
||||
BtdrvAdType_PeriodicAdvertisingResponseTimingInformation = 0x32, ///< Periodic Advertising Response Timing Information
|
||||
BtdrvAdType_ElectronicShelfLabel = 0x34, ///< Electronic Shelf Label
|
||||
BtdrvAdType_3DInformationData = 0x3D, ///< 3D Information Data
|
||||
BtdrvAdType_ManufacturerSpecificData = 0xFF, ///< Manufacturer Specific Data
|
||||
} BtdrvAdType;
|
||||
|
||||
/// AppearanceCategoryType
|
||||
typedef enum {
|
||||
BtdrvAppearanceCategoryType_Unknown = 0x000, ///< Unknown
|
||||
BtdrvAppearanceCategoryType_Phone = 0x001, ///< Phone
|
||||
BtdrvAppearanceCategoryType_Computer = 0x002, ///< Computer
|
||||
BtdrvAppearanceCategoryType_Watch = 0x003, ///< Watch
|
||||
BtdrvAppearanceCategoryType_Clock = 0x004, ///< Clock
|
||||
BtdrvAppearanceCategoryType_Display = 0x005, ///< Display
|
||||
BtdrvAppearanceCategoryType_RemoteControl = 0x006, ///< Remote Control
|
||||
BtdrvAppearanceCategoryType_EyeGlasses = 0x007, ///< Eye-glasses
|
||||
BtdrvAppearanceCategoryType_Tag = 0x008, ///< Tag
|
||||
BtdrvAppearanceCategoryType_Keyring = 0x009, ///< Keyring
|
||||
BtdrvAppearanceCategoryType_MediaPlayer = 0x00A, ///< Media Player
|
||||
BtdrvAppearanceCategoryType_BarcodeScanner = 0x00B, ///< Barcode Scanner
|
||||
BtdrvAppearanceCategoryType_Thermometer = 0x00C, ///< Thermometer
|
||||
BtdrvAppearanceCategoryType_HeartRateSensor = 0x00D, ///< Heart Rate Sensor
|
||||
BtdrvAppearanceCategoryType_BloodPressure = 0x00E, ///< Blood Pressure
|
||||
BtdrvAppearanceCategoryType_HumanInterfaceDevice = 0x00F, ///< Human Interface Device
|
||||
BtdrvAppearanceCategoryType_GlucoseMeter = 0x010, ///< Glucose Meter
|
||||
BtdrvAppearanceCategoryType_RunningWalkingSensor = 0x011, ///< Running Walking Sensor
|
||||
BtdrvAppearanceCategoryType_Cycling = 0x012, ///< Cycling
|
||||
BtdrvAppearanceCategoryType_ControlDevice = 0x013, ///< Control Device
|
||||
BtdrvAppearanceCategoryType_NetworkDevice = 0x014, ///< Network Device
|
||||
BtdrvAppearanceCategoryType_Sensor = 0x015, ///< Sensor
|
||||
BtdrvAppearanceCategoryType_LightFixtures = 0x016, ///< Light Fixtures
|
||||
BtdrvAppearanceCategoryType_Fan = 0x017, ///< Fan
|
||||
BtdrvAppearanceCategoryType_Hvac = 0x018, ///< HVAC
|
||||
BtdrvAppearanceCategoryType_AirConditioning = 0x019, ///< Air Conditioning
|
||||
BtdrvAppearanceCategoryType_Humidifier = 0x01A, ///< Humidifier
|
||||
BtdrvAppearanceCategoryType_Heating = 0x01B, ///< Heating
|
||||
BtdrvAppearanceCategoryType_AccessControl = 0x01C, ///< Access Control
|
||||
BtdrvAppearanceCategoryType_MotorizedDevice = 0x01D, ///< Motorized Device
|
||||
BtdrvAppearanceCategoryType_PowerDevice = 0x01E, ///< Power Device
|
||||
BtdrvAppearanceCategoryType_LightSource = 0x01F, ///< Light Source
|
||||
BtdrvAppearanceCategoryType_WindowCovering = 0x020, ///< Window Covering
|
||||
BtdrvAppearanceCategoryType_AudioSink = 0x021, ///< Audio Sink
|
||||
BtdrvAppearanceCategoryType_AudioSource = 0x022, ///< Audio Source
|
||||
BtdrvAppearanceCategoryType_MotorizedVehicle = 0x023, ///< Motorized Vehicle
|
||||
BtdrvAppearanceCategoryType_DomesticAppliance = 0x024, ///< Domestic Appliance
|
||||
BtdrvAppearanceCategoryType_WearableAudioDevice = 0x025, ///< Wearable Audio Device
|
||||
BtdrvAppearanceCategoryType_Aircraft = 0x026, ///< Aircraft
|
||||
BtdrvAppearanceCategoryType_AvEquipment = 0x027, ///< AV Equipment
|
||||
BtdrvAppearanceCategoryType_DisplayEquipment = 0x028, ///< Display Equipment
|
||||
BtdrvAppearanceCategoryType_HearingAid = 0x029, ///< Hearing aid
|
||||
BtdrvAppearanceCategoryType_Gaming = 0x02A, ///< Gaming
|
||||
BtdrvAppearanceCategoryType_PulseOximeter = 0x031, ///< Pulse Oximeter
|
||||
BtdrvAppearanceCategoryType_WeightScale = 0x032, ///< Weight Scale
|
||||
BtdrvAppearanceCategoryType_PersonalMobilityDevice = 0x033, ///< Personal Mobility Device
|
||||
BtdrvAppearanceCategoryType_ContinuousGlucoseMonitor = 0x034, ///< Continuous Glucose Monitor
|
||||
BtdrvAppearanceCategoryType_InsulinPump = 0x035, ///< Insulin Pump
|
||||
BtdrvAppearanceCategoryType_MedicationDelivery = 0x036, ///< Medication Delivery
|
||||
BtdrvAppearanceCategoryType_Spirometer = 0x037, ///< Spirometer
|
||||
BtdrvAppearanceCategoryType_OutdoorSportsActivity = 0x051, ///< Outdoor Sports Activity
|
||||
} BtdrvAppearanceCategoryType;
|
||||
|
||||
/// AppearanceType
|
||||
typedef enum {
|
||||
BtdrvAppearanceType_DesktopWorkstation = 0x0081, ///< Desktop Workstation
|
||||
BtdrvAppearanceType_ServerClassComputer = 0x0082, ///< Server-class Computer
|
||||
BtdrvAppearanceType_Laptop = 0x0083, ///< Laptop
|
||||
BtdrvAppearanceType_HandheldPcPdaClamshell = 0x0084, ///< Handheld PC/PDA (clamshell)
|
||||
BtdrvAppearanceType_PalmSizePcPda = 0x0085, ///< Palm-size PC/PDA
|
||||
BtdrvAppearanceType_WearableComputerWatchSize = 0x0086, ///< Wearable computer (watch size)
|
||||
BtdrvAppearanceType_Tablet = 0x0087, ///< Tablet
|
||||
BtdrvAppearanceType_DockingStation = 0x0088, ///< Docking Station
|
||||
BtdrvAppearanceType_AllInOne = 0x0089, ///< All in One
|
||||
BtdrvAppearanceType_BladeServer = 0x008A, ///< Blade Server
|
||||
BtdrvAppearanceType_Convertible = 0x008B, ///< Convertible
|
||||
BtdrvAppearanceType_Detachable = 0x008C, ///< Detachable
|
||||
BtdrvAppearanceType_IotGateway = 0x008D, ///< IoT Gateway
|
||||
BtdrvAppearanceType_MiniPc = 0x008E, ///< Mini PC
|
||||
BtdrvAppearanceType_StickPc = 0x008F, ///< Stick PC
|
||||
BtdrvAppearanceType_SportsWatch = 0x00C1, ///< Sports Watch
|
||||
BtdrvAppearanceType_Smartwatch = 0x00C2, ///< Smartwatch
|
||||
BtdrvAppearanceType_EarThermometer = 0x0301, ///< Ear Thermometer
|
||||
BtdrvAppearanceType_HeartRateBelt = 0x0341, ///< Heart Rate Belt
|
||||
BtdrvAppearanceType_ArmBloodPressure = 0x0381, ///< Arm Blood Pressure
|
||||
BtdrvAppearanceType_WristBloodPressure = 0x0382, ///< Wrist Blood Pressure
|
||||
BtdrvAppearanceType_Keyboard = 0x03C1, ///< Keyboard
|
||||
BtdrvAppearanceType_Mouse = 0x03C2, ///< Mouse
|
||||
BtdrvAppearanceType_Joystick = 0x03C3, ///< Joystick
|
||||
BtdrvAppearanceType_Gamepad = 0x03C4, ///< Gamepad
|
||||
BtdrvAppearanceType_DigitizerTablet = 0x03C5, ///< Digitizer Tablet
|
||||
BtdrvAppearanceType_CardReader = 0x03C6, ///< Card Reader
|
||||
BtdrvAppearanceType_DigitalPen = 0x03C7, ///< Digital Pen
|
||||
BtdrvAppearanceType_BarcodeScanner = 0x03C8, ///< Barcode Scanner
|
||||
BtdrvAppearanceType_Touchpad = 0x03C9, ///< Touchpad
|
||||
BtdrvAppearanceType_PresentationRemote = 0x03CA, ///< Presentation Remote
|
||||
BtdrvAppearanceType_InShoeRunningWalkingSensor = 0x0441, ///< In-Shoe Running Walking Sensor
|
||||
BtdrvAppearanceType_OnShoeRunningWalkingSensor = 0x0442, ///< On-Shoe Running Walking Sensor
|
||||
BtdrvAppearanceType_OnHipRunningWalkingSensor = 0x0443, ///< On-Hip Running Walking Sensor
|
||||
BtdrvAppearanceType_CyclingComputer = 0x0481, ///< Cycling Computer
|
||||
BtdrvAppearanceType_SpeedSensor = 0x0482, ///< Speed Sensor
|
||||
BtdrvAppearanceType_CadenceSensor = 0x0483, ///< Cadence Sensor
|
||||
BtdrvAppearanceType_PowerSensor = 0x0484, ///< Power Sensor
|
||||
BtdrvAppearanceType_SpeedAndCadenceSensor = 0x0485, ///< Speed and Cadence Sensor
|
||||
BtdrvAppearanceType_Switch = 0x04C1, ///< Switch
|
||||
BtdrvAppearanceType_MultiSwitch = 0x04C2, ///< Multi-switch
|
||||
BtdrvAppearanceType_Button = 0x04C3, ///< Button
|
||||
BtdrvAppearanceType_Slider = 0x04C4, ///< Slider
|
||||
BtdrvAppearanceType_RotarySwitch = 0x04C5, ///< Rotary Switch
|
||||
BtdrvAppearanceType_TouchPanel = 0x04C6, ///< Touch Panel
|
||||
BtdrvAppearanceType_SingleSwitch = 0x04C7, ///< Single Switch
|
||||
BtdrvAppearanceType_DoubleSwitch = 0x04C8, ///< Double Switch
|
||||
BtdrvAppearanceType_TripleSwitch = 0x04C9, ///< Triple Switch
|
||||
BtdrvAppearanceType_BatterySwitch = 0x04CA, ///< Battery Switch
|
||||
BtdrvAppearanceType_EnergyHarvestingSwitch = 0x04CB, ///< Energy Harvesting Switch
|
||||
BtdrvAppearanceType_PushButton = 0x04CC, ///< Push Button
|
||||
BtdrvAppearanceType_AccessPoint = 0x0501, ///< Access Point
|
||||
BtdrvAppearanceType_MeshDevice = 0x0502, ///< Mesh Device
|
||||
BtdrvAppearanceType_MeshNetworkProxy = 0x0503, ///< Mesh Network Proxy
|
||||
BtdrvAppearanceType_MotionSensor = 0x0541, ///< Motion Sensor
|
||||
BtdrvAppearanceType_AirQualitySensor = 0x0542, ///< Air quality Sensor
|
||||
BtdrvAppearanceType_TemperatureSensor = 0x0543, ///< Temperature Sensor
|
||||
BtdrvAppearanceType_HumiditySensor = 0x0544, ///< Humidity Sensor
|
||||
BtdrvAppearanceType_LeakSensor = 0x0545, ///< Leak Sensor
|
||||
BtdrvAppearanceType_SmokeSensor = 0x0546, ///< Smoke Sensor
|
||||
BtdrvAppearanceType_OccupancySensor = 0x0547, ///< Occupancy Sensor
|
||||
BtdrvAppearanceType_ContactSensor = 0x0548, ///< Contact Sensor
|
||||
BtdrvAppearanceType_CarbonMonoxideSensor = 0x0549, ///< Carbon Monoxide Sensor
|
||||
BtdrvAppearanceType_CarbonDioxideSensor = 0x054A, ///< Carbon Dioxide Sensor
|
||||
BtdrvAppearanceType_AmbientLightSensor = 0x054B, ///< Ambient Light Sensor
|
||||
BtdrvAppearanceType_EnergySensor = 0x054C, ///< Energy Sensor
|
||||
BtdrvAppearanceType_ColorLightSensor = 0x054D, ///< Color Light Sensor
|
||||
BtdrvAppearanceType_RainSensor = 0x054E, ///< Rain Sensor
|
||||
BtdrvAppearanceType_FireSensor = 0x054F, ///< Fire Sensor
|
||||
BtdrvAppearanceType_WindSensor = 0x0550, ///< Wind Sensor
|
||||
BtdrvAppearanceType_ProximitySensor = 0x0551, ///< Proximity Sensor
|
||||
BtdrvAppearanceType_MultiSensor = 0x0552, ///< Multi-Sensor
|
||||
BtdrvAppearanceType_FlushMountedSensor = 0x0553, ///< Flush Mounted Sensor
|
||||
BtdrvAppearanceType_CeilingMountedSensor = 0x0554, ///< Ceiling Mounted Sensor
|
||||
BtdrvAppearanceType_WallMountedSensor = 0x0555, ///< Wall Mounted Sensor
|
||||
BtdrvAppearanceType_Multisensor = 0x0556, ///< Multisensor
|
||||
BtdrvAppearanceType_EnergyMeter = 0x0557, ///< Energy Meter
|
||||
BtdrvAppearanceType_FlameDetector = 0x0558, ///< Flame Detector
|
||||
BtdrvAppearanceType_VehicleTirePressureSensor = 0x0559, ///< Vehicle Tire Pressure Sensor
|
||||
BtdrvAppearanceType_WallLight = 0x0581, ///< Wall Light
|
||||
BtdrvAppearanceType_CeilingLight = 0x0582, ///< Ceiling Light
|
||||
BtdrvAppearanceType_FloorLight = 0x0583, ///< Floor Light
|
||||
BtdrvAppearanceType_CabinetLight = 0x0584, ///< Cabinet Light
|
||||
BtdrvAppearanceType_DeskLight = 0x0585, ///< Desk Light
|
||||
BtdrvAppearanceType_TrofferLight = 0x0586, ///< Troffer Light
|
||||
BtdrvAppearanceType_PendantLight = 0x0587, ///< Pendant Light
|
||||
BtdrvAppearanceType_InGroundLight = 0x0588, ///< In-ground Light
|
||||
BtdrvAppearanceType_FloodLight = 0x0589, ///< Flood Light
|
||||
BtdrvAppearanceType_UnderwaterLight = 0x058A, ///< Underwater Light
|
||||
BtdrvAppearanceType_BollardWithLight = 0x058B, ///< Bollard with Light
|
||||
BtdrvAppearanceType_PathwayLight = 0x058C, ///< Pathway Light
|
||||
BtdrvAppearanceType_GardenLight = 0x058D, ///< Garden Light
|
||||
BtdrvAppearanceType_PoleTopLight = 0x058E, ///< Pole-top Light
|
||||
BtdrvAppearanceType_Spotlight = 0x058F, ///< Spotlight
|
||||
BtdrvAppearanceType_LinearLight = 0x0590, ///< Linear Light
|
||||
BtdrvAppearanceType_StreetLight = 0x0591, ///< Street Light
|
||||
BtdrvAppearanceType_ShelvesLight = 0x0592, ///< Shelves Light
|
||||
BtdrvAppearanceType_BayLight = 0x0593, ///< Bay Light
|
||||
BtdrvAppearanceType_EmergencyExitLight = 0x0594, ///< Emergency Exit Light
|
||||
BtdrvAppearanceType_LightController = 0x0595, ///< Light Controller
|
||||
BtdrvAppearanceType_LightDriver = 0x0596, ///< Light Driver
|
||||
BtdrvAppearanceType_Bulb = 0x0597, ///< Bulb
|
||||
BtdrvAppearanceType_LowBayLight = 0x0598, ///< Low-bay Light
|
||||
BtdrvAppearanceType_HighBayLight = 0x0599, ///< High-bay Light
|
||||
BtdrvAppearanceType_CeilingFan = 0x05C1, ///< Ceiling Fan
|
||||
BtdrvAppearanceType_AxialFan = 0x05C2, ///< Axial Fan
|
||||
BtdrvAppearanceType_ExhaustFan = 0x05C3, ///< Exhaust Fan
|
||||
BtdrvAppearanceType_PedestalFan = 0x05C4, ///< Pedestal Fan
|
||||
BtdrvAppearanceType_DeskFan = 0x05C5, ///< Desk Fan
|
||||
BtdrvAppearanceType_WallFan = 0x05C6, ///< Wall Fan
|
||||
BtdrvAppearanceType_Thermostat = 0x0601, ///< Thermostat
|
||||
BtdrvAppearanceType_Humidifier = 0x0602, ///< Humidifier
|
||||
BtdrvAppearanceType_DeHumidifier = 0x0603, ///< De-humidifier
|
||||
BtdrvAppearanceType_Heater = 0x0604, ///< Heater
|
||||
BtdrvAppearanceType_HvacRadiator = 0x0605, ///< HVAC Radiator
|
||||
BtdrvAppearanceType_HvacBoiler = 0x0606, ///< HVAC Boiler
|
||||
BtdrvAppearanceType_HvacHeatPump = 0x0607, ///< HVAC Heat Pump
|
||||
BtdrvAppearanceType_HvacInfraredHeater = 0x0608, ///< HVAC Infrared Heater
|
||||
BtdrvAppearanceType_HvacRadiantPanelHeater = 0x0609, ///< HVAC Radiant Panel Heater
|
||||
BtdrvAppearanceType_HvacFanHeater = 0x060A, ///< HVAC Fan Heater
|
||||
BtdrvAppearanceType_HvacAirCurtain = 0x060B, ///< HVAC Air Curtain
|
||||
BtdrvAppearanceType_HeatingRadiator = 0x06C1, ///< Heating Radiator
|
||||
BtdrvAppearanceType_HeatingBoiler = 0x06C2, ///< Heating Boiler
|
||||
BtdrvAppearanceType_HeatingHeatPump = 0x06C3, ///< Heating Heat Pump
|
||||
BtdrvAppearanceType_HeatingInfraredHeater = 0x06C4, ///< Heating Infrared Heater
|
||||
BtdrvAppearanceType_HeatingRadiantPanelHeater = 0x06C5, ///< Heating Radiant Panel Heater
|
||||
BtdrvAppearanceType_HeatingFanHeater = 0x06C6, ///< Heating Fan Heater
|
||||
BtdrvAppearanceType_HeatingAirCurtain = 0x06C7, ///< Heating Air Curtain
|
||||
BtdrvAppearanceType_AccessDoor = 0x0701, ///< Access Door
|
||||
BtdrvAppearanceType_GarageDoor = 0x0702, ///< Garage Door
|
||||
BtdrvAppearanceType_EmergencyExitDoor = 0x0703, ///< Emergency Exit Door
|
||||
BtdrvAppearanceType_AccessLock = 0x0704, ///< Access Lock
|
||||
BtdrvAppearanceType_Elevator = 0x0705, ///< Elevator
|
||||
BtdrvAppearanceType_Window = 0x0706, ///< Window
|
||||
BtdrvAppearanceType_EntranceGate = 0x0707, ///< Entrance Gate
|
||||
BtdrvAppearanceType_DoorLock = 0x0708, ///< Door Lock
|
||||
BtdrvAppearanceType_Locker = 0x0709, ///< Locker
|
||||
BtdrvAppearanceType_MotorizedGate = 0x0741, ///< Motorized Gate
|
||||
BtdrvAppearanceType_Awning = 0x0742, ///< Awning
|
||||
BtdrvAppearanceType_BlindsOrShades = 0x0743, ///< Blinds or Shades
|
||||
BtdrvAppearanceType_Curtains = 0x0744, ///< Curtains
|
||||
BtdrvAppearanceType_Screen = 0x0745, ///< Screen
|
||||
BtdrvAppearanceType_PowerOutlet = 0x0781, ///< Power Outlet
|
||||
BtdrvAppearanceType_PowerStrip = 0x0782, ///< Power Strip
|
||||
BtdrvAppearanceType_Plug = 0x0783, ///< Plug
|
||||
BtdrvAppearanceType_PowerSupply = 0x0784, ///< Power Supply
|
||||
BtdrvAppearanceType_LedDriver = 0x0785, ///< LED Driver
|
||||
BtdrvAppearanceType_FluorescentLampGear = 0x0786, ///< Fluorescent Lamp Gear
|
||||
BtdrvAppearanceType_HidLampGear = 0x0787, ///< HID Lamp Gear
|
||||
BtdrvAppearanceType_ChargeCase = 0x0788, ///< Charge Case
|
||||
BtdrvAppearanceType_PowerBank = 0x0789, ///< Power Bank
|
||||
BtdrvAppearanceType_IncandescentLightBulb = 0x07C1, ///< Incandescent Light Bulb
|
||||
BtdrvAppearanceType_LedLamp = 0x07C2, ///< LED Lamp
|
||||
BtdrvAppearanceType_HidLamp = 0x07C3, ///< HID Lamp
|
||||
BtdrvAppearanceType_FluorescentLamp = 0x07C4, ///< Fluorescent Lamp
|
||||
BtdrvAppearanceType_LedArray = 0x07C5, ///< LED Array
|
||||
BtdrvAppearanceType_MultiColorLedArray = 0x07C6, ///< Multi-Color LED Array
|
||||
BtdrvAppearanceType_LowVoltageHalogen = 0x07C7, ///< Low voltage halogen
|
||||
BtdrvAppearanceType_OrganicLightEmittingDiodeOled = 0x07C8, ///< Organic light emitting diode (OLED)
|
||||
BtdrvAppearanceType_WindowShades = 0x0801, ///< Window Shades
|
||||
BtdrvAppearanceType_WindowBlinds = 0x0802, ///< Window Blinds
|
||||
BtdrvAppearanceType_WindowAwning = 0x0803, ///< Window Awning
|
||||
BtdrvAppearanceType_WindowCurtain = 0x0804, ///< Window Curtain
|
||||
BtdrvAppearanceType_ExteriorShutter = 0x0805, ///< Exterior Shutter
|
||||
BtdrvAppearanceType_ExteriorScreen = 0x0806, ///< Exterior Screen
|
||||
BtdrvAppearanceType_StandaloneSpeaker = 0x0841, ///< Standalone Speaker
|
||||
BtdrvAppearanceType_Soundbar = 0x0842, ///< Soundbar
|
||||
BtdrvAppearanceType_BookshelfSpeaker = 0x0843, ///< Bookshelf Speaker
|
||||
BtdrvAppearanceType_StandmountedSpeaker = 0x0844, ///< Standmounted Speaker
|
||||
BtdrvAppearanceType_Speakerphone = 0x0845, ///< Speakerphone
|
||||
BtdrvAppearanceType_Microphone = 0x0881, ///< Microphone
|
||||
BtdrvAppearanceType_Alarm = 0x0882, ///< Alarm
|
||||
BtdrvAppearanceType_Bell = 0x0883, ///< Bell
|
||||
BtdrvAppearanceType_Horn = 0x0884, ///< Horn
|
||||
BtdrvAppearanceType_BroadcastingDevice = 0x0885, ///< Broadcasting Device
|
||||
BtdrvAppearanceType_ServiceDesk = 0x0886, ///< Service Desk
|
||||
BtdrvAppearanceType_Kiosk = 0x0887, ///< Kiosk
|
||||
BtdrvAppearanceType_BroadcastingRoom = 0x0888, ///< Broadcasting Room
|
||||
BtdrvAppearanceType_Auditorium = 0x0889, ///< Auditorium
|
||||
BtdrvAppearanceType_Car = 0x08C1, ///< Car
|
||||
BtdrvAppearanceType_LargeGoodsVehicle = 0x08C2, ///< Large Goods Vehicle
|
||||
BtdrvAppearanceType_2WheeledVehicle = 0x08C3, ///< 2-Wheeled Vehicle
|
||||
BtdrvAppearanceType_Motorbike = 0x08C4, ///< Motorbike
|
||||
BtdrvAppearanceType_Scooter = 0x08C5, ///< Scooter
|
||||
BtdrvAppearanceType_Moped = 0x08C6, ///< Moped
|
||||
BtdrvAppearanceType_3WheeledVehicle = 0x08C7, ///< 3-Wheeled Vehicle
|
||||
BtdrvAppearanceType_LightVehicle = 0x08C8, ///< Light Vehicle
|
||||
BtdrvAppearanceType_QuadBike = 0x08C9, ///< Quad Bike
|
||||
BtdrvAppearanceType_Minibus = 0x08CA, ///< Minibus
|
||||
BtdrvAppearanceType_Bus = 0x08CB, ///< Bus
|
||||
BtdrvAppearanceType_Trolley = 0x08CC, ///< Trolley
|
||||
BtdrvAppearanceType_AgriculturalVehicle = 0x08CD, ///< Agricultural Vehicle
|
||||
BtdrvAppearanceType_CamperCaravan = 0x08CE, ///< Camper / Caravan
|
||||
BtdrvAppearanceType_RecreationalVehicleMotorHome = 0x08CF, ///< Recreational Vehicle / Motor Home
|
||||
BtdrvAppearanceType_Refrigerator = 0x0901, ///< Refrigerator
|
||||
BtdrvAppearanceType_Freezer = 0x0902, ///< Freezer
|
||||
BtdrvAppearanceType_Oven = 0x0903, ///< Oven
|
||||
BtdrvAppearanceType_Microwave = 0x0904, ///< Microwave
|
||||
BtdrvAppearanceType_Toaster = 0x0905, ///< Toaster
|
||||
BtdrvAppearanceType_WashingMachine = 0x0906, ///< Washing Machine
|
||||
BtdrvAppearanceType_Dryer = 0x0907, ///< Dryer
|
||||
BtdrvAppearanceType_CoffeeMaker = 0x0908, ///< Coffee maker
|
||||
BtdrvAppearanceType_ClothesIron = 0x0909, ///< Clothes iron
|
||||
BtdrvAppearanceType_CurlingIron = 0x090A, ///< Curling iron
|
||||
BtdrvAppearanceType_HairDryer = 0x090B, ///< Hair dryer
|
||||
BtdrvAppearanceType_VacuumCleaner = 0x090C, ///< Vacuum cleaner
|
||||
BtdrvAppearanceType_RoboticVacuumCleaner = 0x090D, ///< Robotic vacuum cleaner
|
||||
BtdrvAppearanceType_RiceCooker = 0x090E, ///< Rice cooker
|
||||
BtdrvAppearanceType_ClothesSteamer = 0x090F, ///< Clothes steamer
|
||||
BtdrvAppearanceType_Earbud = 0x0941, ///< Earbud
|
||||
BtdrvAppearanceType_Headset = 0x0942, ///< Headset
|
||||
BtdrvAppearanceType_Headphones = 0x0943, ///< Headphones
|
||||
BtdrvAppearanceType_NeckBand = 0x0944, ///< Neck Band
|
||||
BtdrvAppearanceType_LightAircraft = 0x0981, ///< Light Aircraft
|
||||
BtdrvAppearanceType_Microlight = 0x0982, ///< Microlight
|
||||
BtdrvAppearanceType_Paraglider = 0x0983, ///< Paraglider
|
||||
BtdrvAppearanceType_LargePassengerAircraft = 0x0984, ///< Large Passenger Aircraft
|
||||
BtdrvAppearanceType_Amplifier = 0x09C1, ///< Amplifier
|
||||
BtdrvAppearanceType_Receiver = 0x09C2, ///< Receiver
|
||||
BtdrvAppearanceType_Radio = 0x09C3, ///< Radio
|
||||
BtdrvAppearanceType_Tuner = 0x09C4, ///< Tuner
|
||||
BtdrvAppearanceType_Turntable = 0x09C5, ///< Turntable
|
||||
BtdrvAppearanceType_CdPlayer = 0x09C6, ///< CD Player
|
||||
BtdrvAppearanceType_DvdPlayer = 0x09C7, ///< DVD Player
|
||||
BtdrvAppearanceType_BlurayPlayer = 0x09C8, ///< Bluray Player
|
||||
BtdrvAppearanceType_OpticalDiscPlayer = 0x09C9, ///< Optical Disc Player
|
||||
BtdrvAppearanceType_SetTopBox = 0x09CA, ///< Set-Top Box
|
||||
BtdrvAppearanceType_Television = 0x0A01, ///< Television
|
||||
BtdrvAppearanceType_Monitor = 0x0A02, ///< Monitor
|
||||
BtdrvAppearanceType_Projector = 0x0A03, ///< Projector
|
||||
BtdrvAppearanceType_InEarHearingAid = 0x0A41, ///< In-ear hearing aid
|
||||
BtdrvAppearanceType_BehindEarHearingAid = 0x0A42, ///< Behind-ear hearing aid
|
||||
BtdrvAppearanceType_CochlearImplant = 0x0A43, ///< Cochlear Implant
|
||||
BtdrvAppearanceType_HomeVideoGameConsole = 0x0A81, ///< Home Video Game Console
|
||||
BtdrvAppearanceType_PortableHandheldConsole = 0x0A82, ///< Portable handheld console
|
||||
BtdrvAppearanceType_FingertipPulseOximeter = 0x0C41, ///< Fingertip Pulse Oximeter
|
||||
BtdrvAppearanceType_WristWornPulseOximeter = 0x0C42, ///< Wrist Worn Pulse Oximeter
|
||||
BtdrvAppearanceType_PoweredWheelchair = 0x0CC1, ///< Powered Wheelchair
|
||||
BtdrvAppearanceType_MobilityScooter = 0x0CC2, ///< Mobility Scooter
|
||||
BtdrvAppearanceType_InsulinPumpDurablePump = 0x0D41, ///< Insulin Pump, durable pump
|
||||
BtdrvAppearanceType_InsulinPumpPatchPump = 0x0D44, ///< Insulin Pump, patch pump
|
||||
BtdrvAppearanceType_InsulinPen = 0x0D48, ///< Insulin Pen
|
||||
BtdrvAppearanceType_HandheldSpirometer = 0x0DC1, ///< Handheld Spirometer
|
||||
BtdrvAppearanceType_LocationDisplay = 0x1441, ///< Location Display
|
||||
BtdrvAppearanceType_LocationAndNavigationDisplay = 0x1442, ///< Location and Navigation Display
|
||||
BtdrvAppearanceType_LocationPod = 0x1443, ///< Location Pod
|
||||
BtdrvAppearanceType_LocationAndNavigationPod = 0x1444, ///< Location and Navigation Pod
|
||||
} BtdrvAppearanceType;
|
||||
|
||||
/// GattServiceUuidType
|
||||
typedef enum {
|
||||
BtdrvGattServiceUuidType_GenericAccess = 0x1800, ///< Generic Access
|
||||
BtdrvGattServiceUuidType_GenericAttribute = 0x1801, ///< Generic Attribute
|
||||
BtdrvGattServiceUuidType_ImmediateAlert = 0x1802, ///< Immediate Alert
|
||||
BtdrvGattServiceUuidType_LinkLoss = 0x1803, ///< Link Loss
|
||||
BtdrvGattServiceUuidType_TxPower = 0x1804, ///< Tx Power
|
||||
BtdrvGattServiceUuidType_CurrentTime = 0x1805, ///< Current Time
|
||||
BtdrvGattServiceUuidType_ReferenceTimeUpdate = 0x1806, ///< Reference Time Update
|
||||
BtdrvGattServiceUuidType_NextDstChange = 0x1807, ///< Next DST Change
|
||||
BtdrvGattServiceUuidType_Glucose = 0x1808, ///< Glucose
|
||||
BtdrvGattServiceUuidType_HealthThermometer = 0x1809, ///< Health Thermometer
|
||||
BtdrvGattServiceUuidType_DeviceInformation = 0x180A, ///< Device Information
|
||||
BtdrvGattServiceUuidType_HeartRate = 0x180D, ///< Heart Rate
|
||||
BtdrvGattServiceUuidType_PhoneAlertStatus = 0x180E, ///< Phone Alert Status
|
||||
BtdrvGattServiceUuidType_Battery = 0x180F, ///< Battery
|
||||
BtdrvGattServiceUuidType_BloodPressure = 0x1810, ///< Blood Pressure
|
||||
BtdrvGattServiceUuidType_AlertNotification = 0x1811, ///< Alert Notification
|
||||
BtdrvGattServiceUuidType_HumanInterfaceDevice = 0x1812, ///< Human Interface Device
|
||||
BtdrvGattServiceUuidType_ScanParameters = 0x1813, ///< Scan Parameters
|
||||
BtdrvGattServiceUuidType_RunningSpeedAndCadence = 0x1814, ///< Running Speed and Cadence
|
||||
BtdrvGattServiceUuidType_AutomationIo = 0x1815, ///< Automation IO
|
||||
BtdrvGattServiceUuidType_CyclingSpeedAndCadence = 0x1816, ///< Cycling Speed and Cadence
|
||||
BtdrvGattServiceUuidType_CyclingPower = 0x1818, ///< Cycling Power
|
||||
BtdrvGattServiceUuidType_LocationAndNavigation = 0x1819, ///< Location and Navigation
|
||||
BtdrvGattServiceUuidType_EnvironmentalSensing = 0x181A, ///< Environmental Sensing
|
||||
BtdrvGattServiceUuidType_BodyComposition = 0x181B, ///< Body Composition
|
||||
BtdrvGattServiceUuidType_UserData = 0x181C, ///< User Data
|
||||
BtdrvGattServiceUuidType_WeightScale = 0x181D, ///< Weight Scale
|
||||
BtdrvGattServiceUuidType_BondManagement = 0x181E, ///< Bond Management
|
||||
BtdrvGattServiceUuidType_ContinuousGlucoseMonitoring = 0x181F, ///< Continuous Glucose Monitoring
|
||||
BtdrvGattServiceUuidType_InternetProtocolSupport = 0x1820, ///< Internet Protocol Support
|
||||
BtdrvGattServiceUuidType_IndoorPositioning = 0x1821, ///< Indoor Positioning
|
||||
BtdrvGattServiceUuidType_PulseOximeter = 0x1822, ///< Pulse Oximeter
|
||||
BtdrvGattServiceUuidType_HttpProxy = 0x1823, ///< HTTP Proxy
|
||||
BtdrvGattServiceUuidType_TransportDiscovery = 0x1824, ///< Transport Discovery
|
||||
BtdrvGattServiceUuidType_ObjectTransfer = 0x1825, ///< Object Transfer
|
||||
BtdrvGattServiceUuidType_FitnessMachine = 0x1826, ///< Fitness Machine
|
||||
BtdrvGattServiceUuidType_MeshProvisioning = 0x1827, ///< Mesh Provisioning
|
||||
BtdrvGattServiceUuidType_MeshProxy = 0x1828, ///< Mesh Proxy
|
||||
BtdrvGattServiceUuidType_ReconnectionConfiguration = 0x1829, ///< Reconnection Configuration
|
||||
BtdrvGattServiceUuidType_InsulinDelivery = 0x183A, ///< Insulin Delivery
|
||||
BtdrvGattServiceUuidType_BinarySensor = 0x183B, ///< Binary Sensor
|
||||
BtdrvGattServiceUuidType_EmergencyConfiguration = 0x183C, ///< Emergency Configuration
|
||||
BtdrvGattServiceUuidType_AuthorizationControl = 0x183D, ///< Authorization Control
|
||||
BtdrvGattServiceUuidType_PhysicalActivityMonitor = 0x183E, ///< Physical Activity Monitor
|
||||
BtdrvGattServiceUuidType_ElapsedTime = 0x183F, ///< Elapsed Time
|
||||
BtdrvGattServiceUuidType_GenericHealthSensor = 0x1840, ///< Generic Health Sensor
|
||||
BtdrvGattServiceUuidType_AudioInputControl = 0x1843, ///< Audio Input Control
|
||||
BtdrvGattServiceUuidType_VolumeControl = 0x1844, ///< Volume Control
|
||||
BtdrvGattServiceUuidType_VolumeOffsetControl = 0x1845, ///< Volume Offset Control
|
||||
BtdrvGattServiceUuidType_CoordinatedSetIdentification = 0x1846, ///< Coordinated Set Identification
|
||||
BtdrvGattServiceUuidType_DeviceTime = 0x1847, ///< Device Time
|
||||
BtdrvGattServiceUuidType_MediaControl = 0x1848, ///< Media Control
|
||||
BtdrvGattServiceUuidType_GenericMediaControl = 0x1849, ///< Generic Media Control
|
||||
BtdrvGattServiceUuidType_ConstantToneExtension = 0x184A, ///< Constant Tone Extension
|
||||
BtdrvGattServiceUuidType_TelephoneBearer = 0x184B, ///< Telephone Bearer
|
||||
BtdrvGattServiceUuidType_GenericTelephoneBearer = 0x184C, ///< Generic Telephone Bearer
|
||||
BtdrvGattServiceUuidType_MicrophoneControl = 0x184D, ///< Microphone Control
|
||||
BtdrvGattServiceUuidType_AudioStreamControl = 0x184E, ///< Audio Stream Control
|
||||
BtdrvGattServiceUuidType_BroadcastAudioScan = 0x184F, ///< Broadcast Audio Scan
|
||||
BtdrvGattServiceUuidType_PublishedAudioCapabilities = 0x1850, ///< Published Audio Capabilities
|
||||
BtdrvGattServiceUuidType_BasicAudioAnnouncement = 0x1851, ///< Basic Audio Announcement
|
||||
BtdrvGattServiceUuidType_BroadcastAudioAnnouncement = 0x1852, ///< Broadcast Audio Announcement
|
||||
BtdrvGattServiceUuidType_CommonAudio = 0x1853, ///< Common Audio
|
||||
BtdrvGattServiceUuidType_HearingAccess = 0x1854, ///< Hearing Access
|
||||
BtdrvGattServiceUuidType_TelephonyAndMediaAudio = 0x1855, ///< Telephony and Media Audio
|
||||
BtdrvGattServiceUuidType_PublicBroadcastAnnouncement = 0x1856, ///< Public Broadcast Announcement
|
||||
BtdrvGattServiceUuidType_ElectronicShelfLabel = 0x1857, ///< Electronic Shelf Label
|
||||
} BtdrvGattServiceUuidType;
|
||||
|
||||
/// GattCharacteristicUuidType
|
||||
typedef enum {
|
||||
BtdrvGattCharacteristicUuidType_DeviceName = 0x2A00, ///< Device Name
|
||||
BtdrvGattCharacteristicUuidType_Appearance = 0x2A01, ///< Appearance
|
||||
BtdrvGattCharacteristicUuidType_PeripheralPrivacyFlag = 0x2A02, ///< Peripheral Privacy Flag
|
||||
BtdrvGattCharacteristicUuidType_ReconnectionAddress = 0x2A03, ///< Reconnection Address
|
||||
BtdrvGattCharacteristicUuidType_PeripheralPreferredConnectionParameters = 0x2A04, ///< Peripheral Preferred Connection Parameters
|
||||
BtdrvGattCharacteristicUuidType_ServiceChanged = 0x2A05, ///< Service Changed
|
||||
BtdrvGattCharacteristicUuidType_AlertLevel = 0x2A06, ///< Alert Level
|
||||
BtdrvGattCharacteristicUuidType_TxPowerLevel = 0x2A07, ///< Tx Power Level
|
||||
BtdrvGattCharacteristicUuidType_DateTime = 0x2A08, ///< Date Time
|
||||
BtdrvGattCharacteristicUuidType_DayOfWeek = 0x2A09, ///< Day of Week
|
||||
BtdrvGattCharacteristicUuidType_DayDateTime = 0x2A0A, ///< Day Date Time
|
||||
BtdrvGattCharacteristicUuidType_ExactTime256 = 0x2A0C, ///< Exact Time 256
|
||||
BtdrvGattCharacteristicUuidType_DstOffset = 0x2A0D, ///< DST Offset
|
||||
BtdrvGattCharacteristicUuidType_TimeZone = 0x2A0E, ///< Time Zone
|
||||
BtdrvGattCharacteristicUuidType_LocalTimeInformation = 0x2A0F, ///< Local Time Information
|
||||
BtdrvGattCharacteristicUuidType_TimeWithDst = 0x2A11, ///< Time with DST
|
||||
BtdrvGattCharacteristicUuidType_TimeAccuracy = 0x2A12, ///< Time Accuracy
|
||||
BtdrvGattCharacteristicUuidType_TimeSource = 0x2A13, ///< Time Source
|
||||
BtdrvGattCharacteristicUuidType_ReferenceTimeInformation = 0x2A14, ///< Reference Time Information
|
||||
BtdrvGattCharacteristicUuidType_TimeUpdateControlPoint = 0x2A16, ///< Time Update Control Point
|
||||
BtdrvGattCharacteristicUuidType_TimeUpdateState = 0x2A17, ///< Time Update State
|
||||
BtdrvGattCharacteristicUuidType_GlucoseMeasurement = 0x2A18, ///< Glucose Measurement
|
||||
BtdrvGattCharacteristicUuidType_BatteryLevel = 0x2A19, ///< Battery Level
|
||||
BtdrvGattCharacteristicUuidType_TemperatureMeasurement = 0x2A1C, ///< Temperature Measurement
|
||||
BtdrvGattCharacteristicUuidType_TemperatureType = 0x2A1D, ///< Temperature Type
|
||||
BtdrvGattCharacteristicUuidType_IntermediateTemperature = 0x2A1E, ///< Intermediate Temperature
|
||||
BtdrvGattCharacteristicUuidType_MeasurementInterval = 0x2A21, ///< Measurement Interval
|
||||
BtdrvGattCharacteristicUuidType_BootKeyboardInputReport = 0x2A22, ///< Boot Keyboard Input Report
|
||||
BtdrvGattCharacteristicUuidType_SystemId = 0x2A23, ///< System ID
|
||||
BtdrvGattCharacteristicUuidType_ModelNumberString = 0x2A24, ///< Model Number String
|
||||
BtdrvGattCharacteristicUuidType_SerialNumberString = 0x2A25, ///< Serial Number String
|
||||
BtdrvGattCharacteristicUuidType_FirmwareRevisionString = 0x2A26, ///< Firmware Revision String
|
||||
BtdrvGattCharacteristicUuidType_HardwareRevisionString = 0x2A27, ///< Hardware Revision String
|
||||
BtdrvGattCharacteristicUuidType_SoftwareRevisionString = 0x2A28, ///< Software Revision String
|
||||
BtdrvGattCharacteristicUuidType_ManufacturerNameString = 0x2A29, ///< Manufacturer Name String
|
||||
BtdrvGattCharacteristicUuidType_IeeeRegulatoryCertificationDataList = 0x2A2A, ///< IEEE 11073-20601 Regulatory Certification Data List
|
||||
BtdrvGattCharacteristicUuidType_CurrentTime = 0x2A2B, ///< Current Time
|
||||
BtdrvGattCharacteristicUuidType_MagneticDeclination = 0x2A2C, ///< Magnetic Declination
|
||||
BtdrvGattCharacteristicUuidType_ScanRefresh = 0x2A31, ///< Scan Refresh
|
||||
BtdrvGattCharacteristicUuidType_BootKeyboardOutputReport = 0x2A32, ///< Boot Keyboard Output Report
|
||||
BtdrvGattCharacteristicUuidType_BootMouseInputReport = 0x2A33, ///< Boot Mouse Input Report
|
||||
BtdrvGattCharacteristicUuidType_GlucoseMeasurementContext = 0x2A34, ///< Glucose Measurement Context
|
||||
BtdrvGattCharacteristicUuidType_BloodPressureMeasurement = 0x2A35, ///< Blood Pressure Measurement
|
||||
BtdrvGattCharacteristicUuidType_IntermediateCuffPressure = 0x2A36, ///< Intermediate Cuff Pressure
|
||||
BtdrvGattCharacteristicUuidType_HeartRateMeasurement = 0x2A37, ///< Heart Rate Measurement
|
||||
BtdrvGattCharacteristicUuidType_BodySensorLocation = 0x2A38, ///< Body Sensor Location
|
||||
BtdrvGattCharacteristicUuidType_HeartRateControlPoint = 0x2A39, ///< Heart Rate Control Point
|
||||
BtdrvGattCharacteristicUuidType_AlertStatus = 0x2A3F, ///< Alert Status
|
||||
BtdrvGattCharacteristicUuidType_RingerControlPoint = 0x2A40, ///< Ringer Control Point
|
||||
BtdrvGattCharacteristicUuidType_RingerSetting = 0x2A41, ///< Ringer Setting
|
||||
BtdrvGattCharacteristicUuidType_AlertCategoryIdBitMask = 0x2A42, ///< Alert Category ID Bit Mask
|
||||
BtdrvGattCharacteristicUuidType_AlertCategoryId = 0x2A43, ///< Alert Category ID
|
||||
BtdrvGattCharacteristicUuidType_AlertNotificationControlPoint = 0x2A44, ///< Alert Notification Control Point
|
||||
BtdrvGattCharacteristicUuidType_UnreadAlertStatus = 0x2A45, ///< Unread Alert Status
|
||||
BtdrvGattCharacteristicUuidType_NewAlert = 0x2A46, ///< New Alert
|
||||
BtdrvGattCharacteristicUuidType_SupportedNewAlertCategory = 0x2A47, ///< Supported New Alert Category
|
||||
BtdrvGattCharacteristicUuidType_SupportedUnreadAlertCategory = 0x2A48, ///< Supported Unread Alert Category
|
||||
BtdrvGattCharacteristicUuidType_BloodPressureFeature = 0x2A49, ///< Blood Pressure Feature
|
||||
BtdrvGattCharacteristicUuidType_HidInformation = 0x2A4A, ///< HID Information
|
||||
BtdrvGattCharacteristicUuidType_ReportMap = 0x2A4B, ///< Report Map
|
||||
BtdrvGattCharacteristicUuidType_HidControlPoint = 0x2A4C, ///< HID Control Point
|
||||
BtdrvGattCharacteristicUuidType_Report = 0x2A4D, ///< Report
|
||||
BtdrvGattCharacteristicUuidType_ProtocolMode = 0x2A4E, ///< Protocol Mode
|
||||
BtdrvGattCharacteristicUuidType_ScanIntervalWindow = 0x2A4F, ///< Scan Interval Window
|
||||
BtdrvGattCharacteristicUuidType_PnpId = 0x2A50, ///< PnP ID
|
||||
BtdrvGattCharacteristicUuidType_GlucoseFeature = 0x2A51, ///< Glucose Feature
|
||||
BtdrvGattCharacteristicUuidType_RecordAccessControlPoint = 0x2A52, ///< Record Access Control Point
|
||||
BtdrvGattCharacteristicUuidType_RscMeasurement = 0x2A53, ///< RSC Measurement
|
||||
BtdrvGattCharacteristicUuidType_RscFeature = 0x2A54, ///< RSC Feature
|
||||
BtdrvGattCharacteristicUuidType_ScControlPoint = 0x2A55, ///< SC Control Point
|
||||
BtdrvGattCharacteristicUuidType_Aggregate = 0x2A5A, ///< Aggregate
|
||||
BtdrvGattCharacteristicUuidType_CscMeasurement = 0x2A5B, ///< CSC Measurement
|
||||
BtdrvGattCharacteristicUuidType_CscFeature = 0x2A5C, ///< CSC Feature
|
||||
BtdrvGattCharacteristicUuidType_SensorLocation = 0x2A5D, ///< Sensor Location
|
||||
BtdrvGattCharacteristicUuidType_PlxSpotCheckMeasurement = 0x2A5E, ///< PLX Spot-Check Measurement
|
||||
BtdrvGattCharacteristicUuidType_PlxContinuousMeasurement = 0x2A5F, ///< PLX Continuous Measurement
|
||||
BtdrvGattCharacteristicUuidType_PlxFeatures = 0x2A60, ///< PLX Features
|
||||
BtdrvGattCharacteristicUuidType_CyclingPowerMeasurement = 0x2A63, ///< Cycling Power Measurement
|
||||
BtdrvGattCharacteristicUuidType_CyclingPowerVector = 0x2A64, ///< Cycling Power Vector
|
||||
BtdrvGattCharacteristicUuidType_CyclingPowerFeature = 0x2A65, ///< Cycling Power Feature
|
||||
BtdrvGattCharacteristicUuidType_CyclingPowerControlPoint = 0x2A66, ///< Cycling Power Control Point
|
||||
BtdrvGattCharacteristicUuidType_LocationAndSpeed = 0x2A67, ///< Location and Speed
|
||||
BtdrvGattCharacteristicUuidType_Navigation = 0x2A68, ///< Navigation
|
||||
BtdrvGattCharacteristicUuidType_PositionQuality = 0x2A69, ///< Position Quality
|
||||
BtdrvGattCharacteristicUuidType_LnFeature = 0x2A6A, ///< LN Feature
|
||||
BtdrvGattCharacteristicUuidType_LnControlPoint = 0x2A6B, ///< LN Control Point
|
||||
BtdrvGattCharacteristicUuidType_Elevation = 0x2A6C, ///< Elevation
|
||||
BtdrvGattCharacteristicUuidType_Pressure = 0x2A6D, ///< Pressure
|
||||
BtdrvGattCharacteristicUuidType_Temperature = 0x2A6E, ///< Temperature
|
||||
BtdrvGattCharacteristicUuidType_Humidity = 0x2A6F, ///< Humidity
|
||||
BtdrvGattCharacteristicUuidType_TrueWindSpeed = 0x2A70, ///< True Wind Speed
|
||||
BtdrvGattCharacteristicUuidType_TrueWindDirection = 0x2A71, ///< True Wind Direction
|
||||
BtdrvGattCharacteristicUuidType_ApparentWindSpeed = 0x2A72, ///< Apparent Wind Speed
|
||||
BtdrvGattCharacteristicUuidType_ApparentWindDirection = 0x2A73, ///< Apparent Wind Direction
|
||||
BtdrvGattCharacteristicUuidType_GustFactor = 0x2A74, ///< Gust Factor
|
||||
BtdrvGattCharacteristicUuidType_PollenConcentration = 0x2A75, ///< Pollen Concentration
|
||||
BtdrvGattCharacteristicUuidType_UvIndex = 0x2A76, ///< UV Index
|
||||
BtdrvGattCharacteristicUuidType_Irradiance = 0x2A77, ///< Irradiance
|
||||
BtdrvGattCharacteristicUuidType_Rainfall = 0x2A78, ///< Rainfall
|
||||
BtdrvGattCharacteristicUuidType_WindChill = 0x2A79, ///< Wind Chill
|
||||
BtdrvGattCharacteristicUuidType_HeatIndex = 0x2A7A, ///< Heat Index
|
||||
BtdrvGattCharacteristicUuidType_DewPoint = 0x2A7B, ///< Dew Point
|
||||
BtdrvGattCharacteristicUuidType_DescriptorValueChanged = 0x2A7D, ///< Descriptor Value Changed
|
||||
BtdrvGattCharacteristicUuidType_AerobicHeartRateLowerLimit = 0x2A7E, ///< Aerobic Heart Rate Lower Limit
|
||||
BtdrvGattCharacteristicUuidType_AerobicThreshold = 0x2A7F, ///< Aerobic Threshold
|
||||
BtdrvGattCharacteristicUuidType_Age = 0x2A80, ///< Age
|
||||
BtdrvGattCharacteristicUuidType_AnaerobicHeartRateLowerLimit = 0x2A81, ///< Anaerobic Heart Rate Lower Limit
|
||||
BtdrvGattCharacteristicUuidType_AnaerobicHeartRateUpperLimit = 0x2A82, ///< Anaerobic Heart Rate Upper Limit
|
||||
BtdrvGattCharacteristicUuidType_AnaerobicThreshold = 0x2A83, ///< Anaerobic Threshold
|
||||
BtdrvGattCharacteristicUuidType_AerobicHeartRateUpperLimit = 0x2A84, ///< Aerobic Heart Rate Upper Limit
|
||||
BtdrvGattCharacteristicUuidType_DateOfBirth = 0x2A85, ///< Date of Birth
|
||||
BtdrvGattCharacteristicUuidType_DateOfThresholdAssessment = 0x2A86, ///< Date of Threshold Assessment
|
||||
BtdrvGattCharacteristicUuidType_EmailAddress = 0x2A87, ///< Email Address
|
||||
BtdrvGattCharacteristicUuidType_FatBurnHeartRateLowerLimit = 0x2A88, ///< Fat Burn Heart Rate Lower Limit
|
||||
BtdrvGattCharacteristicUuidType_FatBurnHeartRateUpperLimit = 0x2A89, ///< Fat Burn Heart Rate Upper Limit
|
||||
BtdrvGattCharacteristicUuidType_FirstName = 0x2A8A, ///< First Name
|
||||
BtdrvGattCharacteristicUuidType_FiveZoneHeartRateLimits = 0x2A8B, ///< Five Zone Heart Rate Limits
|
||||
BtdrvGattCharacteristicUuidType_Gender = 0x2A8C, ///< Gender
|
||||
BtdrvGattCharacteristicUuidType_HeartRateMax = 0x2A8D, ///< Heart Rate Max
|
||||
BtdrvGattCharacteristicUuidType_Height = 0x2A8E, ///< Height
|
||||
BtdrvGattCharacteristicUuidType_HipCircumference = 0x2A8F, ///< Hip Circumference
|
||||
BtdrvGattCharacteristicUuidType_LastName = 0x2A90, ///< Last Name
|
||||
BtdrvGattCharacteristicUuidType_MaximumRecommendedHeartRate = 0x2A91, ///< Maximum Recommended Heart Rate
|
||||
BtdrvGattCharacteristicUuidType_RestingHeartRate = 0x2A92, ///< Resting Heart Rate
|
||||
BtdrvGattCharacteristicUuidType_SportTypeForAerobicAndAnaerobicThresholds = 0x2A93, ///< Sport Type for Aerobic and Anaerobic Thresholds
|
||||
BtdrvGattCharacteristicUuidType_ThreeZoneHeartRateLimits = 0x2A94, ///< Three Zone Heart Rate Limits
|
||||
BtdrvGattCharacteristicUuidType_TwoZoneHeartRateLimits = 0x2A95, ///< Two Zone Heart Rate Limits
|
||||
BtdrvGattCharacteristicUuidType_Vo2Max = 0x2A96, ///< VO2 Max
|
||||
BtdrvGattCharacteristicUuidType_WaistCircumference = 0x2A97, ///< Waist Circumference
|
||||
BtdrvGattCharacteristicUuidType_Weight = 0x2A98, ///< Weight
|
||||
BtdrvGattCharacteristicUuidType_DatabaseChangeIncrement = 0x2A99, ///< Database Change Increment
|
||||
BtdrvGattCharacteristicUuidType_UserIndex = 0x2A9A, ///< User Index
|
||||
BtdrvGattCharacteristicUuidType_BodyCompositionFeature = 0x2A9B, ///< Body Composition Feature
|
||||
BtdrvGattCharacteristicUuidType_BodyCompositionMeasurement = 0x2A9C, ///< Body Composition Measurement
|
||||
BtdrvGattCharacteristicUuidType_WeightMeasurement = 0x2A9D, ///< Weight Measurement
|
||||
BtdrvGattCharacteristicUuidType_WeightScaleFeature = 0x2A9E, ///< Weight Scale Feature
|
||||
BtdrvGattCharacteristicUuidType_UserControlPoint = 0x2A9F, ///< User Control Point
|
||||
BtdrvGattCharacteristicUuidType_MagneticFluxDensity2D = 0x2AA0, ///< Magnetic Flux Density - 2D
|
||||
BtdrvGattCharacteristicUuidType_MagneticFluxDensity3D = 0x2AA1, ///< Magnetic Flux Density - 3D
|
||||
BtdrvGattCharacteristicUuidType_Language = 0x2AA2, ///< Language
|
||||
BtdrvGattCharacteristicUuidType_BarometricPressureTrend = 0x2AA3, ///< Barometric Pressure Trend
|
||||
BtdrvGattCharacteristicUuidType_BondManagementControlPoint = 0x2AA4, ///< Bond Management Control Point
|
||||
BtdrvGattCharacteristicUuidType_BondManagementFeature = 0x2AA5, ///< Bond Management Feature
|
||||
BtdrvGattCharacteristicUuidType_CentralAddressResolution = 0x2AA6, ///< Central Address Resolution
|
||||
BtdrvGattCharacteristicUuidType_CgmMeasurement = 0x2AA7, ///< CGM Measurement
|
||||
BtdrvGattCharacteristicUuidType_CgmFeature = 0x2AA8, ///< CGM Feature
|
||||
BtdrvGattCharacteristicUuidType_CgmStatus = 0x2AA9, ///< CGM Status
|
||||
BtdrvGattCharacteristicUuidType_CgmSessionStartTime = 0x2AAA, ///< CGM Session Start Time
|
||||
BtdrvGattCharacteristicUuidType_CgmSessionRunTime = 0x2AAB, ///< CGM Session Run Time
|
||||
BtdrvGattCharacteristicUuidType_CgmSpecificOpsControlPoint = 0x2AAC, ///< CGM Specific Ops Control Point
|
||||
BtdrvGattCharacteristicUuidType_IndoorPositioningConfiguration = 0x2AAD, ///< Indoor Positioning Configuration
|
||||
BtdrvGattCharacteristicUuidType_Latitude = 0x2AAE, ///< Latitude
|
||||
BtdrvGattCharacteristicUuidType_Longitude = 0x2AAF, ///< Longitude
|
||||
BtdrvGattCharacteristicUuidType_LocalNorthCoordinate = 0x2AB0, ///< Local North Coordinate
|
||||
BtdrvGattCharacteristicUuidType_LocalEastCoordinate = 0x2AB1, ///< Local East Coordinate
|
||||
BtdrvGattCharacteristicUuidType_FloorNumber = 0x2AB2, ///< Floor Number
|
||||
BtdrvGattCharacteristicUuidType_Altitude = 0x2AB3, ///< Altitude
|
||||
BtdrvGattCharacteristicUuidType_Uncertainty = 0x2AB4, ///< Uncertainty
|
||||
BtdrvGattCharacteristicUuidType_LocationName = 0x2AB5, ///< Location Name
|
||||
BtdrvGattCharacteristicUuidType_Uri = 0x2AB6, ///< URI
|
||||
BtdrvGattCharacteristicUuidType_HttpHeaders = 0x2AB7, ///< HTTP Headers
|
||||
BtdrvGattCharacteristicUuidType_HttpStatusCode = 0x2AB8, ///< HTTP Status Code
|
||||
BtdrvGattCharacteristicUuidType_HttpEntityBody = 0x2AB9, ///< HTTP Entity Body
|
||||
BtdrvGattCharacteristicUuidType_HttpControlPoint = 0x2ABA, ///< HTTP Control Point
|
||||
BtdrvGattCharacteristicUuidType_HttpsSecurity = 0x2ABB, ///< HTTPS Security
|
||||
BtdrvGattCharacteristicUuidType_TdsControlPoint = 0x2ABC, ///< TDS Control Point
|
||||
BtdrvGattCharacteristicUuidType_OtsFeature = 0x2ABD, ///< OTS Feature
|
||||
BtdrvGattCharacteristicUuidType_ObjectName = 0x2ABE, ///< Object Name
|
||||
BtdrvGattCharacteristicUuidType_ObjectType = 0x2ABF, ///< Object Type
|
||||
BtdrvGattCharacteristicUuidType_ObjectSize = 0x2AC0, ///< Object Size
|
||||
BtdrvGattCharacteristicUuidType_ObjectFirstCreated = 0x2AC1, ///< Object First-Created
|
||||
BtdrvGattCharacteristicUuidType_ObjectLastModified = 0x2AC2, ///< Object Last-Modified
|
||||
BtdrvGattCharacteristicUuidType_ObjectId = 0x2AC3, ///< Object ID
|
||||
BtdrvGattCharacteristicUuidType_ObjectProperties = 0x2AC4, ///< Object Properties
|
||||
BtdrvGattCharacteristicUuidType_ObjectActionControlPoint = 0x2AC5, ///< Object Action Control Point
|
||||
BtdrvGattCharacteristicUuidType_ObjectListControlPoint = 0x2AC6, ///< Object List Control Point
|
||||
BtdrvGattCharacteristicUuidType_ObjectListFilter = 0x2AC7, ///< Object List Filter
|
||||
BtdrvGattCharacteristicUuidType_ObjectChanged = 0x2AC8, ///< Object Changed
|
||||
BtdrvGattCharacteristicUuidType_ResolvablePrivateAddressOnly = 0x2AC9, ///< Resolvable Private Address Only
|
||||
BtdrvGattCharacteristicUuidType_FitnessMachineFeature = 0x2ACC, ///< Fitness Machine Feature
|
||||
BtdrvGattCharacteristicUuidType_TreadmillData = 0x2ACD, ///< Treadmill Data
|
||||
BtdrvGattCharacteristicUuidType_CrossTrainerData = 0x2ACE, ///< Cross Trainer Data
|
||||
BtdrvGattCharacteristicUuidType_StepClimberData = 0x2ACF, ///< Step Climber Data
|
||||
BtdrvGattCharacteristicUuidType_StairClimberData = 0x2AD0, ///< Stair Climber Data
|
||||
BtdrvGattCharacteristicUuidType_RowerData = 0x2AD1, ///< Rower Data
|
||||
BtdrvGattCharacteristicUuidType_IndoorBikeData = 0x2AD2, ///< Indoor Bike Data
|
||||
BtdrvGattCharacteristicUuidType_TrainingStatus = 0x2AD3, ///< Training Status
|
||||
BtdrvGattCharacteristicUuidType_SupportedSpeedRange = 0x2AD4, ///< Supported Speed Range
|
||||
BtdrvGattCharacteristicUuidType_SupportedInclinationRange = 0x2AD5, ///< Supported Inclination Range
|
||||
BtdrvGattCharacteristicUuidType_SupportedResistanceLevelRange = 0x2AD6, ///< Supported Resistance Level Range
|
||||
BtdrvGattCharacteristicUuidType_SupportedHeartRateRange = 0x2AD7, ///< Supported Heart Rate Range
|
||||
BtdrvGattCharacteristicUuidType_SupportedPowerRange = 0x2AD8, ///< Supported Power Range
|
||||
BtdrvGattCharacteristicUuidType_FitnessMachineControlPoint = 0x2AD9, ///< Fitness Machine Control Point
|
||||
BtdrvGattCharacteristicUuidType_FitnessMachineStatus = 0x2ADA, ///< Fitness Machine Status
|
||||
BtdrvGattCharacteristicUuidType_MeshProvisioningDataIn = 0x2ADB, ///< Mesh Provisioning Data In
|
||||
BtdrvGattCharacteristicUuidType_MeshProvisioningDataOut = 0x2ADC, ///< Mesh Provisioning Data Out
|
||||
BtdrvGattCharacteristicUuidType_MeshProxyDataIn = 0x2ADD, ///< Mesh Proxy Data In
|
||||
BtdrvGattCharacteristicUuidType_MeshProxyDataOut = 0x2ADE, ///< Mesh Proxy Data Out
|
||||
BtdrvGattCharacteristicUuidType_AverageCurrent = 0x2AE0, ///< Average Current
|
||||
BtdrvGattCharacteristicUuidType_AverageVoltage = 0x2AE1, ///< Average Voltage
|
||||
BtdrvGattCharacteristicUuidType_Boolean = 0x2AE2, ///< Boolean
|
||||
BtdrvGattCharacteristicUuidType_ChromaticDistanceFromPlanckian = 0x2AE3, ///< Chromatic Distance from Planckian
|
||||
BtdrvGattCharacteristicUuidType_ChromaticityCoordinates = 0x2AE4, ///< Chromaticity Coordinates
|
||||
BtdrvGattCharacteristicUuidType_ChromaticityInCctAndDuvValues = 0x2AE5, ///< Chromaticity in CCT and Duv Values
|
||||
BtdrvGattCharacteristicUuidType_ChromaticityTolerance = 0x2AE6, ///< Chromaticity Tolerance
|
||||
BtdrvGattCharacteristicUuidType_CieColorRenderingIndex = 0x2AE7, ///< CIE 13.3-1995 Color Rendering Index
|
||||
BtdrvGattCharacteristicUuidType_Coefficient = 0x2AE8, ///< Coefficient
|
||||
BtdrvGattCharacteristicUuidType_CorrelatedColorTemperature = 0x2AE9, ///< Correlated Color Temperature
|
||||
BtdrvGattCharacteristicUuidType_Count16 = 0x2AEA, ///< Count 16
|
||||
BtdrvGattCharacteristicUuidType_Count24 = 0x2AEB, ///< Count 24
|
||||
BtdrvGattCharacteristicUuidType_CountryCode = 0x2AEC, ///< Country Code
|
||||
BtdrvGattCharacteristicUuidType_DateUtc = 0x2AED, ///< Date UTC
|
||||
BtdrvGattCharacteristicUuidType_ElectricCurrent = 0x2AEE, ///< Electric Current
|
||||
BtdrvGattCharacteristicUuidType_ElectricCurrentRange = 0x2AEF, ///< Electric Current Range
|
||||
BtdrvGattCharacteristicUuidType_ElectricCurrentSpecification = 0x2AF0, ///< Electric Current Specification
|
||||
BtdrvGattCharacteristicUuidType_ElectricCurrentStatistics = 0x2AF1, ///< Electric Current Statistics
|
||||
BtdrvGattCharacteristicUuidType_Energy = 0x2AF2, ///< Energy
|
||||
BtdrvGattCharacteristicUuidType_EnergyInAPeriodOfDay = 0x2AF3, ///< Energy in a Period of Day
|
||||
BtdrvGattCharacteristicUuidType_EventStatistics = 0x2AF4, ///< Event Statistics
|
||||
BtdrvGattCharacteristicUuidType_FixedString16 = 0x2AF5, ///< Fixed String 16
|
||||
BtdrvGattCharacteristicUuidType_FixedString24 = 0x2AF6, ///< Fixed String 24
|
||||
BtdrvGattCharacteristicUuidType_FixedString36 = 0x2AF7, ///< Fixed String 36
|
||||
BtdrvGattCharacteristicUuidType_FixedString8 = 0x2AF8, ///< Fixed String 8
|
||||
BtdrvGattCharacteristicUuidType_GenericLevel = 0x2AF9, ///< Generic Level
|
||||
BtdrvGattCharacteristicUuidType_GlobalTradeItemNumber = 0x2AFA, ///< Global Trade Item Number
|
||||
BtdrvGattCharacteristicUuidType_Illuminance = 0x2AFB, ///< Illuminance
|
||||
BtdrvGattCharacteristicUuidType_LuminousEfficacy = 0x2AFC, ///< Luminous Efficacy
|
||||
BtdrvGattCharacteristicUuidType_LuminousEnergy = 0x2AFD, ///< Luminous Energy
|
||||
BtdrvGattCharacteristicUuidType_LuminousExposure = 0x2AFE, ///< Luminous Exposure
|
||||
BtdrvGattCharacteristicUuidType_LuminousFlux = 0x2AFF, ///< Luminous Flux
|
||||
BtdrvGattCharacteristicUuidType_LuminousFluxRange = 0x2B00, ///< Luminous Flux Range
|
||||
BtdrvGattCharacteristicUuidType_LuminousIntensity = 0x2B01, ///< Luminous Intensity
|
||||
BtdrvGattCharacteristicUuidType_MassFlow = 0x2B02, ///< Mass Flow
|
||||
BtdrvGattCharacteristicUuidType_PerceivedLightness = 0x2B03, ///< Perceived Lightness
|
||||
BtdrvGattCharacteristicUuidType_Percentage8 = 0x2B04, ///< Percentage 8
|
||||
BtdrvGattCharacteristicUuidType_Power = 0x2B05, ///< Power
|
||||
BtdrvGattCharacteristicUuidType_PowerSpecification = 0x2B06, ///< Power Specification
|
||||
BtdrvGattCharacteristicUuidType_RelativeRuntimeInACurrentRange = 0x2B07, ///< Relative Runtime in a Current Range
|
||||
BtdrvGattCharacteristicUuidType_RelativeRuntimeInAGenericLevelRange = 0x2B08, ///< Relative Runtime in a Generic Level Range
|
||||
BtdrvGattCharacteristicUuidType_RelativeValueInAVoltageRange = 0x2B09, ///< Relative Value in a Voltage Range
|
||||
BtdrvGattCharacteristicUuidType_RelativeValueInAnIlluminanceRange = 0x2B0A, ///< Relative Value in an Illuminance Range
|
||||
BtdrvGattCharacteristicUuidType_RelativeValueInAPeriodOfDay = 0x2B0B, ///< Relative Value in a Period of Day
|
||||
BtdrvGattCharacteristicUuidType_RelativeValueInATemperatureRange = 0x2B0C, ///< Relative Value in a Temperature Range
|
||||
BtdrvGattCharacteristicUuidType_Temperature8 = 0x2B0D, ///< Temperature 8
|
||||
BtdrvGattCharacteristicUuidType_Temperature8InAPeriodOfDay = 0x2B0E, ///< Temperature 8 in a Period of Day
|
||||
BtdrvGattCharacteristicUuidType_Temperature8Statistics = 0x2B0F, ///< Temperature 8 Statistics
|
||||
BtdrvGattCharacteristicUuidType_TemperatureRange = 0x2B10, ///< Temperature Range
|
||||
BtdrvGattCharacteristicUuidType_TemperatureStatistics = 0x2B11, ///< Temperature Statistics
|
||||
BtdrvGattCharacteristicUuidType_TimeDecihour8 = 0x2B12, ///< Time Decihour 8
|
||||
BtdrvGattCharacteristicUuidType_TimeExponential8 = 0x2B13, ///< Time Exponential 8
|
||||
BtdrvGattCharacteristicUuidType_TimeHour24 = 0x2B14, ///< Time Hour 24
|
||||
BtdrvGattCharacteristicUuidType_TimeMillisecond24 = 0x2B15, ///< Time Millisecond 24
|
||||
BtdrvGattCharacteristicUuidType_TimeSecond16 = 0x2B16, ///< Time Second 16
|
||||
BtdrvGattCharacteristicUuidType_TimeSecond8 = 0x2B17, ///< Time Second 8
|
||||
BtdrvGattCharacteristicUuidType_Voltage = 0x2B18, ///< Voltage
|
||||
BtdrvGattCharacteristicUuidType_VoltageSpecification = 0x2B19, ///< Voltage Specification
|
||||
BtdrvGattCharacteristicUuidType_VoltageStatistics = 0x2B1A, ///< Voltage Statistics
|
||||
BtdrvGattCharacteristicUuidType_VolumeFlow = 0x2B1B, ///< Volume Flow
|
||||
BtdrvGattCharacteristicUuidType_ChromaticityCoordinate = 0x2B1C, ///< Chromaticity Coordinate
|
||||
BtdrvGattCharacteristicUuidType_RcFeature = 0x2B1D, ///< RC Feature
|
||||
BtdrvGattCharacteristicUuidType_RcSettings = 0x2B1E, ///< RC Settings
|
||||
BtdrvGattCharacteristicUuidType_ReconnectionConfigurationControlPoint = 0x2B1F, ///< Reconnection Configuration Control Point
|
||||
BtdrvGattCharacteristicUuidType_IddStatusChanged = 0x2B20, ///< IDD Status Changed
|
||||
BtdrvGattCharacteristicUuidType_IddStatus = 0x2B21, ///< IDD Status
|
||||
BtdrvGattCharacteristicUuidType_IddAnnunciationStatus = 0x2B22, ///< IDD Annunciation Status
|
||||
BtdrvGattCharacteristicUuidType_IddFeatures = 0x2B23, ///< IDD Features
|
||||
BtdrvGattCharacteristicUuidType_IddStatusReaderControlPoint = 0x2B24, ///< IDD Status Reader Control Point
|
||||
BtdrvGattCharacteristicUuidType_IddCommandControlPoint = 0x2B25, ///< IDD Command Control Point
|
||||
BtdrvGattCharacteristicUuidType_IddCommandData = 0x2B26, ///< IDD Command Data
|
||||
BtdrvGattCharacteristicUuidType_IddRecordAccessControlPoint = 0x2B27, ///< IDD Record Access Control Point
|
||||
BtdrvGattCharacteristicUuidType_IddHistoryData = 0x2B28, ///< IDD History Data
|
||||
BtdrvGattCharacteristicUuidType_ClientSupportedFeatures = 0x2B29, ///< Client Supported Features
|
||||
BtdrvGattCharacteristicUuidType_DatabaseHash = 0x2B2A, ///< Database Hash
|
||||
BtdrvGattCharacteristicUuidType_BssControlPoint = 0x2B2B, ///< BSS Control Point
|
||||
BtdrvGattCharacteristicUuidType_BssResponse = 0x2B2C, ///< BSS Response
|
||||
BtdrvGattCharacteristicUuidType_EmergencyId = 0x2B2D, ///< Emergency ID
|
||||
BtdrvGattCharacteristicUuidType_EmergencyText = 0x2B2E, ///< Emergency Text
|
||||
BtdrvGattCharacteristicUuidType_AcsStatus = 0x2B2F, ///< ACS Status
|
||||
BtdrvGattCharacteristicUuidType_AcsDataIn = 0x2B30, ///< ACS Data In
|
||||
BtdrvGattCharacteristicUuidType_AcsDataOutNotify = 0x2B31, ///< ACS Data Out Notify
|
||||
BtdrvGattCharacteristicUuidType_AcsDataOutIndicate = 0x2B32, ///< ACS Data Out Indicate
|
||||
BtdrvGattCharacteristicUuidType_AcsControlPoint = 0x2B33, ///< ACS Control Point
|
||||
BtdrvGattCharacteristicUuidType_EnhancedBloodPressureMeasurement = 0x2B34, ///< Enhanced Blood Pressure Measurement
|
||||
BtdrvGattCharacteristicUuidType_EnhancedIntermediateCuffPressure = 0x2B35, ///< Enhanced Intermediate Cuff Pressure
|
||||
BtdrvGattCharacteristicUuidType_BloodPressureRecord = 0x2B36, ///< Blood Pressure Record
|
||||
BtdrvGattCharacteristicUuidType_RegisteredUser = 0x2B37, ///< Registered User
|
||||
BtdrvGattCharacteristicUuidType_BrEdrHandoverData = 0x2B38, ///< BR-EDR Handover Data
|
||||
BtdrvGattCharacteristicUuidType_BluetoothSigData = 0x2B39, ///< Bluetooth SIG Data
|
||||
BtdrvGattCharacteristicUuidType_ServerSupportedFeatures = 0x2B3A, ///< Server Supported Features
|
||||
BtdrvGattCharacteristicUuidType_PhysicalActivityMonitorFeatures = 0x2B3B, ///< Physical Activity Monitor Features
|
||||
BtdrvGattCharacteristicUuidType_GeneralActivityInstantaneousData = 0x2B3C, ///< General Activity Instantaneous Data
|
||||
BtdrvGattCharacteristicUuidType_GeneralActivitySummaryData = 0x2B3D, ///< General Activity Summary Data
|
||||
BtdrvGattCharacteristicUuidType_CardiorespiratoryActivityInstantaneousData = 0x2B3E, ///< CardioRespiratory Activity Instantaneous Data
|
||||
BtdrvGattCharacteristicUuidType_CardiorespiratoryActivitySummaryData = 0x2B3F, ///< CardioRespiratory Activity Summary Data
|
||||
BtdrvGattCharacteristicUuidType_StepCounterActivitySummaryData = 0x2B40, ///< Step Counter Activity Summary Data
|
||||
BtdrvGattCharacteristicUuidType_SleepActivityInstantaneousData = 0x2B41, ///< Sleep Activity Instantaneous Data
|
||||
BtdrvGattCharacteristicUuidType_SleepActivitySummaryData = 0x2B42, ///< Sleep Activity Summary Data
|
||||
BtdrvGattCharacteristicUuidType_PhysicalActivityMonitorControlPoint = 0x2B43, ///< Physical Activity Monitor Control Point
|
||||
BtdrvGattCharacteristicUuidType_ActivityCurrentSession = 0x2B44, ///< Activity Current Session
|
||||
BtdrvGattCharacteristicUuidType_PhysicalActivitySessionDescriptor = 0x2B45, ///< Physical Activity Session Descriptor
|
||||
BtdrvGattCharacteristicUuidType_PreferredUnits = 0x2B46, ///< Preferred Units
|
||||
BtdrvGattCharacteristicUuidType_HighResolutionHeight = 0x2B47, ///< High Resolution Height
|
||||
BtdrvGattCharacteristicUuidType_MiddleName = 0x2B48, ///< Middle Name
|
||||
BtdrvGattCharacteristicUuidType_StrideLength = 0x2B49, ///< Stride Length
|
||||
BtdrvGattCharacteristicUuidType_Handedness = 0x2B4A, ///< Handedness
|
||||
BtdrvGattCharacteristicUuidType_DeviceWearingPosition = 0x2B4B, ///< Device Wearing Position
|
||||
BtdrvGattCharacteristicUuidType_FourZoneHeartRateLimits = 0x2B4C, ///< Four Zone Heart Rate Limits
|
||||
BtdrvGattCharacteristicUuidType_HighIntensityExerciseThreshold = 0x2B4D, ///< High Intensity Exercise Threshold
|
||||
BtdrvGattCharacteristicUuidType_ActivityGoal = 0x2B4E, ///< Activity Goal
|
||||
BtdrvGattCharacteristicUuidType_SedentaryIntervalNotification = 0x2B4F, ///< Sedentary Interval Notification
|
||||
BtdrvGattCharacteristicUuidType_CaloricIntake = 0x2B50, ///< Caloric Intake
|
||||
BtdrvGattCharacteristicUuidType_TmapRole = 0x2B51, ///< TMAP Role
|
||||
BtdrvGattCharacteristicUuidType_AudioInputState = 0x2B77, ///< Audio Input State
|
||||
BtdrvGattCharacteristicUuidType_GainSettingsAttribute = 0x2B78, ///< Gain Settings Attribute
|
||||
BtdrvGattCharacteristicUuidType_AudioInputType = 0x2B79, ///< Audio Input Type
|
||||
BtdrvGattCharacteristicUuidType_AudioInputStatus = 0x2B7A, ///< Audio Input Status
|
||||
BtdrvGattCharacteristicUuidType_AudioInputControlPoint = 0x2B7B, ///< Audio Input Control Point
|
||||
BtdrvGattCharacteristicUuidType_AudioInputDescription = 0x2B7C, ///< Audio Input Description
|
||||
BtdrvGattCharacteristicUuidType_VolumeState = 0x2B7D, ///< Volume State
|
||||
BtdrvGattCharacteristicUuidType_VolumeControlPoint = 0x2B7E, ///< Volume Control Point
|
||||
BtdrvGattCharacteristicUuidType_VolumeFlags = 0x2B7F, ///< Volume Flags
|
||||
BtdrvGattCharacteristicUuidType_VolumeOffsetState = 0x2B80, ///< Volume Offset State
|
||||
BtdrvGattCharacteristicUuidType_AudioLocation = 0x2B81, ///< Audio Location
|
||||
BtdrvGattCharacteristicUuidType_VolumeOffsetControlPoint = 0x2B82, ///< Volume Offset Control Point
|
||||
BtdrvGattCharacteristicUuidType_AudioOutputDescription = 0x2B83, ///< Audio Output Description
|
||||
BtdrvGattCharacteristicUuidType_SetIdentityResolvingKey = 0x2B84, ///< Set Identity Resolving Key
|
||||
BtdrvGattCharacteristicUuidType_CoordinatedSetSize = 0x2B85, ///< Coordinated Set Size
|
||||
BtdrvGattCharacteristicUuidType_SetMemberLock = 0x2B86, ///< Set Member Lock
|
||||
BtdrvGattCharacteristicUuidType_SetMemberRank = 0x2B87, ///< Set Member Rank
|
||||
BtdrvGattCharacteristicUuidType_EncryptedDataKeyMaterial = 0x2B88, ///< Encrypted Data Key Material
|
||||
BtdrvGattCharacteristicUuidType_ApparentEnergy32 = 0x2B89, ///< Apparent Energy 32
|
||||
BtdrvGattCharacteristicUuidType_ApparentPower = 0x2B8A, ///< Apparent Power
|
||||
BtdrvGattCharacteristicUuidType_LiveHealthObservations = 0x2B8B, ///< Live Health Observations
|
||||
BtdrvGattCharacteristicUuidType_CoTextsubscript2Concentration = 0x2B8C, ///< CO\textsubscript{2} Concentration
|
||||
BtdrvGattCharacteristicUuidType_CosineOfTheAngle = 0x2B8D, ///< Cosine of the Angle
|
||||
BtdrvGattCharacteristicUuidType_DeviceTimeFeature = 0x2B8E, ///< Device Time Feature
|
||||
BtdrvGattCharacteristicUuidType_DeviceTimeParameters = 0x2B8F, ///< Device Time Parameters
|
||||
BtdrvGattCharacteristicUuidType_DeviceTime = 0x2B90, ///< Device Time
|
||||
BtdrvGattCharacteristicUuidType_DeviceTimeControlPoint = 0x2B91, ///< Device Time Control Point
|
||||
BtdrvGattCharacteristicUuidType_TimeChangeLogData = 0x2B92, ///< Time Change Log Data
|
||||
BtdrvGattCharacteristicUuidType_MediaPlayerName = 0x2B93, ///< Media Player Name
|
||||
BtdrvGattCharacteristicUuidType_MediaPlayerIconObjectId = 0x2B94, ///< Media Player Icon Object ID
|
||||
BtdrvGattCharacteristicUuidType_MediaPlayerIconUrl = 0x2B95, ///< Media Player Icon URL
|
||||
BtdrvGattCharacteristicUuidType_TrackChanged = 0x2B96, ///< Track Changed
|
||||
BtdrvGattCharacteristicUuidType_TrackTitle = 0x2B97, ///< Track Title
|
||||
BtdrvGattCharacteristicUuidType_TrackDuration = 0x2B98, ///< Track Duration
|
||||
BtdrvGattCharacteristicUuidType_TrackPosition = 0x2B99, ///< Track Position
|
||||
BtdrvGattCharacteristicUuidType_PlaybackSpeed = 0x2B9A, ///< Playback Speed
|
||||
BtdrvGattCharacteristicUuidType_SeekingSpeed = 0x2B9B, ///< Seeking Speed
|
||||
BtdrvGattCharacteristicUuidType_CurrentTrackSegmentsObjectId = 0x2B9C, ///< Current Track Segments Object ID
|
||||
BtdrvGattCharacteristicUuidType_CurrentTrackObjectId = 0x2B9D, ///< Current Track Object ID
|
||||
BtdrvGattCharacteristicUuidType_NextTrackObjectId = 0x2B9E, ///< Next Track Object ID
|
||||
BtdrvGattCharacteristicUuidType_ParentGroupObjectId = 0x2B9F, ///< Parent Group Object ID
|
||||
BtdrvGattCharacteristicUuidType_CurrentGroupObjectId = 0x2BA0, ///< Current Group Object ID
|
||||
BtdrvGattCharacteristicUuidType_PlayingOrder = 0x2BA1, ///< Playing Order
|
||||
BtdrvGattCharacteristicUuidType_PlayingOrdersSupported = 0x2BA2, ///< Playing Orders Supported
|
||||
BtdrvGattCharacteristicUuidType_MediaState = 0x2BA3, ///< Media State
|
||||
BtdrvGattCharacteristicUuidType_MediaControlPoint = 0x2BA4, ///< Media Control Point
|
||||
BtdrvGattCharacteristicUuidType_MediaControlPointOpcodesSupported = 0x2BA5, ///< Media Control Point Opcodes Supported
|
||||
BtdrvGattCharacteristicUuidType_SearchResultsObjectId = 0x2BA6, ///< Search Results Object ID
|
||||
BtdrvGattCharacteristicUuidType_SearchControlPoint = 0x2BA7, ///< Search Control Point
|
||||
BtdrvGattCharacteristicUuidType_Energy32 = 0x2BA8, ///< Energy 32
|
||||
BtdrvGattCharacteristicUuidType_MediaPlayerIconObjectType = 0x2BA9, ///< Media Player Icon Object Type
|
||||
BtdrvGattCharacteristicUuidType_TrackSegmentsObjectType = 0x2BAA, ///< Track Segments Object Type
|
||||
BtdrvGattCharacteristicUuidType_TrackObjectType = 0x2BAB, ///< Track Object Type
|
||||
BtdrvGattCharacteristicUuidType_GroupObjectType = 0x2BAC, ///< Group Object Type
|
||||
BtdrvGattCharacteristicUuidType_ConstantToneExtensionEnable = 0x2BAD, ///< Constant Tone Extension Enable
|
||||
BtdrvGattCharacteristicUuidType_AdvertisingConstantToneExtensionMinimumLength = 0x2BAE, ///< Advertising Constant Tone Extension Minimum Length
|
||||
BtdrvGattCharacteristicUuidType_AdvertisingConstantToneExtensionMinimumTransmitCount = 0x2BAF, ///< Advertising Constant Tone Extension Minimum Transmit Count
|
||||
BtdrvGattCharacteristicUuidType_AdvertisingConstantToneExtensionTransmitDuration = 0x2BB0, ///< Advertising Constant Tone Extension Transmit Duration
|
||||
BtdrvGattCharacteristicUuidType_AdvertisingConstantToneExtensionInterval = 0x2BB1, ///< Advertising Constant Tone Extension Interval
|
||||
BtdrvGattCharacteristicUuidType_AdvertisingConstantToneExtensionPhy = 0x2BB2, ///< Advertising Constant Tone Extension PHY
|
||||
BtdrvGattCharacteristicUuidType_BearerProviderName = 0x2BB3, ///< Bearer Provider Name
|
||||
BtdrvGattCharacteristicUuidType_BearerUci = 0x2BB4, ///< Bearer UCI
|
||||
BtdrvGattCharacteristicUuidType_BearerTechnology = 0x2BB5, ///< Bearer Technology
|
||||
BtdrvGattCharacteristicUuidType_BearerUriSchemesSupportedList = 0x2BB6, ///< Bearer URI Schemes Supported List
|
||||
BtdrvGattCharacteristicUuidType_BearerSignalStrength = 0x2BB7, ///< Bearer Signal Strength
|
||||
BtdrvGattCharacteristicUuidType_BearerSignalStrengthReportingInterval = 0x2BB8, ///< Bearer Signal Strength Reporting Interval
|
||||
BtdrvGattCharacteristicUuidType_BearerListCurrentCalls = 0x2BB9, ///< Bearer List Current Calls
|
||||
BtdrvGattCharacteristicUuidType_ContentControlId = 0x2BBA, ///< Content Control ID
|
||||
BtdrvGattCharacteristicUuidType_StatusFlags = 0x2BBB, ///< Status Flags
|
||||
BtdrvGattCharacteristicUuidType_IncomingCallTargetBearerUri = 0x2BBC, ///< Incoming Call Target Bearer URI
|
||||
BtdrvGattCharacteristicUuidType_CallState = 0x2BBD, ///< Call State
|
||||
BtdrvGattCharacteristicUuidType_CallControlPoint = 0x2BBE, ///< Call Control Point
|
||||
BtdrvGattCharacteristicUuidType_CallControlPointOptionalOpcodes = 0x2BBF, ///< Call Control Point Optional Opcodes
|
||||
BtdrvGattCharacteristicUuidType_TerminationReason = 0x2BC0, ///< Termination Reason
|
||||
BtdrvGattCharacteristicUuidType_IncomingCall = 0x2BC1, ///< Incoming Call
|
||||
BtdrvGattCharacteristicUuidType_CallFriendlyName = 0x2BC2, ///< Call Friendly Name
|
||||
BtdrvGattCharacteristicUuidType_Mute = 0x2BC3, ///< Mute
|
||||
BtdrvGattCharacteristicUuidType_SinkAse = 0x2BC4, ///< Sink ASE
|
||||
BtdrvGattCharacteristicUuidType_SourceAse = 0x2BC5, ///< Source ASE
|
||||
BtdrvGattCharacteristicUuidType_AseControlPoint = 0x2BC6, ///< ASE Control Point
|
||||
BtdrvGattCharacteristicUuidType_BroadcastAudioScanControlPoint = 0x2BC7, ///< Broadcast Audio Scan Control Point
|
||||
BtdrvGattCharacteristicUuidType_BroadcastReceiveState = 0x2BC8, ///< Broadcast Receive State
|
||||
BtdrvGattCharacteristicUuidType_SinkPac = 0x2BC9, ///< Sink PAC
|
||||
BtdrvGattCharacteristicUuidType_SinkAudioLocations = 0x2BCA, ///< Sink Audio Locations
|
||||
BtdrvGattCharacteristicUuidType_SourcePac = 0x2BCB, ///< Source PAC
|
||||
BtdrvGattCharacteristicUuidType_SourceAudioLocations = 0x2BCC, ///< Source Audio Locations
|
||||
BtdrvGattCharacteristicUuidType_AvailableAudioContexts = 0x2BCD, ///< Available Audio Contexts
|
||||
BtdrvGattCharacteristicUuidType_SupportedAudioContexts = 0x2BCE, ///< Supported Audio Contexts
|
||||
BtdrvGattCharacteristicUuidType_AmmoniaConcentration = 0x2BCF, ///< Ammonia Concentration
|
||||
BtdrvGattCharacteristicUuidType_CarbonMonoxideConcentration = 0x2BD0, ///< Carbon Monoxide Concentration
|
||||
BtdrvGattCharacteristicUuidType_MethaneConcentration = 0x2BD1, ///< Methane Concentration
|
||||
BtdrvGattCharacteristicUuidType_NitrogenDioxideConcentration = 0x2BD2, ///< Nitrogen Dioxide Concentration
|
||||
BtdrvGattCharacteristicUuidType_NonMethaneVolatileOrganicCompoundsConcentration = 0x2BD3, ///< Non-Methane Volatile Organic Compounds Concentration
|
||||
BtdrvGattCharacteristicUuidType_OzoneConcentration = 0x2BD4, ///< Ozone Concentration
|
||||
BtdrvGattCharacteristicUuidType_ParticulateMatterPm1Concentration = 0x2BD5, ///< Particulate Matter - PM1 Concentration
|
||||
BtdrvGattCharacteristicUuidType_ParticulateMatterPm25Concentration = 0x2BD6, ///< Particulate Matter - PM2.5 Concentration
|
||||
BtdrvGattCharacteristicUuidType_ParticulateMatterPm10Concentration = 0x2BD7, ///< Particulate Matter - PM10 Concentration
|
||||
BtdrvGattCharacteristicUuidType_SulfurDioxideConcentration = 0x2BD8, ///< Sulfur Dioxide Concentration
|
||||
BtdrvGattCharacteristicUuidType_SulfurHexafluorideConcentration = 0x2BD9, ///< Sulfur Hexafluoride Concentration
|
||||
BtdrvGattCharacteristicUuidType_HearingAidFeatures = 0x2BDA, ///< Hearing Aid Features
|
||||
BtdrvGattCharacteristicUuidType_HearingAidPresetControlPoint = 0x2BDB, ///< Hearing Aid Preset Control Point
|
||||
BtdrvGattCharacteristicUuidType_ActivePresetIndex = 0x2BDC, ///< Active Preset Index
|
||||
BtdrvGattCharacteristicUuidType_StoredHealthObservations = 0x2BDD, ///< Stored Health Observations
|
||||
BtdrvGattCharacteristicUuidType_FixedString64 = 0x2BDE, ///< Fixed String 64
|
||||
BtdrvGattCharacteristicUuidType_HighTemperature = 0x2BDF, ///< High Temperature
|
||||
BtdrvGattCharacteristicUuidType_HighVoltage = 0x2BE0, ///< High Voltage
|
||||
BtdrvGattCharacteristicUuidType_LightDistribution = 0x2BE1, ///< Light Distribution
|
||||
BtdrvGattCharacteristicUuidType_LightOutput = 0x2BE2, ///< Light Output
|
||||
BtdrvGattCharacteristicUuidType_LightSourceType = 0x2BE3, ///< Light Source Type
|
||||
BtdrvGattCharacteristicUuidType_Noise = 0x2BE4, ///< Noise
|
||||
BtdrvGattCharacteristicUuidType_RelativeRuntimeInACorrelatedColorTemperatureRange = 0x2BE5, ///< Relative Runtime in a Correlated Color Temperature Range
|
||||
BtdrvGattCharacteristicUuidType_TimeSecond32 = 0x2BE6, ///< Time Second 32
|
||||
BtdrvGattCharacteristicUuidType_VocConcentration = 0x2BE7, ///< VOC Concentration
|
||||
BtdrvGattCharacteristicUuidType_VoltageFrequency = 0x2BE8, ///< Voltage Frequency
|
||||
BtdrvGattCharacteristicUuidType_BatteryCriticalStatus = 0x2BE9, ///< Battery Critical Status
|
||||
BtdrvGattCharacteristicUuidType_BatteryHealthStatus = 0x2BEA, ///< Battery Health Status
|
||||
BtdrvGattCharacteristicUuidType_BatteryHealthInformation = 0x2BEB, ///< Battery Health Information
|
||||
BtdrvGattCharacteristicUuidType_BatteryInformation = 0x2BEC, ///< Battery Information
|
||||
BtdrvGattCharacteristicUuidType_BatteryLevelStatus = 0x2BED, ///< Battery Level Status
|
||||
BtdrvGattCharacteristicUuidType_BatteryTimeStatus = 0x2BEE, ///< Battery Time Status
|
||||
BtdrvGattCharacteristicUuidType_EstimatedServiceDate = 0x2BEF, ///< Estimated Service Date
|
||||
BtdrvGattCharacteristicUuidType_BatteryEnergyStatus = 0x2BF0, ///< Battery Energy Status
|
||||
BtdrvGattCharacteristicUuidType_ObservationScheduleChanged = 0x2BF1, ///< Observation Schedule Changed
|
||||
BtdrvGattCharacteristicUuidType_CurrentElapsedTime = 0x2BF2, ///< Current Elapsed Time
|
||||
BtdrvGattCharacteristicUuidType_HealthSensorFeatures = 0x2BF3, ///< Health Sensor Features
|
||||
BtdrvGattCharacteristicUuidType_GhsControlPoint = 0x2BF4, ///< GHS Control Point
|
||||
BtdrvGattCharacteristicUuidType_LeGattSecurityLevels = 0x2BF5, ///< LE GATT Security Levels
|
||||
BtdrvGattCharacteristicUuidType_EslAddress = 0x2BF6, ///< ESL Address
|
||||
BtdrvGattCharacteristicUuidType_ApSyncKeyMaterial = 0x2BF7, ///< AP Sync Key Material
|
||||
BtdrvGattCharacteristicUuidType_EslResponseKeyMaterial = 0x2BF8, ///< ESL Response Key Material
|
||||
BtdrvGattCharacteristicUuidType_EslCurrentAbsoluteTime = 0x2BF9, ///< ESL Current Absolute Time
|
||||
BtdrvGattCharacteristicUuidType_EslDisplayInformation = 0x2BFA, ///< ESL Display Information
|
||||
BtdrvGattCharacteristicUuidType_EslImageInformation = 0x2BFB, ///< ESL Image Information
|
||||
BtdrvGattCharacteristicUuidType_EslSensorInformation = 0x2BFC, ///< ESL Sensor Information
|
||||
BtdrvGattCharacteristicUuidType_EslLedInformation = 0x2BFD, ///< ESL LED Information
|
||||
BtdrvGattCharacteristicUuidType_EslControlPoint = 0x2BFE, ///< ESL Control Point
|
||||
BtdrvGattCharacteristicUuidType_UdiForMedicalDevices = 0x2BFF, ///< UDI for Medical Devices
|
||||
} BtdrvGattCharacteristicUuidType;
|
||||
|
||||
/// GattDescriptorUuidType
|
||||
typedef enum {
|
||||
BtdrvGattDescriptorUuidType_CharacteristicExtendedProperties = 0x2900, ///< Characteristic Extended Properties
|
||||
BtdrvGattDescriptorUuidType_CharacteristicUserDescription = 0x2901, ///< Characteristic User Description
|
||||
BtdrvGattDescriptorUuidType_ClientCharacteristicConfiguration = 0x2902, ///< Client Characteristic Configuration
|
||||
BtdrvGattDescriptorUuidType_ServerCharacteristicConfiguration = 0x2903, ///< Server Characteristic Configuration
|
||||
BtdrvGattDescriptorUuidType_CharacteristicPresentationFormat = 0x2904, ///< Characteristic Presentation Format
|
||||
BtdrvGattDescriptorUuidType_CharacteristicAggregateFormat = 0x2905, ///< Characteristic Aggregate Format
|
||||
BtdrvGattDescriptorUuidType_ValidRange = 0x2906, ///< Valid Range
|
||||
BtdrvGattDescriptorUuidType_ExternalReportReference = 0x2907, ///< External Report Reference
|
||||
BtdrvGattDescriptorUuidType_ReportReference = 0x2908, ///< Report Reference
|
||||
BtdrvGattDescriptorUuidType_NumberOfDigitals = 0x2909, ///< Number of Digitals
|
||||
BtdrvGattDescriptorUuidType_ValueTriggerSetting = 0x290A, ///< Value Trigger Setting
|
||||
BtdrvGattDescriptorUuidType_EnvironmentalSensingConfiguration = 0x290B, ///< Environmental Sensing Configuration
|
||||
BtdrvGattDescriptorUuidType_EnvironmentalSensingMeasurement = 0x290C, ///< Environmental Sensing Measurement
|
||||
BtdrvGattDescriptorUuidType_EnvironmentalSensingTriggerSetting = 0x290D, ///< Environmental Sensing Trigger Setting
|
||||
BtdrvGattDescriptorUuidType_TimeTriggerSetting = 0x290E, ///< Time Trigger Setting
|
||||
BtdrvGattDescriptorUuidType_CompleteBrEdrTransportBlockData = 0x290F, ///< Complete BR-EDR Transport Block Data
|
||||
BtdrvGattDescriptorUuidType_ObservationSchedule = 0x2910, ///< Observation Schedule
|
||||
BtdrvGattDescriptorUuidType_ValidRangeAndAccuracy = 0x2911, ///< Valid Range and Accuracy
|
||||
} BtdrvGattDescriptorUuidType;
|
@ -1,455 +0,0 @@
|
||||
/**
|
||||
* @file btdrv_types.h
|
||||
* @brief Bluetooth driver (btdrv) service types (see btdrv.h for the rest).
|
||||
* @author yellows8, ndeadly
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "btdrv_ids.h"
|
||||
|
||||
/// BluetoothPropertyType [1.0.0-11.0.1]
|
||||
typedef enum {
|
||||
BtdrvBluetoothPropertyType_Name = 1, ///< Name. String, max length 0xF8 excluding NUL-terminator.
|
||||
BtdrvBluetoothPropertyType_Address = 2, ///< \ref BtdrvAddress
|
||||
BtdrvBluetoothPropertyType_Unknown3 = 3, ///< Only available with \ref btdrvSetAdapterProperty. Unknown, \ref BtdrvAddress.
|
||||
BtdrvBluetoothPropertyType_ClassOfDevice = 5, ///< 3-bytes, Class of Device.
|
||||
BtdrvBluetoothPropertyType_FeatureSet = 6, ///< 1-byte, FeatureSet. The default is value 0x68.
|
||||
} BtdrvBluetoothPropertyType;
|
||||
|
||||
/// AdapterPropertyType [12.0.0+]
|
||||
typedef enum {
|
||||
BtdrvAdapterPropertyType_Address = 0, ///< \ref BtdrvAddress
|
||||
BtdrvAdapterPropertyType_Name = 1, ///< Name. String, max length 0xF8 excluding NUL-terminator.
|
||||
BtdrvAdapterPropertyType_ClassOfDevice = 2, ///< 3-bytes, Class of Device.
|
||||
BtdrvAdapterPropertyType_Unknown3 = 3, ///< Only available with \ref btdrvSetAdapterProperty. Unknown, \ref BtdrvAddress.
|
||||
} BtdrvAdapterPropertyType;
|
||||
|
||||
/// EventType
|
||||
typedef enum {
|
||||
///< BtdrvEventType_* should be used on [12.0.0+]
|
||||
BtdrvEventType_InquiryDevice = 0, ///< Device found during Inquiry.
|
||||
BtdrvEventType_InquiryStatus = 1, ///< Inquiry status changed.
|
||||
BtdrvEventType_PairingPinCodeRequest = 2, ///< Pairing PIN code request.
|
||||
BtdrvEventType_SspRequest = 3, ///< SSP confirm request / SSP passkey notification.
|
||||
BtdrvEventType_Connection = 4, ///< Connection
|
||||
BtdrvEventType_Tsi = 5, ///< SetTsi (\ref btdrvSetTsi)
|
||||
BtdrvEventType_BurstMode = 6, ///< SetBurstMode (\ref btdrvEnableBurstMode)
|
||||
BtdrvEventType_SetZeroRetransmission = 7, ///< \ref btdrvSetZeroRetransmission
|
||||
BtdrvEventType_PendingConnections = 8, ///< \ref btdrvGetPendingConnections
|
||||
BtdrvEventType_MoveToSecondaryPiconet = 9, ///< \ref btdrvMoveToSecondaryPiconet
|
||||
BtdrvEventType_BluetoothCrash = 10, ///< BluetoothCrash
|
||||
|
||||
///< BtdrvEventTypeOld_* should be used on [1.0.0-11.0.1]
|
||||
BtdrvEventTypeOld_Unknown0 = 0, ///< Unused
|
||||
BtdrvEventTypeOld_InquiryDevice = 3, ///< Device found during Inquiry.
|
||||
BtdrvEventTypeOld_InquiryStatus = 4, ///< Inquiry status changed.
|
||||
BtdrvEventTypeOld_PairingPinCodeRequest = 5, ///< Pairing PIN code request.
|
||||
BtdrvEventTypeOld_SspRequest = 6, ///< SSP confirm request / SSP passkey notification.
|
||||
BtdrvEventTypeOld_Connection = 7, ///< Connection
|
||||
BtdrvEventTypeOld_BluetoothCrash = 13, ///< BluetoothCrash
|
||||
} BtdrvEventType;
|
||||
|
||||
/// BtdrvInquiryStatus
|
||||
typedef enum {
|
||||
BtdrvInquiryStatus_Stopped = 0, ///< Inquiry stopped.
|
||||
BtdrvInquiryStatus_Started = 1, ///< Inquiry started.
|
||||
} BtdrvInquiryStatus;
|
||||
|
||||
/// ConnectionEventType
|
||||
typedef enum {
|
||||
BtdrvConnectionEventType_Status = 0, ///< BtdrvEventInfo::connection::status
|
||||
BtdrvConnectionEventType_SspConfirmRequest = 1, ///< SSP confirm request.
|
||||
BtdrvConnectionEventType_Suspended = 2, ///< ACL Link is now Suspended.
|
||||
} BtdrvConnectionEventType;
|
||||
|
||||
/// ExtEventType [1.0.0-11.0.1]
|
||||
typedef enum {
|
||||
BtdrvExtEventType_SetTsi = 0, ///< SetTsi (\ref btdrvSetTsi)
|
||||
BtdrvExtEventType_ExitTsi = 1, ///< ExitTsi (\ref btdrvSetTsi)
|
||||
BtdrvExtEventType_SetBurstMode = 2, ///< SetBurstMode (\ref btdrvEnableBurstMode)
|
||||
BtdrvExtEventType_ExitBurstMode = 3, ///< ExitBurstMode (\ref btdrvEnableBurstMode)
|
||||
BtdrvExtEventType_SetZeroRetransmission = 4, ///< \ref btdrvSetZeroRetransmission
|
||||
BtdrvExtEventType_PendingConnections = 5, ///< \ref btdrvGetPendingConnections
|
||||
BtdrvExtEventType_MoveToSecondaryPiconet = 6, ///< \ref btdrvMoveToSecondaryPiconet
|
||||
} BtdrvExtEventType;
|
||||
|
||||
/// BluetoothHhReportType
|
||||
/// Bit0-1 directly control the HID bluetooth transaction report-type value.
|
||||
/// Bit2-3: these directly control the Parameter Reserved field for SetReport, for GetReport these control the Parameter Reserved and Size bits.
|
||||
typedef enum {
|
||||
BtdrvBluetoothHhReportType_Other = 0, ///< Other
|
||||
BtdrvBluetoothHhReportType_Input = 1, ///< Input
|
||||
BtdrvBluetoothHhReportType_Output = 2, ///< Output
|
||||
BtdrvBluetoothHhReportType_Feature = 3, ///< Feature
|
||||
} BtdrvBluetoothHhReportType;
|
||||
|
||||
/// HidEventType
|
||||
typedef enum {
|
||||
///< BtdrvHidEventType_* should be used on [12.0.0+]
|
||||
BtdrvHidEventType_Connection = 0, ///< Connection. Only used with \ref btdrvGetHidEventInfo.
|
||||
BtdrvHidEventType_Data = 1, ///< DATA report on the Interrupt channel.
|
||||
BtdrvHidEventType_SetReport = 2, ///< Response to SET_REPORT.
|
||||
BtdrvHidEventType_GetReport = 3, ///< Response to GET_REPORT.
|
||||
|
||||
///< BtdrvHidEventTypeOld_* should be used on [1.0.0-11.0.1]
|
||||
BtdrvHidEventTypeOld_Connection = 0, ///< Connection. Only used with \ref btdrvGetHidEventInfo.
|
||||
BtdrvHidEventTypeOld_Data = 4, ///< DATA report on the Interrupt channel.
|
||||
BtdrvHidEventTypeOld_Ext = 7, ///< Response for extensions. Only used with \ref btdrvGetHidEventInfo.
|
||||
BtdrvHidEventTypeOld_SetReport = 8, ///< Response to SET_REPORT.
|
||||
BtdrvHidEventTypeOld_GetReport = 9, ///< Response to GET_REPORT.
|
||||
} BtdrvHidEventType;
|
||||
|
||||
/// HidConnectionStatus [12.0.0+]
|
||||
typedef enum {
|
||||
///< BtdrvHidConnectionStatus_* should be used on [12.0.0+]
|
||||
BtdrvHidConnectionStatus_Closed = 0,
|
||||
BtdrvHidConnectionStatus_Opened = 1,
|
||||
BtdrvHidConnectionStatus_Failed = 2,
|
||||
|
||||
///< BtdrvHidConnectionStatusOld_* should be used on [1.0.0-11.0.1]
|
||||
BtdrvHidConnectionStatusOld_Opened = 0,
|
||||
BtdrvHidConnectionStatusOld_Closed = 2,
|
||||
BtdrvHidConnectionStatusOld_Failed = 8,
|
||||
} BtdrvHidConnectionStatus;
|
||||
|
||||
/// This determines the u16 data to write into a CircularBuffer.
|
||||
typedef enum {
|
||||
BtdrvFatalReason_Invalid = 0, ///< Only for \ref BtdrvEventInfo: invalid.
|
||||
BtdrvFatalReason_Unknown1 = 1, ///< Can only be triggered by \ref btdrvEmulateBluetoothCrash, not triggered by the sysmodule otherwise.
|
||||
BtdrvFatalReason_CommandTimeout = 2, ///< HCI command timeout.
|
||||
BtdrvFatalReason_HardwareError = 3, ///< HCI event HCI_Hardware_Error occurred.
|
||||
BtdrvFatalReason_Enable = 7, ///< Only for \ref BtdrvEventInfo: triggered after enabling bluetooth, depending on the value of a global state field.
|
||||
BtdrvFatalReason_Audio = 9, ///< [12.0.0+] Only for \ref BtdrvEventInfo: triggered by Audio cmds in some cases.
|
||||
} BtdrvFatalReason;
|
||||
|
||||
/// BleEventType
|
||||
typedef enum {
|
||||
BtdrvBleEventType_ClientRegistration = 0, ///< GATT client registration.
|
||||
BtdrvBleEventType_ServerRegistration = 1, ///< GATT server registration.
|
||||
BtdrvBleEventType_ConnectionUpdate = 2, ///< Connection update.
|
||||
BtdrvBleEventType_PreferredConnectionParameters = 3, ///< Preferred connection parameters.
|
||||
BtdrvBleEventType_ClientConnection = 4, ///< GATT client connection.
|
||||
BtdrvBleEventType_ServerConnection = 5, ///< GATT server connection.
|
||||
BtdrvBleEventType_ScanResult = 6, ///< Scan result.
|
||||
BtdrvBleEventType_ScanFilter = 7, ///< Scan filter status.
|
||||
BtdrvBleEventType_ClientNotify = 8, ///< GATT client notify.
|
||||
BtdrvBleEventType_ClientCacheSave = 9, ///< GATT client cache save.
|
||||
BtdrvBleEventType_ClientCacheLoad = 10, ///< GATT client cache load.
|
||||
BtdrvBleEventType_ClientConfigureMtu = 11, ///< GATT client configure MTU.
|
||||
BtdrvBleEventType_ServerAddAttribute = 12, ///< GATT server add attribute.
|
||||
BtdrvBleEventType_ServerAttributeOperation = 13, ///< GATT server attribute operation.
|
||||
} BtdrvBleEventType;
|
||||
|
||||
/// GattAttributeType
|
||||
typedef enum {
|
||||
BtdrvGattAttributeType_IncludedService = 0, ///< Included service
|
||||
BtdrvGattAttributeType_Characteristic = 1, ///< Characteristic
|
||||
BtdrvGattAttributeType_Descriptor = 2, ///< Descriptor
|
||||
BtdrvGattAttributeType_Service = 3, ///< Service
|
||||
} BtdrvGattAttributeType;
|
||||
|
||||
/// GattAttributePermission
|
||||
typedef enum {
|
||||
BtdrvGattAttributePermission_Read = BIT(0),
|
||||
BtdrvGattAttributePermission_ReadEncrypted = BIT(1),
|
||||
BtdrvGattAttributePermission_ReadEncryptedMitm = BIT(2),
|
||||
BtdrvGattAttributePermission_Write = BIT(4),
|
||||
BtdrvGattAttributePermission_WriteEncrypted = BIT(5),
|
||||
BtdrvGattAttributePermission_WriteEncryptedMitm = BIT(6),
|
||||
BtdrvGattAttributePermission_WriteSigned = BIT(7),
|
||||
BtdrvGattAttributePermission_WriteSignedMitm = BIT(8),
|
||||
|
||||
BtdrvGattAttributePermission_ReadAllowed = BtdrvGattAttributePermission_Read | BtdrvGattAttributePermission_ReadEncrypted | BtdrvGattAttributePermission_ReadEncryptedMitm,
|
||||
BtdrvGattAttributePermission_ReadAuthRequired = BtdrvGattAttributePermission_ReadEncrypted,
|
||||
BtdrvGattAttributePermission_ReadMitmRequired = BtdrvGattAttributePermission_ReadEncryptedMitm,
|
||||
BtdrvGattAttributePermission_ReadEncryptedRequired = BtdrvGattAttributePermission_ReadEncrypted | BtdrvGattAttributePermission_ReadEncryptedMitm,
|
||||
|
||||
BtdrvGattAttributePermission_WriteAllowed = BtdrvGattAttributePermission_Write | BtdrvGattAttributePermission_WriteEncrypted | BtdrvGattAttributePermission_WriteEncryptedMitm | BtdrvGattAttributePermission_WriteSigned | BtdrvGattAttributePermission_WriteSignedMitm,
|
||||
BtdrvGattAttributePermission_WriteAuthRequired = BtdrvGattAttributePermission_WriteEncrypted | BtdrvGattAttributePermission_WriteSigned,
|
||||
BtdrvGattAttributePermission_WriteMitmRequired = BtdrvGattAttributePermission_WriteEncryptedMitm | BtdrvGattAttributePermission_WriteSignedMitm,
|
||||
BtdrvGattAttributePermission_WriteEncryptedRequired = BtdrvGattAttributePermission_WriteEncrypted | BtdrvGattAttributePermission_WriteEncryptedMitm,
|
||||
BtdrvGattAttributePermission_WriteSignedRequired = BtdrvGattAttributePermission_WriteSigned | BtdrvGattAttributePermission_WriteSignedMitm,
|
||||
} BtdrvGattAttributePermission;
|
||||
|
||||
/// GattCharacteristicProperty
|
||||
typedef enum {
|
||||
BtdrvGattCharacteristicProperty_Broadcast = BIT(0),
|
||||
BtdrvGattCharacteristicProperty_Read = BIT(1),
|
||||
BtdrvGattCharacteristicProperty_WriteNoResponse = BIT(2),
|
||||
BtdrvGattCharacteristicProperty_Write = BIT(3),
|
||||
BtdrvGattCharacteristicProperty_Notify = BIT(4),
|
||||
BtdrvGattCharacteristicProperty_Indicate = BIT(5),
|
||||
BtdrvGattCharacteristicProperty_Authentication = BIT(6),
|
||||
BtdrvGattCharacteristicProperty_ExtendedProperties = BIT(7),
|
||||
} BtdrvGattCharacteristicProperty;
|
||||
|
||||
/// GattAuthReqType
|
||||
typedef enum {
|
||||
BtdrvGattAuthReqType_None = 0,
|
||||
BtdrvGattAuthReqType_NoMitm = 1,
|
||||
BtdrvGattAuthReqType_Mitm = 2,
|
||||
BtdrvGattAuthReqType_SignedNoMitm = 3,
|
||||
BtdrvGattAuthReqType_SignedMitm = 4,
|
||||
} BtdrvGattAuthReqType;
|
||||
|
||||
/// BtdrvBleAdBit
|
||||
typedef enum {
|
||||
BtdrvBleAdBit_DeviceName = BIT(0),
|
||||
BtdrvBleAdBit_Flags = BIT(1),
|
||||
BtdrvBleAdBit_Manufacturer = BIT(2),
|
||||
BtdrvBleAdBit_TxPower = BIT(3),
|
||||
BtdrvBleAdBit_Service32 = BIT(4),
|
||||
BtdrvBleAdBit_IntRange = BIT(5),
|
||||
BtdrvBleAdBit_Service = BIT(6),
|
||||
BtdrvBleAdBit_ServiceSol = BIT(7),
|
||||
BtdrvBleAdBit_ServiceData = BIT(8),
|
||||
BtdrvBleAdBit_SignData = BIT(9),
|
||||
BtdrvBleAdBit_Service128Sol = BIT(10),
|
||||
BtdrvBleAdBit_Appearance = BIT(11),
|
||||
BtdrvBleAdBit_PublicAddress = BIT(12),
|
||||
BtdrvBleAdBit_RandomAddress = BIT(13),
|
||||
BtdrvBleAdBit_Service32Sol = BIT(14),
|
||||
BtdrvBleAdBit_Proprietary = BIT(15),
|
||||
BtdrvBleAdBit_Service128 = BIT(16),
|
||||
} BtdrvBleAdBit;
|
||||
|
||||
/// BtdrvBleAdFlag
|
||||
typedef enum {
|
||||
BtdrvBleAdFlag_None = 0,
|
||||
BtdrvBleAdFlag_LimitedDiscovery = BIT(0),
|
||||
BtdrvBleAdFlag_GeneralDiscovery = BIT(1),
|
||||
BtdrvBleAdFlag_BrEdrNotSupported = BIT(2),
|
||||
BtdrvBleAdFlag_DualModeControllerSupport = BIT(3),
|
||||
BtdrvBleAdFlag_DualModeHostSupport = BIT(4),
|
||||
} BtdrvBleAdFlag;
|
||||
|
||||
/// AudioEventType
|
||||
typedef enum {
|
||||
BtdrvAudioEventType_None = 0, ///< None
|
||||
BtdrvAudioEventType_Connection = 1, ///< Connection
|
||||
} BtdrvAudioEventType;
|
||||
|
||||
/// AudioOutState
|
||||
typedef enum {
|
||||
BtdrvAudioOutState_Stopped = 0, ///< Stopped
|
||||
BtdrvAudioOutState_Started = 1, ///< Started
|
||||
} BtdrvAudioOutState;
|
||||
|
||||
/// AudioCodec
|
||||
typedef enum {
|
||||
BtdrvAudioCodec_Pcm = 0, ///< Raw PCM
|
||||
} BtdrvAudioCodec;
|
||||
|
||||
/// Address
|
||||
typedef struct {
|
||||
u8 address[0x6]; ///< Address
|
||||
} BtdrvAddress;
|
||||
|
||||
/// ClassOfDevice
|
||||
typedef struct {
|
||||
u8 class_of_device[0x3]; ///< ClassOfDevice
|
||||
} BtdrvClassOfDevice;
|
||||
|
||||
/// AdapterProperty [1.0.0-11.0.1]
|
||||
typedef struct {
|
||||
BtdrvAddress addr; ///< Same as the data for ::BtdrvBluetoothPropertyType_Address.
|
||||
BtdrvClassOfDevice class_of_device; ///< Same as the data for ::BtdrvBluetoothPropertyType_ClassOfDevice.
|
||||
char name[0xF9]; ///< Same as the data for ::BtdrvBluetoothPropertyType_Name (last byte is not initialized).
|
||||
u8 feature_set; ///< Set to hard-coded value 0x68 (same as the data for ::BtdrvBluetoothPropertyType_FeatureSet).
|
||||
} BtdrvAdapterPropertyOld;
|
||||
|
||||
/// AdapterProperty [12.0.0+]
|
||||
typedef struct {
|
||||
u8 type; ///< \ref BtdrvAdapterPropertyType
|
||||
u8 size; ///< Data size.
|
||||
u8 data[0x100]; ///< Data (above size), as specified by the type.
|
||||
} BtdrvAdapterProperty;
|
||||
|
||||
/// AdapterPropertySet [12.0.0+]
|
||||
typedef struct {
|
||||
BtdrvAddress addr; ///< Same as the data for ::BtdrvBluetoothPropertyType_Address.
|
||||
BtdrvClassOfDevice class_of_device; ///< Same as the data for ::BtdrvBluetoothPropertyType_ClassOfDevice.
|
||||
char name[0xF9]; ///< Same as the data for ::BtdrvBluetoothPropertyType_Name.
|
||||
} BtdrvAdapterPropertySet;
|
||||
|
||||
/// BluetoothPinCode [1.0.0-11.0.1]
|
||||
typedef struct {
|
||||
char code[0x10]; ///< PinCode
|
||||
} BtdrvBluetoothPinCode;
|
||||
|
||||
/// BtdrvPinCode [12.0.0+]
|
||||
typedef struct {
|
||||
char code[0x10]; ///< PinCode
|
||||
u8 length; ///< Length
|
||||
} BtdrvPinCode;
|
||||
|
||||
/// HidData [1.0.0-8.1.1]
|
||||
typedef struct {
|
||||
u16 size; ///< Size of data.
|
||||
u8 data[0x280]; ///< Data
|
||||
} BtdrvHidData;
|
||||
|
||||
/// HidReport [9.0.0+].
|
||||
typedef struct {
|
||||
u16 size; ///< Size of data.
|
||||
u8 data[0x2BC]; ///< Data
|
||||
} BtdrvHidReport;
|
||||
|
||||
/// PlrStatistics
|
||||
typedef struct {
|
||||
u8 unk_x0[0x84]; ///< Unknown
|
||||
} BtdrvPlrStatistics;
|
||||
|
||||
/// PlrList
|
||||
typedef struct {
|
||||
u8 unk_x0[0xA4]; ///< Unknown
|
||||
} BtdrvPlrList;
|
||||
|
||||
/// ChannelMapList
|
||||
typedef struct {
|
||||
u8 unk_x0[0x88]; ///< Unknown
|
||||
} BtdrvChannelMapList;
|
||||
|
||||
/// GattAttributeUuid
|
||||
typedef struct {
|
||||
u32 size; ///< UUID size, must be 0x2, 0x4, or 0x10.
|
||||
u8 uuid[0x10]; ///< UUID with the above size.
|
||||
} BtdrvGattAttributeUuid;
|
||||
|
||||
/// GattId
|
||||
typedef struct {
|
||||
u8 instance_id; ///< InstanceId
|
||||
u8 pad[3]; ///< Padding
|
||||
BtdrvGattAttributeUuid uuid; ///< \ref BtdrvGattAttributeUuid
|
||||
} BtdrvGattId;
|
||||
|
||||
/// GattAttribute
|
||||
typedef struct {
|
||||
BtdrvGattId id; ///< \ref BtdrvGattId
|
||||
u16 type; ///< \ref BtdrvGattAttributeType
|
||||
u16 handle;
|
||||
u16 group_end_handle;
|
||||
u8 property; ///< Only used when type is characteristic. \ref BtdrvGattCharacteristicProperty
|
||||
bool is_primary; ///< Only used when type is service
|
||||
} BtdrvGattAttribute;
|
||||
|
||||
/// LeConnectionParams [5.0.0-8.1.1]
|
||||
typedef struct {
|
||||
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||
u16 min_conn_interval; ///< Minimum connection interval
|
||||
u16 max_conn_interval; ///< Maximum connection interval
|
||||
u16 scan_interval; ///< Scan interval
|
||||
u16 scan_window; ///< Scan window
|
||||
u16 slave_latency; ///< Slave latency
|
||||
u16 supervision_tout; ///< Connection supervision timeout multiplier
|
||||
u8 preference; ///< Unused
|
||||
u8 pad; ///< Padding
|
||||
} BtdrvLeConnectionParams;
|
||||
|
||||
/// BleConnectionParameter [9.0.0+]
|
||||
typedef struct {
|
||||
u16 min_conn_interval; ///< Minimum connection interval
|
||||
u16 max_conn_interval; ///< Maximum connection interval
|
||||
u16 scan_interval; ///< Scan interval
|
||||
u16 scan_window; ///< Scan window
|
||||
u16 slave_latency; ///< Slave latency
|
||||
u16 supervision_tout; ///< Connection supervision timeout multiplier
|
||||
} BtdrvBleConnectionParameter;
|
||||
|
||||
/// BtdrvBleAdvertisePacketData
|
||||
typedef struct {
|
||||
u32 adv_data_mask; ///< Bitmask of following AD data to be included in advertising packets \ref BtdrvBleAdBit
|
||||
u8 flag; ///< AD flag value to be advertised \ref BtdrvBleAdFlag. Included with BtdrvBleAdBit_Flags
|
||||
u8 manu_data_len; ///< Size of manu_data below
|
||||
u8 manu_data[0x1F]; ///< Manufacturer-specific data to be advertised. Included with BtdrvBleAdBit_Manufacturer
|
||||
u8 pad[1]; ///< Padding
|
||||
u16 appearance_data; ///< Device appearance data to be advertised \ref BtdrvAppearanceType. Included with BtdrvBleAdBit_Appearance
|
||||
u8 num_service; ///< Number of services in uuid_val array below
|
||||
u8 pad2[3]; ///< Padding
|
||||
BtdrvGattAttributeUuid uuid_val[0x6]; ///< Array of 16-bit UUIDs to be advertised \ref BtdrvGattAttributeUuid. Included with BtdrvBleAdBit_Service
|
||||
u8 service_data_len; ///< Size of service_data below
|
||||
u8 pad3[1]; ///< Padding
|
||||
u16 service_data_uuid; ///< 16-bit UUID of service_data below
|
||||
u8 service_data[0x1F]; ///< Service data to be advertised. Included with BtdrvBleAdBit_ServiceData
|
||||
bool is_scan_rsp; ///< Whether this is an inquiry scan response or advertising data
|
||||
u8 tx_power; ///< Inquiry transmit power to be advertised. Included with BtdrvBleAdBit_TxPower
|
||||
u8 pad4[3]; ///< Padding
|
||||
} BtdrvBleAdvertisePacketData;
|
||||
|
||||
/// BleAdvertisement
|
||||
typedef struct {
|
||||
u8 size; ///< Size of data below.
|
||||
u8 type; ///< \ref BtdrvAdType
|
||||
u8 data[0x1D]; ///< Advertisement data
|
||||
} BtdrvBleAdvertisement;
|
||||
|
||||
/// BleAdvertiseFilter
|
||||
typedef struct {
|
||||
u8 index; ///< Filter index
|
||||
BtdrvBleAdvertisement adv; ///< \ref BtdrvBleAdvertisement
|
||||
u8 mask[0x1D]; ///< Mask for advertisement data above
|
||||
u8 mask_size; ///< Size of mask above.
|
||||
} BtdrvBleAdvertiseFilter;
|
||||
|
||||
/// BleAdvertisePacketParameter
|
||||
typedef struct {
|
||||
u16 company_id;
|
||||
u8 pattern_data[6];
|
||||
} BtdrvBleAdvertisePacketParameter;
|
||||
|
||||
/// BleScanResult
|
||||
typedef struct {
|
||||
u8 unk_x0; ///< Unknown
|
||||
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||
u8 unk_x7[0x139]; ///< Unknown
|
||||
s32 count; ///< Unknown
|
||||
s32 unk_x144; ///< Unknown
|
||||
} BtdrvBleScanResult;
|
||||
|
||||
/// BleConnectionInfo
|
||||
typedef struct {
|
||||
u32 connection_handle; ///< ConnectionHandle, 0xFFFFFFFF ([5.0.0-5.0.2] 0xFFFF) is invalid.
|
||||
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||
u8 pad[2]; ///< Padding
|
||||
} BtdrvBleConnectionInfo;
|
||||
|
||||
/// LeEventInfo
|
||||
typedef struct {
|
||||
u32 unk_x0; ///< Unknown
|
||||
u32 unk_x4; ///< Unknown
|
||||
u8 unk_x8; ///< Unknown
|
||||
u8 pad[3]; ///< Padding
|
||||
BtdrvGattAttributeUuid uuid0; ///< \ref BtdrvGattAttributeUuid
|
||||
BtdrvGattAttributeUuid uuid1; ///< \ref BtdrvGattAttributeUuid
|
||||
BtdrvGattAttributeUuid uuid2; ///< \ref BtdrvGattAttributeUuid
|
||||
u16 size; ///< Size of the below data.
|
||||
u8 data[0x3B6]; ///< Data.
|
||||
} BtdrvLeEventInfo;
|
||||
|
||||
/// BleClientGattOperationInfo
|
||||
typedef struct {
|
||||
u8 unk_x0; ///< Converted from BtdrvLeEventInfo::unk_x0.
|
||||
u8 pad[3]; ///< Padding
|
||||
u32 unk_x4; ///< BtdrvLeEventInfo::unk_x4
|
||||
u8 unk_x8; ///< BtdrvLeEventInfo::unk_x8
|
||||
u8 pad2[3]; ///< Padding
|
||||
BtdrvGattAttributeUuid uuid0; ///< BtdrvLeEventInfo::uuid0
|
||||
BtdrvGattAttributeUuid uuid1; ///< BtdrvLeEventInfo::uuid1
|
||||
BtdrvGattAttributeUuid uuid2; ///< BtdrvLeEventInfo::uuid2
|
||||
u64 size; ///< BtdrvLeEventInfo::size
|
||||
u8 data[0x200]; ///< BtdrvLeEventInfo::data
|
||||
} BtdrvBleClientGattOperationInfo;
|
||||
|
||||
/// PcmParameter
|
||||
typedef struct {
|
||||
u32 unk_x0; ///< Must be 0-3. Controls number of channels: 0 = mono, non-zero = stereo.
|
||||
s32 sample_rate; ///< Sample rate. Must be one of the following: 16000, 32000, 44100, 48000.
|
||||
u32 bits_per_sample; ///< Bits per sample. Must be 8 or 16.
|
||||
} BtdrvPcmParameter;
|
||||
|
||||
/// AudioControlButtonState
|
||||
typedef struct {
|
||||
u8 unk_x0[0x10]; ///< Unknown
|
||||
} BtdrvAudioControlButtonState;
|
||||
|
@ -1,491 +0,0 @@
|
||||
/**
|
||||
* @file btm.h
|
||||
* @brief btm service IPC wrapper.
|
||||
* @note See also: https://switchbrew.org/wiki/BTM_services
|
||||
* @author yellows8
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../services/btdrv_types.h"
|
||||
#include "../services/btm_types.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
/// Initialize btm.
|
||||
Result btmInitialize(void);
|
||||
|
||||
/// Exit btm.
|
||||
void btmExit(void);
|
||||
|
||||
/// Gets the Service object for the actual btm service session.
|
||||
Service* btmGetServiceSession(void);
|
||||
|
||||
/**
|
||||
* @brief GetState
|
||||
* @param[out] out \ref BtmState
|
||||
*/
|
||||
Result btmGetState(BtmState *out);
|
||||
|
||||
/**
|
||||
* @brief GetHostDeviceProperty
|
||||
* @param[out] out \ref BtmHostDeviceProperty
|
||||
*/
|
||||
Result btmGetHostDeviceProperty(BtmHostDeviceProperty *out);
|
||||
|
||||
/**
|
||||
* @brief AcquireDeviceConditionEvent
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireDeviceConditionEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetDeviceCondition [1.0.0-12.1.0]
|
||||
* @param[out] out \ref BtmDeviceCondition
|
||||
*/
|
||||
Result btmLegacyGetDeviceCondition(BtmDeviceCondition *out);
|
||||
|
||||
/**
|
||||
* @brief GetDeviceCondition [13.0.0+]
|
||||
* @param[in] profile \ref BtmProfile, when not ::BtmProfile_None entries are only returned which match this profile.
|
||||
* @param[out] out \ref BtmConnectedDeviceV13
|
||||
* @param[in] count Size of the out array in entries.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetDeviceCondition(BtmProfile profile, BtmConnectedDeviceV13 *out, size_t count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief SetBurstMode
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
* @param[in] flag Flag
|
||||
*/
|
||||
Result btmSetBurstMode(BtdrvAddress addr, bool flag);
|
||||
|
||||
/**
|
||||
* @brief SetSlotMode
|
||||
* @param[in] list \ref BtmDeviceSlotModeList
|
||||
*/
|
||||
Result btmSetSlotMode(const BtmDeviceSlotModeList *list);
|
||||
|
||||
/**
|
||||
* @brief SetBluetoothMode
|
||||
* @note Only available on pre-9.0.0.
|
||||
* @param[in] mode \ref BtmBluetoothMode
|
||||
*/
|
||||
Result btmSetBluetoothMode(BtmBluetoothMode mode);
|
||||
|
||||
/**
|
||||
* @brief SetWlanMode
|
||||
* @param[in] mode \ref BtmWlanMode
|
||||
*/
|
||||
Result btmSetWlanMode(BtmWlanMode mode);
|
||||
|
||||
/**
|
||||
* @brief AcquireDeviceInfoEvent
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireDeviceInfoEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetDeviceInfo [1.0.0-12.1.0]
|
||||
* @param[out] out \ref BtmDeviceInfoList
|
||||
*/
|
||||
Result btmLegacyGetDeviceInfo(BtmDeviceInfoList *out);
|
||||
|
||||
/**
|
||||
* @brief GetDeviceInfo [13.0.0+]
|
||||
* @param[in] profile \ref BtmProfile, when not ::BtmProfile_None entries are only returned which match this profile.
|
||||
* @param[out] out \ref BtmDeviceInfoV13
|
||||
* @param[in] count Size of the out array in entries.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetDeviceInfo(BtmProfile profile, BtmDeviceInfoV13 *out, size_t count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AddDeviceInfo
|
||||
* @param[in] info \ref BtmDeviceInfo
|
||||
*/
|
||||
Result btmAddDeviceInfo(const BtmDeviceInfo *info);
|
||||
|
||||
/**
|
||||
* @brief RemoveDeviceInfo
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
*/
|
||||
Result btmRemoveDeviceInfo(BtdrvAddress addr);
|
||||
|
||||
/**
|
||||
* @brief IncreaseDeviceInfoOrder
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
*/
|
||||
Result btmIncreaseDeviceInfoOrder(BtdrvAddress addr);
|
||||
|
||||
/**
|
||||
* @brief LlrNotify
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
* @param[in] unk [9.0.0+] Unknown
|
||||
*/
|
||||
Result btmLlrNotify(BtdrvAddress addr, s32 unk);
|
||||
|
||||
/**
|
||||
* @brief EnableRadio
|
||||
*/
|
||||
Result btmEnableRadio(void);
|
||||
|
||||
/**
|
||||
* @brief DisableRadio
|
||||
*/
|
||||
Result btmDisableRadio(void);
|
||||
|
||||
/**
|
||||
* @brief HidDisconnect
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
*/
|
||||
Result btmHidDisconnect(BtdrvAddress addr);
|
||||
|
||||
/**
|
||||
* @brief HidSetRetransmissionMode
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
* @param[in] list \ref BtmZeroRetransmissionList
|
||||
*/
|
||||
Result btmHidSetRetransmissionMode(BtdrvAddress addr, const BtmZeroRetransmissionList *list);
|
||||
|
||||
/**
|
||||
* @brief AcquireAwakeReqEvent
|
||||
* @note Only available on [2.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireAwakeReqEvent(Event* out_event);
|
||||
|
||||
|
||||
/**
|
||||
* @brief AcquireLlrStateEvent
|
||||
* @note Only available on [4.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireLlrStateEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief IsLlrStarted
|
||||
* @note Only available on [4.0.0+].
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result btmIsLlrStarted(bool *out);
|
||||
|
||||
/**
|
||||
* @brief EnableSlotSaving
|
||||
* @note Only available on [4.0.0+].
|
||||
* @param[in] flag Flag
|
||||
*/
|
||||
Result btmEnableSlotSaving(bool flag);
|
||||
|
||||
/**
|
||||
* @brief ProtectDeviceInfo
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
* @param[in] flag Flag
|
||||
*/
|
||||
Result btmProtectDeviceInfo(BtdrvAddress addr, bool flag);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleScanEvent
|
||||
* @note Only available on [5.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireBleScanEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanParameterGeneral
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] parameter_id Must be value 0x1 or 0xFFFF.
|
||||
* @param[out] out \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmGetBleScanParameterGeneral(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanParameterSmartDevice
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] parameter_id Must be value 0x2.
|
||||
* @param[out] out \ref BtdrvGattAttributeUuid. The first 4-bytes is always 0.
|
||||
*/
|
||||
Result btmGetBleScanParameterSmartDevice(u16 parameter_id, BtdrvGattAttributeUuid *out);
|
||||
|
||||
/**
|
||||
* @brief StartBleScanForGeneral
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmStartBleScanForGeneral(BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief StopBleScanForGeneral
|
||||
* @note Only available on [5.1.0+].
|
||||
*/
|
||||
Result btmStopBleScanForGeneral(void);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanResultsForGeneral
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[out] results Output array of \ref BtdrvBleScanResult.
|
||||
* @param[in] count Size of the results array in entries. The max is 10.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetBleScanResultsForGeneral(BtdrvBleScanResult *results, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief StartBleScanForPaired
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmStartBleScanForPaired(BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief StopBleScanForPaired
|
||||
* @note Only available on [5.1.0+].
|
||||
*/
|
||||
Result btmStopBleScanForPaired(void);
|
||||
|
||||
/**
|
||||
* @brief StartBleScanForSmartDevice
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
*/
|
||||
Result btmStartBleScanForSmartDevice(const BtdrvGattAttributeUuid *uuid);
|
||||
|
||||
/**
|
||||
* @brief StopBleScanForSmartDevice
|
||||
* @note Only available on [5.1.0+].
|
||||
*/
|
||||
Result btmStopBleScanForSmartDevice(void);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanResultsForSmartDevice
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[out] results Output array of \ref BtdrvBleScanResult.
|
||||
* @param[in] count Size of the results array in entries. The max is 10.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetBleScanResultsForSmartDevice(BtdrvBleScanResult *results, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleConnectionEvent
|
||||
* @note Only available on [5.1.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireBleConnectionEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief BleConnect
|
||||
* @note Only available on [5.0.0+].
|
||||
* @note The \ref BtdrvAddress must not be already connected. A maximum of 4 devices can be connected.
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
*/
|
||||
Result btmBleConnect(BtdrvAddress addr);
|
||||
|
||||
/**
|
||||
* @brief BleOverrideConnection
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] id Same as \ref btmBleDisconnect.
|
||||
*/
|
||||
Result btmBleOverrideConnection(u32 id);
|
||||
|
||||
/**
|
||||
* @brief BleDisconnect
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle This must match a BtdrvBleConnectionInfo::id from \ref btmBleGetConnectionState. [5.1.0+] 0xFFFFFFFF is invalid.
|
||||
*/
|
||||
Result btmBleDisconnect(u32 connection_handle);
|
||||
|
||||
/**
|
||||
* @brief BleGetConnectionState
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[out] info Output array of \ref BtdrvBleConnectionInfo.
|
||||
* @param[in] count Size of the info array in entries. Other cmds which use this internally use count=4.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmBleGetConnectionState(BtdrvBleConnectionInfo *info, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief BleGetGattClientConditionList
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[out] list \ref BtmGattClientConditionList
|
||||
*/
|
||||
Result btmBleGetGattClientConditionList(BtmGattClientConditionList *list);
|
||||
|
||||
/**
|
||||
* @brief AcquireBlePairingEvent
|
||||
* @note Only available on [5.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireBlePairingEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief BlePairDevice
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmBlePairDevice(u32 connection_handle, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief BleUnpairDeviceOnBoth
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmBleUnpairDeviceOnBoth(u32 connection_handle, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief BleUnPairDevice
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmBleUnPairDevice(BtdrvAddress addr, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief BleGetPairedAddresses
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
* @param[out] addrs Output array of \ref BtdrvAddress.
|
||||
* @param[in] count Size of the addrs array in entries.
|
||||
* @param[out] total_out Total output entries. The max is 10.
|
||||
*/
|
||||
Result btmBleGetPairedAddresses(BtdrvBleAdvertisePacketParameter param, BtdrvAddress *addrs, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleServiceDiscoveryEvent
|
||||
* @note Only available on [5.1.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireBleServiceDiscoveryEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetGattServices
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[out] services Output array of \ref BtmGattService.
|
||||
* @param[in] count Size of the services array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetGattServices(u32 connection_handle, BtmGattService *services, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Same as \ref btmGetGattServices except this only returns the \ref BtmGattService which matches the input \ref BtdrvGattAttributeUuid.
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[out] service \ref BtmGattService
|
||||
* @param[out] flag Whether a \ref BtmGattService was returned.
|
||||
*/
|
||||
Result btmGetGattService(u32 connection_handle, const BtdrvGattAttributeUuid *uuid, BtmGattService *service, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief Same as \ref btmGetGattServices except this only returns \ref BtmGattService entries where various checks pass with u16 fields.
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] service_handle ServiceHandle
|
||||
* @param[out] services \ref BtmGattService
|
||||
* @param[in] count Size of the services array in entries. The max is 100.
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result btmGetGattIncludedServices(u32 connection_handle, u16 service_handle, BtmGattService *services, u8 count, u8 *out);
|
||||
|
||||
/**
|
||||
* @brief This is similar to \ref btmGetGattIncludedServices except this only returns 1 \ref BtmGattService.
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] attribute_handle AttributeHandle
|
||||
* @param[out] service \ref BtmGattService
|
||||
* @param[out] flag Whether a \ref BtmGattService was returned.
|
||||
*/
|
||||
Result btmGetBelongingService(u32 connection_handle, u16 attribute_handle, BtmGattService *service, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief GetGattCharacteristics
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] service_handle This controls which \ref BtmGattCharacteristic entries to return.
|
||||
* @param[out] characteristics \ref BtmGattCharacteristic
|
||||
* @param[in] count Size of the characteristics array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetGattCharacteristics(u32 connection_handle, u16 service_handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief GetGattDescriptors
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] char_handle Characteristic handle. This controls which \ref BtmGattDescriptor entries to return.
|
||||
* @param[out] descriptors \ref BtmGattDescriptor
|
||||
* @param[in] count Size of the descriptors array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetGattDescriptors(u32 connection_handle, u16 char_handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleMtuConfigEvent
|
||||
* @note Only available on [5.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmAcquireBleMtuConfigEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief ConfigureBleMtu
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] mtu MTU
|
||||
*/
|
||||
Result btmConfigureBleMtu(u32 connection_handle, u16 mtu);
|
||||
|
||||
/**
|
||||
* @brief GetBleMtu
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[out] out Output MTU.
|
||||
*/
|
||||
Result btmGetBleMtu(u32 connection_handle, u16 *out);
|
||||
|
||||
/**
|
||||
* @brief RegisterBleGattDataPath
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] path \ref BtmBleDataPath
|
||||
*/
|
||||
Result btmRegisterBleGattDataPath(const BtmBleDataPath *path);
|
||||
|
||||
/**
|
||||
* @brief UnregisterBleGattDataPath
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] path \ref BtmBleDataPath
|
||||
*/
|
||||
Result btmUnregisterBleGattDataPath(const BtmBleDataPath *path);
|
||||
|
||||
/**
|
||||
* @brief RegisterAppletResourceUserId
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] AppletResourceUserId AppletResourceUserId
|
||||
* @param[in] unk Unknown
|
||||
*/
|
||||
Result btmRegisterAppletResourceUserId(u64 AppletResourceUserId, u32 unk);
|
||||
|
||||
/**
|
||||
* @brief UnregisterAppletResourceUserId
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] AppletResourceUserId AppletResourceUserId
|
||||
*/
|
||||
Result btmUnregisterAppletResourceUserId(u64 AppletResourceUserId);
|
||||
|
||||
/**
|
||||
* @brief SetAppletResourceUserId
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] AppletResourceUserId AppletResourceUserId
|
||||
*/
|
||||
Result btmSetAppletResourceUserId(u64 AppletResourceUserId);
|
||||
|
@ -1,305 +0,0 @@
|
||||
/**
|
||||
* @file btm_types.h
|
||||
* @brief btm service types.
|
||||
* @author yellows8
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
|
||||
/// BtmState
|
||||
typedef enum {
|
||||
BtmState_NotInitialized = 0, ///< NotInitialized
|
||||
BtmState_RadioOff = 1, ///< RadioOff
|
||||
BtmState_MinorSlept = 2, ///< MinorSlept
|
||||
BtmState_RadioOffMinorSlept = 3, ///< RadioOffMinorSlept
|
||||
BtmState_Slept = 4, ///< Slept
|
||||
BtmState_RadioOffSlept = 5, ///< RadioOffSlept
|
||||
BtmState_Initialized = 6, ///< Initialized
|
||||
BtmState_Working = 7, ///< Working
|
||||
} BtmState;
|
||||
|
||||
/// BluetoothMode
|
||||
typedef enum {
|
||||
BtmBluetoothMode_Dynamic2Slot = 0, ///< Dynamic2Slot
|
||||
BtmBluetoothMode_StaticJoy = 1, ///< StaticJoy
|
||||
} BtmBluetoothMode;
|
||||
|
||||
/// WlanMode
|
||||
typedef enum {
|
||||
BtmWlanMode_Local4 = 0, ///< Local4
|
||||
BtmWlanMode_Local8 = 1, ///< Local8
|
||||
BtmWlanMode_None = 2, ///< None
|
||||
} BtmWlanMode;
|
||||
|
||||
/// TsiMode
|
||||
typedef enum {
|
||||
BtmTsiMode_0Fd3Td3Si10 = 0, ///< 0Fd3Td3Si10
|
||||
BtmTsiMode_1Fd1Td1Si5 = 1, ///< 1Fd1Td1Si5
|
||||
BtmTsiMode_2Fd1Td3Si10 = 2, ///< 2Fd1Td3Si10
|
||||
BtmTsiMode_3Fd1Td5Si15 = 3, ///< 3Fd1Td5Si15
|
||||
BtmTsiMode_4Fd3Td1Si10 = 4, ///< 4Fd3Td1Si10
|
||||
BtmTsiMode_5Fd3Td3Si15 = 5, ///< 5Fd3Td3Si15
|
||||
BtmTsiMode_6Fd5Td1Si15 = 6, ///< 6Fd5Td1Si15
|
||||
BtmTsiMode_7Fd1Td3Si15 = 7, ///< 7Fd1Td3Si15
|
||||
BtmTsiMode_8Fd3Td1Si15 = 8, ///< 8Fd3Td1Si15
|
||||
BtmTsiMode_9Fd1Td1Si10 = 9, ///< 9Fd1Td1Si10
|
||||
BtmTsiMode_10Fd1Td1Si15 = 10, ///< 10Fd1Td1Si15
|
||||
BtmTsiMode_Active = 255, ///< Active
|
||||
} BtmTsiMode;
|
||||
|
||||
/// SlotMode
|
||||
typedef enum {
|
||||
BtmSlotMode_2 = 0, ///< 2
|
||||
BtmSlotMode_4 = 1, ///< 4
|
||||
BtmSlotMode_6 = 2, ///< 6
|
||||
BtmSlotMode_Active = 3, ///< Active
|
||||
} BtmSlotMode;
|
||||
|
||||
/// Profile
|
||||
typedef enum {
|
||||
BtmProfile_None = 0, ///< None
|
||||
BtmProfile_Hid = 1, ///< Hid
|
||||
BtmProfile_Audio = 2, ///< [13.0.0+] Audio
|
||||
} BtmProfile;
|
||||
|
||||
/// BdName
|
||||
typedef struct {
|
||||
char name[0x20]; ///< Name string.
|
||||
} BtmBdName;
|
||||
|
||||
/// ClassOfDevice
|
||||
typedef struct {
|
||||
u8 class_of_device[0x3]; ///< ClassOfDevice
|
||||
} BtmClassOfDevice;
|
||||
|
||||
/// LinkKey
|
||||
typedef struct {
|
||||
u8 link_key[0x10]; ///< LinkKey
|
||||
} BtmLinkKey;
|
||||
|
||||
/// HidDeviceInfo
|
||||
typedef struct {
|
||||
u16 vid; ///< Vid
|
||||
u16 pid; ///< Pid
|
||||
} BtmHidDeviceInfo;
|
||||
|
||||
/// HostDeviceProperty
|
||||
typedef struct {
|
||||
union {
|
||||
struct {
|
||||
BtdrvAddress addr; ///< Same as BtdrvAdapterProperty::addr.
|
||||
BtmClassOfDevice class_of_device; ///< Same as BtdrvAdapterProperty::class_of_device.
|
||||
BtmBdName name; ///< Same as BtdrvAdapterProperty::name (except the last byte which is always zero).
|
||||
u8 feature_set; ///< Same as BtdrvAdapterProperty::feature_set.
|
||||
} v1; ///< [1.0.0-12.1.0]
|
||||
|
||||
struct {
|
||||
BtdrvAddress addr; ///< Same as BtdrvAdapterProperty::addr.
|
||||
BtmClassOfDevice class_of_device; ///< Same as BtdrvAdapterProperty::class_of_device.
|
||||
char name[0xF9]; ///< Same as BtdrvAdapterProperty::name (except the last byte which is always zero).
|
||||
u8 feature_set; ///< Same as BtdrvAdapterProperty::feature_set.
|
||||
} v13; ///< [13.0.0+]
|
||||
};
|
||||
} BtmHostDeviceProperty;
|
||||
|
||||
/// BtmConnectedDevice [1.0.0-12.1.0]
|
||||
typedef struct {
|
||||
BtdrvAddress address;
|
||||
u8 pad[2];
|
||||
u32 unk_x8;
|
||||
char name[0x20];
|
||||
u8 unk_x2C[0x1C];
|
||||
u16 vid;
|
||||
u16 pid;
|
||||
u8 unk_x4C[0x20];
|
||||
} BtmConnectedDeviceV1;
|
||||
|
||||
/// BtmConnectedDevice [13.0.0+]
|
||||
typedef struct {
|
||||
BtdrvAddress address;
|
||||
u8 pad[2];
|
||||
u32 profile; ///< \ref BtmProfile
|
||||
u8 unk_xC[0x40];
|
||||
char name[0x20];
|
||||
u8 unk_x6C[0xD9];
|
||||
u8 pad2[3];
|
||||
} BtmConnectedDeviceV13;
|
||||
|
||||
/// DeviceCondition [1.0.0-5.0.2]
|
||||
typedef struct {
|
||||
u32 unk_x0;
|
||||
u32 unk_x4;
|
||||
u8 unk_x8;
|
||||
u8 unk_x9;
|
||||
u8 max_count;
|
||||
u8 connected_count;
|
||||
BtmConnectedDeviceV1 devices[8];
|
||||
} BtmDeviceConditionV100;
|
||||
|
||||
/// DeviceCondition [5.1.0-7.0.1]
|
||||
typedef struct {
|
||||
u32 unk_x0;
|
||||
u32 unk_x4;
|
||||
u8 unk_x8;
|
||||
u8 unk_x9[2];
|
||||
u8 max_count;
|
||||
u8 connected_count;
|
||||
u8 pad[3];
|
||||
BtmConnectedDeviceV1 devices[8];
|
||||
} BtmDeviceConditionV510;
|
||||
|
||||
/// DeviceCondition [8.0.0-8.1.1]
|
||||
typedef struct {
|
||||
u32 unk_x0;
|
||||
u32 unk_x4;
|
||||
u8 unk_x8;
|
||||
u8 unk_x9;
|
||||
u8 max_count;
|
||||
u8 connected_count;
|
||||
BtmConnectedDeviceV1 devices[8];
|
||||
} BtmDeviceConditionV800;
|
||||
|
||||
/// DeviceCondition [9.0.0-12.1.0]
|
||||
typedef struct {
|
||||
u32 unk_x0;
|
||||
u8 unk_x4;
|
||||
u8 unk_x5;
|
||||
u8 max_count;
|
||||
u8 connected_count;
|
||||
BtmConnectedDeviceV1 devices[8];
|
||||
} BtmDeviceConditionV900;
|
||||
|
||||
/// DeviceCondition [1.0.0-12.1.0]
|
||||
typedef union {
|
||||
BtmDeviceConditionV100 v100;
|
||||
BtmDeviceConditionV510 v510;
|
||||
BtmDeviceConditionV800 v800;
|
||||
BtmDeviceConditionV900 v900;
|
||||
} BtmDeviceCondition;
|
||||
|
||||
/// DeviceSlotMode
|
||||
typedef struct {
|
||||
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||
u8 reserved[2]; ///< Reserved
|
||||
u32 slot_mode; ///< \ref BtmSlotMode
|
||||
} BtmDeviceSlotMode;
|
||||
|
||||
/// DeviceSlotModeList
|
||||
typedef struct {
|
||||
u8 device_count; ///< DeviceCount
|
||||
u8 reserved[3]; ///< Reserved
|
||||
BtmDeviceSlotMode devices[8]; ///< Array of \ref BtmDeviceSlotMode with the above count.
|
||||
} BtmDeviceSlotModeList;
|
||||
|
||||
/// DeviceInfo [1.0.0-12.1.0]
|
||||
typedef struct {
|
||||
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||
BtmClassOfDevice class_of_device; ///< ClassOfDevice
|
||||
BtmBdName name; ///< BdName
|
||||
BtmLinkKey link_key; ///< LinkKey
|
||||
u8 reserved[3]; ///< Reserved
|
||||
u32 profile; ///< \ref BtmProfile
|
||||
union {
|
||||
u8 data[0x4]; ///< Empty (Profile = None)
|
||||
BtmHidDeviceInfo hid_device_info; ///< \ref BtmHidDeviceInfo (Profile = Hid)
|
||||
} profile_info;
|
||||
u8 reserved2[0x1C]; ///< Reserved
|
||||
} BtmDeviceInfoV1;
|
||||
|
||||
/// DeviceInfo [13.0.0+]
|
||||
typedef struct {
|
||||
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||
BtmClassOfDevice class_of_device; ///< ClassOfDevice
|
||||
BtmLinkKey link_key; ///< LinkKey
|
||||
u8 reserved[3]; ///< Reserved
|
||||
u32 profile; ///< \ref BtmProfile
|
||||
union {
|
||||
u8 data[0x4]; ///< Empty (Profile = None)
|
||||
BtmHidDeviceInfo hid_device_info; ///< \ref BtmHidDeviceInfo (Profile = Hid)
|
||||
} profile_info;
|
||||
u8 reserved2[0x1C]; ///< Reserved
|
||||
char name[0xF9]; ///< Name
|
||||
u8 pad[3]; ///< Padding
|
||||
} BtmDeviceInfoV13;
|
||||
|
||||
/// DeviceInfo [1.0.0-13.0.0]
|
||||
typedef union {
|
||||
BtmDeviceInfoV1 v1;
|
||||
BtmDeviceInfoV13 v13;
|
||||
} BtmDeviceInfo;
|
||||
|
||||
/// DeviceInfoList
|
||||
typedef struct {
|
||||
u8 device_count; ///< DeviceCount
|
||||
u8 reserved[3]; ///< Reserved
|
||||
BtmDeviceInfoV1 devices[10]; ///< Array of \ref BtmDeviceInfoV1 with the above count.
|
||||
} BtmDeviceInfoList;
|
||||
|
||||
/// DeviceProperty
|
||||
typedef struct {
|
||||
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||
BtmClassOfDevice class_of_device; ///< ClassOfDevice
|
||||
BtmBdName name; ///< BdName
|
||||
} BtmDeviceProperty;
|
||||
|
||||
/// DevicePropertyList
|
||||
typedef struct {
|
||||
u8 device_count; ///< DeviceCount
|
||||
BtmDeviceProperty devices[15]; ///< Array of \ref BtmDeviceProperty.
|
||||
} BtmDevicePropertyList;
|
||||
|
||||
/// ZeroRetransmissionList
|
||||
typedef struct {
|
||||
u8 enabled_report_id_count; ///< EnabledReportIdCount
|
||||
u8 enabled_report_id[0x10]; ///< Array of EnabledReportId.
|
||||
} BtmZeroRetransmissionList;
|
||||
|
||||
/// GattClientConditionList
|
||||
typedef struct {
|
||||
u8 unk_x0[0x74]; ///< Unknown
|
||||
} BtmGattClientConditionList;
|
||||
|
||||
/// GattService
|
||||
typedef struct {
|
||||
u8 unk_x0[0x4]; ///< Unknown
|
||||
BtdrvGattAttributeUuid uuid; ///< \ref BtdrvGattAttributeUuid
|
||||
u16 handle; ///< Handle
|
||||
u8 unk_x1A[0x2]; ///< Unknown
|
||||
u16 instance_id; ///< InstanceId
|
||||
u16 end_group_handle; ///< EndGroupHandle
|
||||
u8 primary_service; ///< PrimaryService
|
||||
u8 pad[3]; ///< Padding
|
||||
} BtmGattService;
|
||||
|
||||
/// GattCharacteristic
|
||||
typedef struct {
|
||||
u8 unk_x0[0x4]; ///< Unknown
|
||||
BtdrvGattAttributeUuid uuid; ///< \ref BtdrvGattAttributeUuid
|
||||
u16 handle; ///< Handle
|
||||
u8 unk_x1A[0x2]; ///< Unknown
|
||||
u16 instance_id; ///< InstanceId
|
||||
u8 properties; ///< Properties
|
||||
u8 unk_x1F[0x5]; ///< Unknown
|
||||
} BtmGattCharacteristic;
|
||||
|
||||
/// GattDescriptor
|
||||
typedef struct {
|
||||
u8 unk_x0[0x4]; ///< Unknown
|
||||
BtdrvGattAttributeUuid uuid; ///< \ref BtdrvGattAttributeUuid
|
||||
u16 handle; ///< Handle
|
||||
u8 unk_x1A[0x6]; ///< Unknown
|
||||
} BtmGattDescriptor;
|
||||
|
||||
/// BleDataPath
|
||||
typedef struct {
|
||||
u8 unk_x0; ///< Unknown
|
||||
u8 pad[3]; ///< Padding
|
||||
BtdrvGattAttributeUuid uuid; ///< \ref BtdrvGattAttributeUuid
|
||||
} BtmBleDataPath;
|
||||
|
||||
/// AudioDevice
|
||||
typedef struct {
|
||||
BtdrvAddress addr; ///< Device address
|
||||
char name[0xF9]; ///< Device name
|
||||
} BtmAudioDevice;
|
@ -1,185 +0,0 @@
|
||||
/**
|
||||
* @file btmsys.h
|
||||
* @brief btm:sys (btm system) service IPC wrapper.
|
||||
* @author yellows8
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../services/btdrv_types.h"
|
||||
#include "../services/btm_types.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
/// Initialize btm:sys.
|
||||
Result btmsysInitialize(void);
|
||||
|
||||
/// Exit btm:sys.
|
||||
void btmsysExit(void);
|
||||
|
||||
/// Gets the Service object for the actual btm:sys service session. This object must be closed by the user once finished using cmds with this.
|
||||
Result btmsysGetServiceSession(Service* srv_out);
|
||||
|
||||
/// Gets the Service object for IBtmSystemCore.
|
||||
Service* btmsysGetServiceSession_IBtmSystemCore(void);
|
||||
|
||||
/**
|
||||
* @brief StartGamepadPairing
|
||||
*/
|
||||
Result btmsysStartGamepadPairing(void);
|
||||
|
||||
/**
|
||||
* @brief CancelGamepadPairing
|
||||
*/
|
||||
Result btmsysCancelGamepadPairing(void);
|
||||
|
||||
/**
|
||||
* @brief ClearGamepadPairingDatabase
|
||||
*/
|
||||
Result btmsysClearGamepadPairingDatabase(void);
|
||||
|
||||
/**
|
||||
* @brief GetPairedGamepadCount
|
||||
* @param[out] out Output count.
|
||||
*/
|
||||
Result btmsysGetPairedGamepadCount(u8 *out);
|
||||
|
||||
/**
|
||||
* @brief EnableRadio
|
||||
*/
|
||||
Result btmsysEnableRadio(void);
|
||||
|
||||
/**
|
||||
* @brief DisableRadio
|
||||
*/
|
||||
Result btmsysDisableRadio(void);
|
||||
|
||||
/**
|
||||
* @brief GetRadioOnOff
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result btmsysGetRadioOnOff(bool *out);
|
||||
|
||||
/**
|
||||
* @brief AcquireRadioEvent
|
||||
* @note Only available on [3.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmsysAcquireRadioEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief AcquireGamepadPairingEvent
|
||||
* @note Only available on [3.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmsysAcquireGamepadPairingEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief IsGamepadPairingStarted
|
||||
* @note Only available on [3.0.0+].
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result btmsysIsGamepadPairingStarted(bool *out);
|
||||
|
||||
/**
|
||||
* @brief StartAudioDeviceDiscovery
|
||||
* @note Only available on [13.0.0+].
|
||||
*/
|
||||
Result btmsysStartAudioDeviceDiscovery(void);
|
||||
|
||||
/**
|
||||
* @brief StopAudioDeviceDiscovery
|
||||
* @note Only available on [13.0.0+].
|
||||
*/
|
||||
Result btmsysStopAudioDeviceDiscovery(void);
|
||||
|
||||
/**
|
||||
* @brief IsDiscoveryingAudioDevice
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result btmsysIsDiscoveryingAudioDevice(bool *out);
|
||||
|
||||
/**
|
||||
* @brief GetDiscoveredAudioDevice
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[out] out Output array of \ref BtmAudioDevice.
|
||||
* @param[in] count Size of the out array in entries. The max is 15.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmsysGetDiscoveredAudioDevice(BtmAudioDevice *out, s32 count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireAudioDeviceConnectionEvent
|
||||
* @note Only available on [13.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmsysAcquireAudioDeviceConnectionEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief ConnectAudioDevice
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
*/
|
||||
Result btmsysConnectAudioDevice(BtdrvAddress addr);
|
||||
|
||||
/**
|
||||
* @brief IsConnectingAudioDevice
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[out] out Output flag.
|
||||
*/
|
||||
Result btmsysIsConnectingAudioDevice(bool *out);
|
||||
|
||||
/**
|
||||
* @brief GetConnectedAudioDevices
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[out] out Output array of \ref BtmAudioDevice.
|
||||
* @param[in] count Size of the out array in entries. The max is 8.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmsysGetConnectedAudioDevices(BtmAudioDevice *out, s32 count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief DisconnectAudioDevice
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
*/
|
||||
Result btmsysDisconnectAudioDevice(BtdrvAddress addr);
|
||||
|
||||
/**
|
||||
* @brief AcquirePairedAudioDeviceInfoChangedEvent
|
||||
* @note Only available on [13.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmsysAcquirePairedAudioDeviceInfoChangedEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetPairedAudioDevices
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[out] out Output array of \ref BtmAudioDevice.
|
||||
* @param[in] count Size of the out array in entries. The max is 10.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmsysGetPairedAudioDevices(BtmAudioDevice *out, s32 count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief RemoveAudioDevicePairing
|
||||
* @note Only available on [13.0.0+].
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
*/
|
||||
Result btmsysRemoveAudioDevicePairing(BtdrvAddress addr);
|
||||
|
||||
/**
|
||||
* @brief RequestAudioDeviceConnectionRejection
|
||||
* @note Only available on [13.0.0+].
|
||||
*/
|
||||
Result btmsysRequestAudioDeviceConnectionRejection(void);
|
||||
|
||||
/**
|
||||
* @brief CancelAudioDeviceConnectionRejection
|
||||
* @note Only available on [13.0.0+].
|
||||
*/
|
||||
Result btmsysCancelAudioDeviceConnectionRejection(void);
|
@ -1,290 +0,0 @@
|
||||
/**
|
||||
* @file btmu.h
|
||||
* @brief btm:u (btm user) service IPC wrapper.
|
||||
* @note Only available on [5.0.0+].
|
||||
* @note See also btdev.
|
||||
* @note See also: https://switchbrew.org/wiki/BTM_services
|
||||
* @author yellows8
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../services/btdrv_types.h"
|
||||
#include "../services/btm.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
/// Initialize btm:u.
|
||||
Result btmuInitialize(void);
|
||||
|
||||
/// Exit btm:u.
|
||||
void btmuExit(void);
|
||||
|
||||
/// Gets the Service object for the actual btm:u service session. This object must be closed by the user once finished using cmds with this.
|
||||
Result btmuGetServiceSession(Service* srv_out);
|
||||
|
||||
/// Gets the Service object for IBtmUserCore.
|
||||
Service* btmuGetServiceSession_IBtmUserCore(void);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleScanEvent
|
||||
* @note This is similar to \ref btmAcquireBleScanEvent.
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmuAcquireBleScanEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanFilterParameter
|
||||
* @note This is the same as \ref btmGetBleScanParameterGeneral.
|
||||
* @param[in] parameter_id Must be value 0x1 or 0xFFFF.
|
||||
* @param[out] out \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmuGetBleScanFilterParameter(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanFilterParameter2
|
||||
* @note This is the same as \ref btmGetBleScanParameterSmartDevice.
|
||||
* @param[in] parameter_id Must be value 0x2.
|
||||
* @param[out] out \ref BtdrvGattAttributeUuid. The first 4-bytes is always 0.
|
||||
*/
|
||||
Result btmuGetBleScanFilterParameter2(u16 parameter_id, BtdrvGattAttributeUuid *out);
|
||||
|
||||
/**
|
||||
* @brief StartBleScanForGeneral
|
||||
* @note This is similar to \ref btmStartBleScanForGeneral.
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmuStartBleScanForGeneral(BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief StopBleScanForGeneral
|
||||
* @note This is similar to \ref btmStopBleScanForGeneral.
|
||||
*/
|
||||
Result btmuStopBleScanForGeneral(void);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanResultsForGeneral
|
||||
* @note This is similar to \ref btmGetBleScanResultsForGeneral.
|
||||
* @param[out] results Output array of \ref BtdrvBleScanResult.
|
||||
* @param[in] count Size of the results array in entries. The max is 10.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmuGetBleScanResultsForGeneral(BtdrvBleScanResult *results, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief StartBleScanForPaired
|
||||
* @note This is similar to \ref btmStartBleScanForPaired.
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmuStartBleScanForPaired(BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief StopBleScanForPaired
|
||||
* @note This is similar to \ref btmStopBleScanForPaired.
|
||||
*/
|
||||
Result btmuStopBleScanForPaired(void);
|
||||
|
||||
/**
|
||||
* @brief StartBleScanForSmartDevice
|
||||
* @note This is similar to \ref btmStartBleScanForSmartDevice.
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
*/
|
||||
Result btmuStartBleScanForSmartDevice(const BtdrvGattAttributeUuid *uuid);
|
||||
|
||||
/**
|
||||
* @brief StopBleScanForSmartDevice
|
||||
* @note This is similar to \ref btmStopBleScanForSmartDevice.
|
||||
*/
|
||||
Result btmuStopBleScanForSmartDevice(void);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanResultsForSmartDevice
|
||||
* @note This is similar to \ref btmGetBleScanResultsForSmartDevice.
|
||||
* @param[out] results Output array of \ref BtdrvBleScanResult.
|
||||
* @param[in] count Size of the results array in entries. The max is 10.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmuGetBleScanResultsForSmartDevice(BtdrvBleScanResult *results, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleConnectionEvent
|
||||
* @note This is similar to \ref btmAcquireBleConnectionEvent.
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmuAcquireBleConnectionEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief BleConnect
|
||||
* @note This is similar to \ref btmBleConnect.
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
*/
|
||||
Result btmuBleConnect(BtdrvAddress addr);
|
||||
|
||||
/**
|
||||
* @brief BleDisconnect
|
||||
* @note This is similar to \ref btmBleDisconnect.
|
||||
* @param[in] connection_handle This must match a BtdrvBleConnectionInfo::connection_handle from \ref btmuBleGetConnectionState. [5.1.0+] 0xFFFFFFFF is invalid.
|
||||
*/
|
||||
Result btmuBleDisconnect(u32 connection_handle);
|
||||
|
||||
/**
|
||||
* @brief BleGetConnectionState
|
||||
* @note This is similar to \ref btmBleGetConnectionState.
|
||||
* @param[out] info Output array of \ref BtdrvBleConnectionInfo.
|
||||
* @param[in] count Size of the info array in entries. Other cmds which use this internally use count=4.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmuBleGetConnectionState(BtdrvBleConnectionInfo *info, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBlePairingEvent
|
||||
* @note This is similar to \ref btmAcquireBlePairingEvent.
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmuAcquireBlePairingEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief BlePairDevice
|
||||
* @note This is similar to \ref btmBlePairDevice.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmuBlePairDevice(u32 connection_handle, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief BleUnPairDevice
|
||||
* @note This is similar to \ref btmBleUnpairDeviceOnBoth.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmuBleUnPairDevice(u32 connection_handle, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief BleUnPairDevice2
|
||||
* @note This is similar to \ref btmBleUnPairDevice.
|
||||
* @param[in] addr \ref BtdrvAddress
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmuBleUnPairDevice2(BtdrvAddress addr, BtdrvBleAdvertisePacketParameter param);
|
||||
|
||||
/**
|
||||
* @brief BleGetPairedDevices
|
||||
* @note This is similar to \ref btmBleGetPairedAddresses.
|
||||
* @param[in] param \ref BtdrvBleAdvertisePacketParameter
|
||||
* @param[out] addrs Output array of \ref BtdrvAddress.
|
||||
* @param[in] count Size of the addrs array in entries.
|
||||
* @param[out] total_out Total output entries. The max is 10.
|
||||
*/
|
||||
Result btmuBleGetPairedDevices(BtdrvBleAdvertisePacketParameter param, BtdrvAddress *addrs, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleServiceDiscoveryEvent
|
||||
* @note This is similar to \ref btmAcquireBleServiceDiscoveryEvent.
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmuAcquireBleServiceDiscoveryEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetGattServices
|
||||
* @note This is similar to \ref btmGetGattServices.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[out] services Output array of \ref BtmGattService.
|
||||
* @param[in] count Size of the services array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmuGetGattServices(u32 connection_handle, BtmGattService *services, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Same as \ref btmuGetGattServices except this only returns the \ref BtmGattService which matches the input \ref BtdrvGattAttributeUuid.
|
||||
* @note This is similar to \ref btmGetGattService.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] uuid \ref BtdrvGattAttributeUuid
|
||||
* @param[out] service \ref BtmGattService
|
||||
* @param[out] flag Whether a \ref BtmGattService was returned.
|
||||
*/
|
||||
Result btmuGetGattService(u32 connection_handle, const BtdrvGattAttributeUuid *uuid, BtmGattService *service, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief Same as \ref btmuGetGattServices except this only returns \ref BtmGattService entries where various checks pass with u16 fields.
|
||||
* @note This is similar to \ref btmGetGattIncludedServices.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] service_handle ServiceHandle
|
||||
* @param[out] services \ref BtmGattService
|
||||
* @param[in] count Size of the services array in entries. The max is 100.
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result btmuGetGattIncludedServices(u32 connection_handle, u16 service_handle, BtmGattService *services, u8 count, u8 *out);
|
||||
|
||||
/**
|
||||
* @brief This is similar to \ref btmuGetGattIncludedServices except this only returns 1 \ref BtmGattService.
|
||||
* @note This is similar to \ref btmGetBelongingService.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] attribute_handle AttributeHandle
|
||||
* @param[out] service \ref BtmGattService
|
||||
* @param[out] flag Whether a \ref BtmGattService was returned.
|
||||
*/
|
||||
Result btmuGetBelongingGattService(u32 connection_handle, u16 attribute_handle, BtmGattService *service, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief GetGattCharacteristics
|
||||
* @note This is similar to \ref btmGetGattCharacteristics.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] service_handle This controls which \ref BtmGattCharacteristic entries to return.
|
||||
* @param[out] characteristics \ref BtmGattCharacteristic
|
||||
* @param[in] count Size of the characteristics array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmuGetGattCharacteristics(u32 connection_handle, u16 service_handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief GetGattDescriptors
|
||||
* @note This is similar to \ref btmGetGattDescriptors.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] char_handle Characteristic handle. This controls which \ref BtmGattDescriptor entries to return.
|
||||
* @param[out] descriptors \ref BtmGattDescriptor
|
||||
* @param[in] count Size of the descriptors array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmuGetGattDescriptors(u32 connection_handle, u16 char_handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleMtuConfigEvent
|
||||
* @note This is similar to \ref btmAcquireBleMtuConfigEvent.
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=true.
|
||||
*/
|
||||
Result btmuAcquireBleMtuConfigEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief ConfigureBleMtu
|
||||
* @note This is similar to \ref btmConfigureBleMtu.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] mtu MTU
|
||||
*/
|
||||
Result btmuConfigureBleMtu(u32 connection_handle, u16 mtu);
|
||||
|
||||
/**
|
||||
* @brief GetBleMtu
|
||||
* @note This is similar to \ref btmGetBleMtu.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[out] out Output MTU.
|
||||
*/
|
||||
Result btmuGetBleMtu(u32 connection_handle, u16 *out);
|
||||
|
||||
/**
|
||||
* @brief RegisterBleGattDataPath
|
||||
* @note This is similar to \ref btmRegisterBleGattDataPath.
|
||||
* @param[in] path \ref BtmBleDataPath
|
||||
*/
|
||||
Result btmuRegisterBleGattDataPath(const BtmBleDataPath *path);
|
||||
|
||||
/**
|
||||
* @brief UnregisterBleGattDataPath
|
||||
* @note This is similar to \ref btmUnregisterBleGattDataPath.
|
||||
* @param[in] path \ref BtmBleDataPath
|
||||
*/
|
||||
Result btmuUnregisterBleGattDataPath(const BtmBleDataPath *path);
|
||||
|
@ -1,24 +0,0 @@
|
||||
/**
|
||||
* @file capmtp.h
|
||||
* @brief capmtp service IPC wrapper.
|
||||
* @note Only available on [11.0.0+].
|
||||
* @author Behemoth
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
Result capmtpInitialize(void* mem, size_t size, u32 app_count, u32 max_img, u32 max_vid, const char *other_name);
|
||||
void capmtpExit(void);
|
||||
|
||||
Service* capmtpGetRootServiceSession(void);
|
||||
Service* capmtpGetServiceSession(void);
|
||||
|
||||
Result capmtpStartCommandHandler(void);
|
||||
Result capmtpStopCommandHandler(void);
|
||||
bool capmtpIsRunning(void);
|
||||
Event *capmtpGetConnectionEvent(void);
|
||||
bool capmtpIsConnected(void);
|
||||
Event *capmtpGetScanErrorEvent(void);
|
||||
Result capmtpGetScanError(void);
|
@ -93,9 +93,7 @@ typedef struct {
|
||||
CapsAlbumFileDateTime datetime; ///< \ref CapsAlbumFileDateTime
|
||||
u8 storage; ///< \ref CapsAlbumStorage
|
||||
u8 content; ///< \ref CapsAlbumFileContents
|
||||
u8 unknown_12; ///< [19.0.0+]
|
||||
u8 unknown_13; ///< [19.0.0+]
|
||||
u8 pad_x14[0x4]; ///< padding
|
||||
u8 pad_x12[0x6]; ///< padding
|
||||
} CapsAlbumFileId;
|
||||
|
||||
/// AlbumEntry
|
||||
|
@ -9,13 +9,6 @@
|
||||
#include "../sf/service.h"
|
||||
#include "../services/caps.h"
|
||||
|
||||
typedef struct {
|
||||
u64 application_id;
|
||||
u8 unknown_08;
|
||||
u8 unknown_09;
|
||||
u8 reserved[6];
|
||||
} CapsApplicationId;
|
||||
|
||||
/// Initialize caps:c
|
||||
Result capscInitialize(void);
|
||||
|
||||
@ -47,7 +40,7 @@ Result capscNotifyAlbumStorageIsUnAvailable(CapsAlbumStorage storage);
|
||||
* @param[in] appletResourceUserId AppletResourceUserId.
|
||||
* @param[in] application_id ApplicationId.
|
||||
*/
|
||||
Result capscRegisterAppletResourceUserId(u64 appletResourceUserId, const CapsApplicationId *application_id);
|
||||
Result capscRegisterAppletResourceUserId(u64 appletResourceUserId, u64 application_id);
|
||||
|
||||
/**
|
||||
* @brief Unregister an applet.
|
||||
@ -56,7 +49,7 @@ Result capscRegisterAppletResourceUserId(u64 appletResourceUserId, const CapsApp
|
||||
* @param[in] appletResourceUserId AppletResourceUserId.
|
||||
* @param[in] application_id ApplicationId.
|
||||
*/
|
||||
Result capscUnregisterAppletResourceUserId(u64 appletResourceUserId, const CapsApplicationId *application_id);
|
||||
Result capscUnregisterAppletResourceUserId(u64 appletResourceUserId, u64 application_id);
|
||||
|
||||
/**
|
||||
* @brief Get an ApplicationId that corresponds to an AppletResourceUserId.
|
||||
@ -65,7 +58,7 @@ Result capscUnregisterAppletResourceUserId(u64 appletResourceUserId, const CapsA
|
||||
* @param[out] application_id ApplicationId.
|
||||
* @param[in] appletResourceUserId AppletResourceUserId.
|
||||
*/
|
||||
Result capscGetApplicationIdFromAruid(CapsApplicationId *application_id, u64 aruid);
|
||||
Result capscGetApplicationIdFromAruid(u64 *application_id, u64 aruid);
|
||||
|
||||
/**
|
||||
* @brief Checks whether an ApplicationId is registered.
|
||||
@ -81,7 +74,7 @@ Result capscCheckApplicationIdRegistered(u64 application_id);
|
||||
* @param[in] contents \ref CapsAlbumFileContents
|
||||
* @param[out] file_id \ref CapsAlbumFileId
|
||||
*/
|
||||
Result capscGenerateCurrentAlbumFileId(const CapsApplicationId *application_id, CapsAlbumFileContents contents, CapsAlbumFileId *file_id);
|
||||
Result capscGenerateCurrentAlbumFileId(u64 application_id, CapsAlbumFileContents contents, CapsAlbumFileId *file_id);
|
||||
|
||||
/**
|
||||
* @brief Generate an ApplicationAlbumEntry based on parameters.
|
||||
|
@ -30,34 +30,3 @@ Service* capsdcGetServiceSession(void);
|
||||
* @param[in] out_image_size Output image buffer size, should be at least large enough for RGBA8 width x height.
|
||||
*/
|
||||
Result capsdcDecodeJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void* jpeg, size_t jpeg_size, void* out_image, size_t out_image_size);
|
||||
|
||||
/**
|
||||
* @brief Shrinks a jpeg's dimensions by 2.
|
||||
* @note Tries to compress with jpeg quality in this order: 98, 95, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0.
|
||||
* @note Only available on [17.0.0+].
|
||||
* @param[in] width Input image width.
|
||||
* @param[in] height Input image width.
|
||||
* @param[in] opts \ref CapsScreenShotDecodeOption.
|
||||
* @param[in] jpeg Jpeg image input buffer.
|
||||
* @param[in] jpeg_size Input image buffer size.
|
||||
* @param[out] out_jpeg Jpeg image output buffer
|
||||
* @param[in] out_jpeg_size Output image buffer size.
|
||||
* @param[out] out_result_size size of the resulting JPEG.
|
||||
*/
|
||||
Result capsdcShrinkJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void* jpeg, size_t jpeg_size, void* out_jpeg, size_t out_jpeg_size, u64 *out_result_size);
|
||||
|
||||
/**
|
||||
* @brief Shrinks a jpeg.
|
||||
* @note Fails if the scaled size is larger than the original or the output buffer isn't large enough.
|
||||
* @note Only available on [19.0.0+].
|
||||
* @param[in] scaled_width Wanted image width.
|
||||
* @param[in] scaled_height Wanted image width.
|
||||
* @param[in] jpeg_quality has to be in range 0-100.
|
||||
* @param[in] opts \ref CapsScreenShotDecodeOption.
|
||||
* @param[in] jpeg Jpeg image input buffer.
|
||||
* @param[in] jpeg_size Input image buffer size.
|
||||
* @param[out] out_jpeg Jpeg image output buffer
|
||||
* @param[in] out_jpeg_size Output image buffer size.
|
||||
* @param[out] out_result_size size of the resulting jpeg.
|
||||
*/
|
||||
Result capsdcShrinkJpegEx(u32 scaled_width, u32 scaled_height, u32 jpeg_quality, const CapsScreenShotDecodeOption *opts, const void* jpeg, size_t jpeg_size, void* out_jpeg, size_t out_jpeg_size, u64 *out_result_size);
|
||||
|
@ -27,4 +27,3 @@ Result clkrstOpenSession(ClkrstSession* session_out, PcvModuleId module_id, u32
|
||||
void clkrstCloseSession(ClkrstSession* session);
|
||||
Result clkrstSetClockRate(ClkrstSession* session, u32 hz);
|
||||
Result clkrstGetClockRate(ClkrstSession* session, u32 *out_hz);
|
||||
Result clkrstGetPossibleClockRates(ClkrstSession *session, u32 *rates, s32 max_count, PcvClockRatesListType *out_type, s32 *out_count);
|
||||
|
@ -1,32 +0,0 @@
|
||||
/**
|
||||
* @file ectx.h
|
||||
* @brief [11.0.0+] Error Context services IPC wrapper.
|
||||
* @author SciresM
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
/// Initialize ectx:r.
|
||||
Result ectxrInitialize(void);
|
||||
|
||||
/// Exit ectx:r.
|
||||
void ectxrExit(void);
|
||||
|
||||
/// Gets the Service object for the actual ectx:r service session.
|
||||
Service* ectxrGetServiceSession(void);
|
||||
|
||||
/**
|
||||
* @brief Retrieves the error context associated with an error descriptor and result.
|
||||
* @param[out] out0 Output value.
|
||||
* @param[out] out_total_size Total error context size.
|
||||
* @param[out] out_size Error context size.
|
||||
* @param[out] dst Buffer for output error context.
|
||||
* @param[in] dst_size Buffer size for output error context.
|
||||
* @param[in] descriptor Error descriptor.
|
||||
* @param[in] result Error result.
|
||||
* @return Result code.
|
||||
*/
|
||||
Result ectxrPullContext(s32 *out0, u32 *out_total_size, u32 *out_size, void *dst, size_t dst_size, u32 descriptor, Result result);
|
@ -79,7 +79,7 @@ typedef struct {
|
||||
* @note This function does not return.
|
||||
* @note This uses \ref fatalThrowWithPolicy with \ref FatalPolicy_ErrorScreen internally.
|
||||
*/
|
||||
void NX_NORETURN fatalThrow(Result err);
|
||||
void NORETURN fatalThrow(Result err);
|
||||
|
||||
/**
|
||||
* @brief Triggers a system fatal error with a custom \ref FatalPolicy.
|
||||
|
@ -11,14 +11,6 @@
|
||||
#include "../services/acc.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
typedef enum {
|
||||
FriendsServiceType_User = 0, ///< Initializes friend:u
|
||||
FriendsServiceType_Viewer = 1, ///< Initializes friend:v
|
||||
FriendsServiceType_Manager = 2, ///< Initializes friend:m
|
||||
FriendsServiceType_System = 3, ///< Initializes friend:s
|
||||
FriendsServiceType_Administrator = 4, ///< Initializes friend:a
|
||||
} FriendsServiceType;
|
||||
|
||||
/// InAppScreenName
|
||||
typedef struct {
|
||||
char name[0x40]; ///< UTF-8 string, NUL-terminated.
|
||||
@ -40,36 +32,6 @@ typedef struct {
|
||||
u64 id; ///< Id.
|
||||
} FriendsFriendInvitationGroupId;
|
||||
|
||||
/// FriendsUserSetting
|
||||
typedef struct {
|
||||
AccountUid uid; ///< User ID
|
||||
u32 presence_permission; ///< Presence permission
|
||||
u32 play_log_permission; ///< Play log permission
|
||||
u64 friend_request_reception; ///< Unknown
|
||||
char friend_code[0x20]; ///< Friend Code
|
||||
u64 friend_code_next_issuable_time; ///< Unknown
|
||||
u8 unk_x48[0x7C8]; ///< Unknown
|
||||
} FriendsUserSetting;
|
||||
|
||||
/// Initialize friends
|
||||
Result friendsInitialize(FriendsServiceType service_type);
|
||||
|
||||
/// Exit friends
|
||||
void friendsExit(void);
|
||||
|
||||
/// Gets the Service object for the friends service session.
|
||||
Service* friendsGetServiceSession(void);
|
||||
|
||||
/// Gets the Service object for the actual IFriendsService service session.
|
||||
Service* friendsGetServiceSession_IFriendsService(void);
|
||||
|
||||
/**
|
||||
* @brief Gets the \ref FriendsUserSetting details
|
||||
* @param[in] uid \ref User AccountUid.
|
||||
* @param[out] user_setting \ref FriendsUserSetting
|
||||
*/
|
||||
Result friendsGetUserSetting(AccountUid uid, FriendsUserSetting *user_setting);
|
||||
|
||||
/**
|
||||
* @brief Gets an Event which is signaled when data is available with \ref friendsTryPopFriendInvitationNotificationInfo.
|
||||
* @note This is a wrapper for \ref appletGetFriendInvitationStorageChannelEvent, see that for the usage requirements.
|
||||
@ -89,3 +51,4 @@ NX_INLINE Result friendsGetFriendInvitationNotificationEvent(Event *out_event) {
|
||||
* @param[out] out_size Size of the data which was written into the output buffer. Optional, can be NULL.
|
||||
*/
|
||||
Result friendsTryPopFriendInvitationNotificationInfo(AccountUid *uid, void* buffer, u64 size, u64 *out_size);
|
||||
|
||||
|
@ -88,13 +88,6 @@ typedef struct {
|
||||
u8 unused[0x190]; ///< Uninitialized.
|
||||
} FsSaveDataExtraData;
|
||||
|
||||
/// SaveDataMetaInfo
|
||||
typedef struct {
|
||||
u32 size;
|
||||
u8 type; ///< \ref FsSaveDataMetaType
|
||||
u8 reserved[0x0B];
|
||||
} FsSaveDataMetaInfo;
|
||||
|
||||
/// SaveDataCreationInfo
|
||||
typedef struct {
|
||||
s64 save_data_size; ///< Size of the save data.
|
||||
@ -122,18 +115,6 @@ typedef struct {
|
||||
u8 unk_x3b[0x25]; ///< Unknown. Usually zeros?
|
||||
} FsSaveDataInfo;
|
||||
|
||||
/// SaveDataFilter
|
||||
typedef struct {
|
||||
bool filter_by_application_id; ///< Filter by \ref FsSaveDataAttribute::application_id
|
||||
bool filter_by_save_data_type; ///< Filter by \ref FsSaveDataAttribute::save_data_type
|
||||
bool filter_by_user_id; ///< Filter by \ref FsSaveDataAttribute::uid
|
||||
bool filter_by_system_save_data_id; ///< Filter by \ref FsSaveDataAttribute::system_save_data_id
|
||||
bool filter_by_index; ///< Filter by \ref FsSaveDataAttribute::save_data_index
|
||||
u8 save_data_rank; ///< \ref FsSaveDataRank
|
||||
u8 padding[0x2]; ///< Padding
|
||||
FsSaveDataAttribute attr; ///< \ref FsSaveDataAttribute
|
||||
} FsSaveDataFilter;
|
||||
|
||||
typedef struct {
|
||||
u64 created; ///< POSIX timestamp.
|
||||
u64 modified; ///< POSIX timestamp.
|
||||
@ -184,10 +165,9 @@ typedef enum {
|
||||
} FsWriteOption;
|
||||
|
||||
typedef enum {
|
||||
FsContentStorageId_System = 0, ///< System
|
||||
FsContentStorageId_User = 1, ///< User
|
||||
FsContentStorageId_SdCard = 2, ///< SdCard
|
||||
FsContentStorageId_System0 = 3, ///< [16.0.0+] System0
|
||||
FsContentStorageId_System = 0,
|
||||
FsContentStorageId_User = 1,
|
||||
FsContentStorageId_SdCard = 2,
|
||||
} FsContentStorageId;
|
||||
|
||||
typedef enum {
|
||||
@ -239,13 +219,6 @@ typedef enum {
|
||||
FsSaveDataFlags_NeedsSecureDelete = BIT(3),
|
||||
} FsSaveDataFlags;
|
||||
|
||||
/// SaveDataMetaType
|
||||
typedef enum {
|
||||
FsSaveDataMetaType_None = 0,
|
||||
FsSaveDataMetaType_Thumbnail = 1,
|
||||
FsSaveDataMetaType_ExtensionContext = 2,
|
||||
} FsSaveDataMetaType;
|
||||
|
||||
typedef enum {
|
||||
FsGameCardAttribute_AutoBootFlag = BIT(0), ///< Causes the cartridge to automatically start on bootup
|
||||
FsGameCardAttribute_HistoryEraseFlag = BIT(1), ///< Causes NS to throw an error on attempt to load the cartridge
|
||||
@ -265,12 +238,6 @@ typedef struct {
|
||||
u32 value;
|
||||
} FsGameCardHandle;
|
||||
|
||||
typedef struct {
|
||||
u32 version;
|
||||
u8 pad[0x4];
|
||||
u64 id;
|
||||
} FsGameCardUpdatePartitionInfo;
|
||||
|
||||
typedef struct {
|
||||
u32 aes_ctr_key_type; ///< Contains bitflags describing how data is AES encrypted.
|
||||
u32 speed_emulation_type; ///< Contains bitflags describing how data is emulated.
|
||||
@ -305,8 +272,6 @@ typedef enum {
|
||||
FsBisPartitionId_SystemProperEncryption = 32,
|
||||
FsBisPartitionId_SystemProperPartition = 33,
|
||||
FsBisPartitionId_SignedSystemPartitionOnSafeMode = 34,
|
||||
FsBisPartitionId_DeviceTreeBlob = 35,
|
||||
FsBisPartitionId_System0 = 36,
|
||||
} FsBisPartitionId;
|
||||
|
||||
/// FileSystemType
|
||||
@ -326,38 +291,6 @@ typedef enum {
|
||||
FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard = 2, ///< [8.0.0+]
|
||||
} FsFileSystemQueryId;
|
||||
|
||||
/// FileSystemAttribute
|
||||
typedef struct {
|
||||
bool directory_name_length_max_has_value;
|
||||
bool file_name_length_max_has_value;
|
||||
bool directory_path_length_max_has_value;
|
||||
bool file_path_length_max_has_value;
|
||||
bool utf16_create_directory_path_length_max_has_value;
|
||||
bool utf16_delete_directory_path_length_max_has_value;
|
||||
bool utf16_rename_source_directory_path_length_max_has_value;
|
||||
bool utf16_rename_destination_directory_path_length_max_has_value;
|
||||
bool utf16_open_directory_path_length_max_has_value;
|
||||
bool utf16_directory_name_length_max_has_value;
|
||||
bool utf16_file_name_length_max_has_value;
|
||||
bool utf16_directory_path_length_max_has_value;
|
||||
bool utf16_file_path_length_max_has_value;
|
||||
u8 reserved1[0x1B];
|
||||
s32 directory_name_length_max;
|
||||
s32 file_name_length_max;
|
||||
s32 directory_path_length_max;
|
||||
s32 file_path_length_max;
|
||||
s32 utf16_create_directory_path_length_max;
|
||||
s32 utf16_delete_directory_path_length_max;
|
||||
s32 utf16_rename_source_directory_path_length_max;
|
||||
s32 utf16_rename_destination_directory_path_length_max;
|
||||
s32 utf16_open_directory_path_length_max;
|
||||
s32 utf16_directory_name_length_max;
|
||||
s32 utf16_file_name_length_max;
|
||||
s32 utf16_directory_path_length_max;
|
||||
s32 utf16_file_path_length_max;
|
||||
u8 reserved2[0x64];
|
||||
} FsFileSystemAttribute;
|
||||
|
||||
/// FsPriority
|
||||
typedef enum {
|
||||
FsPriority_Normal = 0,
|
||||
@ -366,120 +299,6 @@ typedef enum {
|
||||
FsPriority_Background = 3,
|
||||
} FsPriority;
|
||||
|
||||
/// FsContentAttributes
|
||||
typedef enum {
|
||||
FsContentAttributes_None = 0x0,
|
||||
FsContentAttributes_All = 0xF,
|
||||
} FsContentAttributes;
|
||||
|
||||
/// For use with fsOpenHostFileSystemWithOption
|
||||
typedef enum {
|
||||
FsMountHostOptionFlag_None = 0, ///< Host filesystem will be case insensitive.
|
||||
FsMountHostOptionFlag_PseudoCaseSensitive = BIT(0), ///< Host filesystem will be pseudo case sensitive.
|
||||
} FsMountHostOption;
|
||||
|
||||
/// FsStorageErrorInfo
|
||||
typedef struct {
|
||||
u32 num_activation_failures;
|
||||
u32 num_activation_error_corrections;
|
||||
u32 num_read_write_failures;
|
||||
u32 num_read_write_error_corrections;
|
||||
} FsStorageErrorInfo;
|
||||
|
||||
/// FatFatError
|
||||
typedef struct {
|
||||
s32 error;
|
||||
s32 extra_error;
|
||||
s32 drive_id;
|
||||
char name[16];
|
||||
u8 reserved[4];
|
||||
} FatFatError;
|
||||
|
||||
/// FatFatReportInfo1
|
||||
typedef struct {
|
||||
u16 open_file_peak_count;
|
||||
u16 open_directory_peak_count;
|
||||
} FatFatReportInfo1;
|
||||
|
||||
/// FatFatReportInfo2
|
||||
typedef struct {
|
||||
u16 open_unique_file_entry_peak_count;
|
||||
u16 open_unique_directory_entry_peak_count;
|
||||
} FatFatReportInfo2;
|
||||
|
||||
/// FatFatSafeInfo
|
||||
typedef struct {
|
||||
u32 result;
|
||||
u32 error_number;
|
||||
u32 safe_error_number;
|
||||
} FatFatSafeInfo;
|
||||
|
||||
/// FsFileSystemProxyErrorInfo
|
||||
typedef struct {
|
||||
u32 rom_fs_remount_for_data_corruption_count;
|
||||
u32 rom_fs_unrecoverable_data_corruption_by_remount_count;
|
||||
FatFatError fat_fs_error;
|
||||
u32 rom_fs_recovered_by_invalidate_cache_count;
|
||||
u32 save_data_index_count;
|
||||
FatFatReportInfo1 bis_system_fat_report_info_1;
|
||||
FatFatReportInfo1 bis_user_fat_report_info_1;
|
||||
FatFatReportInfo1 sd_card_fat_report_info_1;
|
||||
FatFatReportInfo2 bis_system_fat_report_info_2;
|
||||
FatFatReportInfo2 bis_user_fat_report_info_2;
|
||||
FatFatReportInfo2 sd_card_fat_report_info_2;
|
||||
u32 rom_fs_deep_retry_start_count;
|
||||
u32 rom_fs_unrecoverable_by_game_card_access_failed_count;
|
||||
FatFatSafeInfo bis_system_fat_safe_info;
|
||||
FatFatSafeInfo bis_user_fat_safe_info;
|
||||
|
||||
u8 reserved[0x18];
|
||||
} FsFileSystemProxyErrorInfo;
|
||||
|
||||
/// FsMemoryReportInfo
|
||||
typedef struct {
|
||||
u64 pooled_buffer_peak_free_size;
|
||||
u64 pooled_buffer_retried_count;
|
||||
u64 pooled_buffer_reduce_allocation_count;
|
||||
u64 buffer_manager_peak_free_size;
|
||||
u64 buffer_manager_retried_count;
|
||||
u64 exp_heap_peak_free_size;
|
||||
u64 buffer_pool_peak_free_size;
|
||||
u64 patrol_read_allocate_buffer_success_count;
|
||||
u64 patrol_read_allocate_buffer_failure_count;
|
||||
u64 buffer_manager_peak_total_allocatable_size;
|
||||
u64 buffer_pool_max_allocate_size;
|
||||
u64 pooled_buffer_failed_ideal_allocation_count_on_async_access;
|
||||
|
||||
u8 reserved[0x20];
|
||||
} FsMemoryReportInfo;
|
||||
|
||||
/// FsGameCardErrorReportInfo
|
||||
typedef struct {
|
||||
u16 game_card_crc_error_num;
|
||||
u16 reserved1;
|
||||
u16 asic_crc_error_num;
|
||||
u16 reserved2;
|
||||
u16 refresh_num;
|
||||
u16 reserved3;
|
||||
u16 retry_limit_out_num;
|
||||
u16 timeout_retry_num;
|
||||
u16 asic_reinitialize_failure_detail;
|
||||
u16 insertion_count;
|
||||
u16 removal_count;
|
||||
u16 asic_reinitialize_num;
|
||||
u32 initialize_count;
|
||||
u16 asic_reinitialize_failure_num;
|
||||
u16 awaken_failure_num;
|
||||
u16 reserved4;
|
||||
u16 refresh_succeeded_count;
|
||||
u32 last_read_error_page_address;
|
||||
u32 last_read_error_page_count;
|
||||
u32 awaken_count;
|
||||
u32 read_count_from_insert;
|
||||
u32 read_count_from_awaken;
|
||||
u8 reserved5[8];
|
||||
} FsGameCardErrorReportInfo;
|
||||
|
||||
/// Initialize fsp-srv. Used automatically during app startup.
|
||||
Result fsInitialize(void);
|
||||
|
||||
@ -494,24 +313,17 @@ void fsSetPriority(FsPriority prio);
|
||||
|
||||
/// Mount requested filesystem type from content file
|
||||
Result fsOpenFileSystem(FsFileSystem* out, FsFileSystemType fsType, const char* contentPath); ///< same as calling fsOpenFileSystemWithId with 0 as id
|
||||
Result fsOpenDataFileSystemByCurrentProcess(FsFileSystem *out);
|
||||
Result fsOpenFileSystemWithPatch(FsFileSystem* out, u64 id, FsFileSystemType fsType); ///< [2.0.0+], like OpenFileSystemWithId but without content path.
|
||||
Result fsOpenFileSystemWithId(FsFileSystem* out, u64 id, FsFileSystemType fsType, const char* contentPath, FsContentAttributes attr); ///< works on all firmwares, id is ignored on [1.0.0], attr is ignored before [16.0.0]
|
||||
Result fsOpenDataFileSystemByProgramId(FsFileSystem *out, u64 program_id); ///< [3.0.0+]
|
||||
Result fsOpenFileSystemWithId(FsFileSystem* out, u64 id, FsFileSystemType fsType, const char* contentPath); ///< works on all firmwares, id is ignored on [1.0.0]
|
||||
|
||||
Result fsOpenBisFileSystem(FsFileSystem* out, FsBisPartitionId partitionId, const char* string);
|
||||
Result fsOpenBisStorage(FsStorage* out, FsBisPartitionId partitionId);
|
||||
|
||||
/// Do not call this directly, see fs_dev.h.
|
||||
Result fsOpenSdCardFileSystem(FsFileSystem* out);
|
||||
|
||||
Result fsOpenHostFileSystem(FsFileSystem* out, const char *path);
|
||||
Result fsOpenHostFileSystemWithOption(FsFileSystem* out, const char *path, u32 flags); ///< [9.0.0+]
|
||||
|
||||
Result fsDeleteSaveDataFileSystem(u64 application_id);
|
||||
Result fsCreateSaveDataFileSystem(const FsSaveDataAttribute* attr, const FsSaveDataCreationInfo* creation_info, const FsSaveDataMetaInfo* meta);
|
||||
Result fsCreateSaveDataFileSystemBySystemSaveDataId(const FsSaveDataAttribute* attr, const FsSaveDataCreationInfo* creation_info);
|
||||
Result fsDeleteSaveDataFileSystemBySaveDataSpaceId(FsSaveDataSpaceId save_data_space_id, u64 saveID); ///< [2.0.0+]
|
||||
Result fsDeleteSaveDataFileSystemBySaveDataAttribute(FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute* attr); ///< [4.0.0+]
|
||||
|
||||
Result fsIsExFatSupported(bool* out);
|
||||
|
||||
@ -529,47 +341,28 @@ Result fsWriteSaveDataFileSystemExtraData(const void* buf, size_t len, FsSaveDat
|
||||
|
||||
Result fsOpenSaveDataInfoReader(FsSaveDataInfoReader* out, FsSaveDataSpaceId save_data_space_id);
|
||||
|
||||
Result fsOpenSaveDataInfoReaderWithFilter(FsSaveDataInfoReader* out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataFilter *save_data_filter); ///< [6.0.0+]
|
||||
|
||||
Result fsOpenImageDirectoryFileSystem(FsFileSystem* out, FsImageDirectoryId image_directory_id);
|
||||
Result fsOpenContentStorageFileSystem(FsFileSystem* out, FsContentStorageId content_storage_id);
|
||||
Result fsOpenCustomStorageFileSystem(FsFileSystem* out, FsCustomStorageId custom_storage_id); ///< [7.0.0+]
|
||||
|
||||
Result fsOpenDataStorageByCurrentProcess(FsStorage* out);
|
||||
Result fsOpenDataStorageByProgramId(FsStorage *out, u64 program_id); /// <[3.0.0+]
|
||||
Result fsOpenDataStorageByDataId(FsStorage* out, u64 dataId, NcmStorageId storageId);
|
||||
Result fsOpenPatchDataStorageByCurrentProcess(FsStorage* out);
|
||||
|
||||
Result fsOpenDeviceOperator(FsDeviceOperator* out);
|
||||
Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out);
|
||||
|
||||
Result fsIsSignedSystemPartitionOnSdCardValid(bool *out);
|
||||
|
||||
Result fsGetProgramId(u64* out, const char *path, FsContentAttributes attr); ///< [17.0.0+]
|
||||
|
||||
/// Retrieves the rights id corresponding to the content path. Only available on [2.0.0-15.0.1].
|
||||
/// Retrieves the rights id corresponding to the content path. Only available on [2.0.0+].
|
||||
Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id);
|
||||
|
||||
/// Retrieves the rights id and key generation corresponding to the content path. Only available on [3.0.0+], attr is ignored before [16.0.0].
|
||||
Result fsGetRightsIdAndKeyGenerationByPath(const char* path, FsContentAttributes attr, u8* out_key_generation, FsRightsId* out_rights_id);
|
||||
|
||||
Result fsGetContentStorageInfoIndex(s32 *out); ///< [19.0.0+]
|
||||
/// Retrieves the rights id and key generation corresponding to the content path. Only available on [3.0.0+].
|
||||
Result fsGetRightsIdAndKeyGenerationByPath(const char* path, u8* out_key_generation, FsRightsId* out_rights_id);
|
||||
|
||||
Result fsDisableAutoSaveDataCreation(void);
|
||||
|
||||
Result fsSetGlobalAccessLogMode(u32 mode);
|
||||
Result fsGetGlobalAccessLogMode(u32* out_mode);
|
||||
Result fsOutputAccessLogToSdCard(const char *log, size_t size);
|
||||
|
||||
Result fsGetAndClearErrorInfo(FsFileSystemProxyErrorInfo *out); ///< [2.0.0+]
|
||||
|
||||
Result fsGetAndClearMemoryReportInfo(FsMemoryReportInfo* out); ///< [4.0.0+]
|
||||
|
||||
/// Only available on [7.0.0+].
|
||||
Result fsGetProgramIndexForAccessLog(u32 *out_program_index, u32 *out_program_count);
|
||||
|
||||
// Wrapper(s) for fsCreateSaveDataFileSystem.
|
||||
Result fsCreate_TemporaryStorage(u64 application_id, u64 owner_id, s64 size, u32 flags);
|
||||
|
||||
// Wrapper(s) for fsCreateSaveDataFileSystemBySystemSaveDataId.
|
||||
Result fsCreate_SystemSaveDataWithOwner(FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid, u64 owner_id, s64 size, s64 journal_size, u32 flags);
|
||||
@ -625,7 +418,6 @@ Result fsFsGetTotalSpace(FsFileSystem* fs, const char* path, s64* out);
|
||||
Result fsFsGetFileTimeStampRaw(FsFileSystem* fs, const char* path, FsTimeStampRaw *out); ///< [3.0.0+]
|
||||
Result fsFsCleanDirectoryRecursively(FsFileSystem* fs, const char* path); ///< [3.0.0+]
|
||||
Result fsFsQueryEntry(FsFileSystem* fs, void *out, size_t out_size, const void *in, size_t in_size, const char* path, FsFileSystemQueryId query_id); ///< [4.0.0+]
|
||||
Result fsFsGetFileSystemAttribute(FsFileSystem* fs, FsFileSystemAttribute *out); ///< [15.0.0+]
|
||||
void fsFsClose(FsFileSystem* fs);
|
||||
|
||||
/// Uses \ref fsFsQueryEntry to set the archive bit on the specified absolute directory path.
|
||||
@ -671,23 +463,7 @@ void fsEventNotifierClose(FsEventNotifier* e);
|
||||
|
||||
// IDeviceOperator
|
||||
Result fsDeviceOperatorIsSdCardInserted(FsDeviceOperator* d, bool* out);
|
||||
Result fsDeviceOperatorGetSdCardSpeedMode(FsDeviceOperator* d, s64* out);
|
||||
Result fsDeviceOperatorGetSdCardCid(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
||||
Result fsDeviceOperatorGetSdCardUserAreaSize(FsDeviceOperator* d, s64* out);
|
||||
Result fsDeviceOperatorGetSdCardProtectedAreaSize(FsDeviceOperator* d, s64* out);
|
||||
Result fsDeviceOperatorGetAndClearSdCardErrorInfo(FsDeviceOperator* d, FsStorageErrorInfo* out, s64 *out_log_size, void *dst, size_t dst_size, s64 size);
|
||||
Result fsDeviceOperatorGetMmcCid(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
||||
Result fsDeviceOperatorGetMmcSpeedMode(FsDeviceOperator* d, s64* out);
|
||||
Result fsDeviceOperatorGetMmcPatrolCount(FsDeviceOperator* d, u32* out);
|
||||
Result fsDeviceOperatorGetAndClearMmcErrorInfo(FsDeviceOperator* d, FsStorageErrorInfo* out, s64 *out_log_size, void *dst, size_t dst_size, s64 size);
|
||||
Result fsDeviceOperatorGetMmcExtendedCsd(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
||||
Result fsDeviceOperatorIsGameCardInserted(FsDeviceOperator* d, bool* out);
|
||||
Result fsDeviceOperatorGetGameCardHandle(FsDeviceOperator* d, FsGameCardHandle* out);
|
||||
Result fsDeviceOperatorGetGameCardUpdatePartitionInfo(FsDeviceOperator* d, const FsGameCardHandle* handle, FsGameCardUpdatePartitionInfo* out);
|
||||
Result fsDeviceOperatorGetGameCardAttribute(FsDeviceOperator* d, const FsGameCardHandle* handle, u8 *out);
|
||||
Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator* d, const FsGameCardHandle* handle, void* dst, size_t dst_size, s64* out_size, s64 size);
|
||||
Result fsDeviceOperatorGetGameCardIdSet(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
||||
Result fsDeviceOperatorGetGameCardErrorReportInfo(FsDeviceOperator* d, FsGameCardErrorReportInfo* out);
|
||||
Result fsDeviceOperatorGetGameCardDeviceId(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
||||
Result fsDeviceOperatorChallengeCardExistence(FsDeviceOperator* d, const FsGameCardHandle* handle, void* dst, size_t dst_size, void* seed, size_t seed_size, void* value, size_t value_size);
|
||||
void fsDeviceOperatorClose(FsDeviceOperator* d);
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "../sf/service.h"
|
||||
#include "../services/fs.h"
|
||||
#include "../crypto/sha256.h"
|
||||
#include "../services/ncm_types.h"
|
||||
|
||||
typedef struct {
|
||||
u8 signature[0x100];
|
||||
@ -27,5 +26,5 @@ void fsldrExit(void);
|
||||
/// Gets the Service object for the actual fsp-ldr service session.
|
||||
Service* fsldrGetServiceSession(void);
|
||||
|
||||
Result fsldrOpenCodeFileSystem(FsCodeInfo* out_code_info, u64 tid, NcmStorageId storage_id, const char *path, FsContentAttributes attr, FsFileSystem* out);
|
||||
Result fsldrOpenCodeFileSystem(FsCodeInfo* out_code_info, u64 tid, const char *path, FsFileSystem* out);
|
||||
Result fsldrIsArchivedProgram(u64 pid, bool *out);
|
||||
|
@ -18,7 +18,7 @@ void fsprExit(void);
|
||||
/// Gets the Service object for the actual fsp-pr service session.
|
||||
Service* fsprGetServiceSession(void);
|
||||
|
||||
Result fsprRegisterProgram(u64 pid, u64 tid, NcmStorageId sid, const void *fs_access_header, size_t fah_size, const void *fs_access_control, size_t fac_size, u8 fs_access_control_restriction_mode);
|
||||
Result fsprRegisterProgram(u64 pid, u64 tid, NcmStorageId sid, const void *fs_access_header, size_t fah_size, const void *fs_access_control, size_t fac_size);
|
||||
Result fsprUnregisterProgram(u64 pid);
|
||||
Result fsprSetCurrentProcess(void);
|
||||
Result fsprSetEnabledProgramVerification(bool enabled);
|
||||
|
@ -6,14 +6,12 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
typedef enum {
|
||||
GpioPadName_AudioCodec = 1,
|
||||
GpioPadName_ButtonVolUp = 25,
|
||||
GpioPadName_AudioCodec = 1,
|
||||
GpioPadName_ButtonVolUp = 25,
|
||||
GpioPadName_ButtonVolDown = 26,
|
||||
GpioPadName_SdCd = 56,
|
||||
} GpioPadName;
|
||||
|
||||
typedef struct {
|
||||
@ -21,28 +19,15 @@ typedef struct {
|
||||
} GpioPadSession;
|
||||
|
||||
typedef enum {
|
||||
GpioDirection_Input = 0,
|
||||
GpioDirection_Input = 0,
|
||||
GpioDirection_Output = 1,
|
||||
} GpioDirection;
|
||||
|
||||
typedef enum {
|
||||
GpioValue_Low = 0,
|
||||
GpioValue_Low = 0,
|
||||
GpioValue_High = 1,
|
||||
} GpioValue;
|
||||
|
||||
typedef enum {
|
||||
GpioInterruptMode_LowLevel = 0,
|
||||
GpioInterruptMode_HighLevel = 1,
|
||||
GpioInterruptMode_RisingEdge = 2,
|
||||
GpioInterruptMode_FallingEdge = 3,
|
||||
GpioInterruptMode_AnyEdge = 4,
|
||||
} GpioInterruptMode;
|
||||
|
||||
typedef enum {
|
||||
GpioInterruptStatus_Inactive = 0,
|
||||
GpioInterruptStatus_Active = 1,
|
||||
} GpioInterruptStatus;
|
||||
|
||||
/// Initialize gpio.
|
||||
Result gpioInitialize(void);
|
||||
|
||||
@ -53,25 +38,9 @@ void gpioExit(void);
|
||||
Service* gpioGetServiceSession(void);
|
||||
|
||||
Result gpioOpenSession(GpioPadSession *out, GpioPadName name);
|
||||
Result gpioOpenSession2(GpioPadSession *out, u32 device_code, u32 access_mode);
|
||||
|
||||
Result gpioIsWakeEventActive(bool *out, GpioPadName name);
|
||||
Result gpioIsWakeEventActive2(bool *out, u32 device_code);
|
||||
|
||||
Result gpioPadSetDirection(GpioPadSession *p, GpioDirection dir);
|
||||
Result gpioPadGetDirection(GpioPadSession *p, GpioDirection *out);
|
||||
Result gpioPadSetInterruptMode(GpioPadSession *p, GpioInterruptMode mode);
|
||||
Result gpioPadGetInterruptMode(GpioPadSession *p, GpioInterruptMode *out);
|
||||
Result gpioPadSetInterruptEnable(GpioPadSession *p, bool en);
|
||||
Result gpioPadGetInterruptEnable(GpioPadSession *p, bool *out);
|
||||
Result gpioPadGetInterruptStatus(GpioPadSession *p, GpioInterruptStatus *out); ///< [1.0.0-16.1.0]
|
||||
Result gpioPadClearInterruptStatus(GpioPadSession *p); ///< [1.0.0-16.1.0]
|
||||
Result gpioPadSetValue(GpioPadSession *p, GpioValue val);
|
||||
Result gpioPadGetValue(GpioPadSession *p, GpioValue *out);
|
||||
Result gpioPadBindInterrupt(GpioPadSession *p, Event *out);
|
||||
Result gpioPadUnbindInterrupt(GpioPadSession *p);
|
||||
Result gpioPadSetDebounceEnabled(GpioPadSession *p, bool en);
|
||||
Result gpioPadGetDebounceEnabled(GpioPadSession *p, bool *out);
|
||||
Result gpioPadSetDebounceTime(GpioPadSession *p, s32 ms);
|
||||
Result gpioPadGetDebounceTime(GpioPadSession *p, s32 *out);
|
||||
void gpioPadClose(GpioPadSession *p);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,16 +12,16 @@
|
||||
|
||||
/// BusType
|
||||
typedef enum {
|
||||
HidbusBusType_LeftJoyRail = 0, ///< LeftJoyRail
|
||||
HidbusBusType_RightJoyRail = 1, ///< RightJoyRail
|
||||
HidbusBusType_RightLarkRail = 2, ///< [6.0.0+] RightLarkRail (for microphone).
|
||||
HidbusBusType_JoyLeftRail = 0, ///< JoyLeftRail
|
||||
HidbusBusType_JoyRightRail = 1, ///< JoyRightRail
|
||||
HidbusBusType_LarkRightRail = 2, ///< [6.0.0+] LarkRightRail (for microphone).
|
||||
} HidbusBusType;
|
||||
|
||||
/// JoyPollingMode
|
||||
typedef enum {
|
||||
HidbusJoyPollingMode_SixAxisSensorDisable = 0, ///< SixAxisSensorDisable
|
||||
HidbusJoyPollingMode_SixAxisSensorEnable = 1, ///< JoyEnableSixAxisPollingData
|
||||
HidbusJoyPollingMode_ButtonOnly = 2, ///< [6.0.0+] ButtonOnly
|
||||
HidbusJoyPollingMode_JoyDisableSixAxisPollingData = 0, ///< JoyDisableSixAxisPollingData
|
||||
HidbusJoyPollingMode_JoyEnableSixAxisPollingData = 1, ///< JoyEnableSixAxisPollingData
|
||||
HidbusJoyPollingMode_JoyButtonOnlyPollingData = 2, ///< [6.0.0+] JoyButtonOnlyPollingData
|
||||
} HidbusJoyPollingMode;
|
||||
|
||||
/// BusHandle
|
||||
@ -36,8 +36,8 @@ typedef struct {
|
||||
/// JoyPollingReceivedData
|
||||
typedef struct {
|
||||
u8 data[0x30]; ///< Data.
|
||||
u64 out_size; ///< Size of data.
|
||||
u64 sampling_number; ///< SamplingNumber
|
||||
u64 size; ///< Size of data.
|
||||
u64 timestamp; ///< Timestamp.
|
||||
} HidbusJoyPollingReceivedData;
|
||||
|
||||
/// HidbusDataAccessorHeader
|
||||
@ -52,42 +52,42 @@ typedef struct {
|
||||
/// HidbusJoyDisableSixAxisPollingDataAccessorEntryData
|
||||
typedef struct {
|
||||
u8 data[0x26]; ///< Data.
|
||||
u8 out_size; ///< Size of data.
|
||||
u8 size; ///< Size of data.
|
||||
u8 pad; ///< Padding.
|
||||
u64 sampling_number; ///< SamplingNumber
|
||||
u64 timestamp; ///< Timestamp.
|
||||
} HidbusJoyDisableSixAxisPollingDataAccessorEntryData;
|
||||
|
||||
/// HidbusJoyDisableSixAxisPollingDataAccessorEntry
|
||||
typedef struct {
|
||||
u64 sampling_number; ///< SamplingNumber
|
||||
u64 timestamp; ///< Timestamp.
|
||||
HidbusJoyDisableSixAxisPollingDataAccessorEntryData data; ///< \ref HidbusJoyDisableSixAxisPollingDataAccessorEntryData
|
||||
} HidbusJoyDisableSixAxisPollingDataAccessorEntry;
|
||||
|
||||
/// HidbusJoyEnableSixAxisPollingDataAccessorEntryData
|
||||
typedef struct {
|
||||
u8 data[0x8]; ///< Data.
|
||||
u8 out_size; ///< Size of data.
|
||||
u8 size; ///< Size of data.
|
||||
u8 pad[7]; ///< Padding.
|
||||
u64 sampling_number; ///< SamplingNumber
|
||||
u64 timestamp; ///< Timestamp.
|
||||
} HidbusJoyEnableSixAxisPollingDataAccessorEntryData;
|
||||
|
||||
/// HidbusJoyEnableSixAxisPollingDataAccessorEntry
|
||||
typedef struct {
|
||||
u64 sampling_number; ///< SamplingNumber
|
||||
u64 timestamp; ///< Timestamp.
|
||||
HidbusJoyEnableSixAxisPollingDataAccessorEntryData data; ///< \ref HidbusJoyEnableSixAxisPollingDataAccessorEntryData
|
||||
} HidbusJoyEnableSixAxisPollingDataAccessorEntry;
|
||||
|
||||
/// HidbusJoyButtonOnlyPollingDataAccessorEntryData
|
||||
typedef struct {
|
||||
u8 data[0x2c]; ///< Data.
|
||||
u8 out_size; ///< Size of data.
|
||||
u8 size; ///< Size of data.
|
||||
u8 pad[3]; ///< Padding.
|
||||
u64 sampling_number; ///< SamplingNumber
|
||||
u64 timestamp; ///< Timestamp.
|
||||
} HidbusJoyButtonOnlyPollingDataAccessorEntryData;
|
||||
|
||||
/// HidbusJoyButtonOnlyPollingDataAccessorEntry
|
||||
typedef struct {
|
||||
u64 sampling_number; ///< SamplingNumber
|
||||
u64 timestamp; ///< Timestamp.
|
||||
HidbusJoyButtonOnlyPollingDataAccessorEntryData data; ///< \ref HidbusJoyEnableSixAxisPollingDataAccessorEntryData
|
||||
} HidbusJoyButtonOnlyPollingDataAccessorEntry;
|
||||
|
||||
@ -111,13 +111,13 @@ typedef struct {
|
||||
|
||||
/// Common data for HidbusStatusManagerEntry*.
|
||||
typedef struct {
|
||||
u8 is_connected; ///< IsConnected
|
||||
u8 flag_x0; ///< Flag.
|
||||
u8 pad[3]; ///< Padding.
|
||||
Result is_connected_result; ///< IsConnectedResult
|
||||
u8 is_enabled; ///< Flag indicating whether a device is enabled (\ref hidbusEnableExternalDevice).
|
||||
u8 is_in_focus; ///< Flag indicating whether this entry is valid.
|
||||
u8 is_polling_mode; ///< Flag indicating whether polling is enabled (\ref hidbusEnableJoyPollingReceiveMode).
|
||||
u8 reserved; ///< Reserved
|
||||
Result res; ///< Result.
|
||||
u8 device_enabled; ///< Flag indicating whether a device is enabled (\ref hidbusEnableExternalDevice).
|
||||
u8 is_valid; ///< Flag indicating whether this entry is valid.
|
||||
u8 polling_enabled; ///< Flag indicating whether polling is enabled (\ref hidbusEnableJoyPollingReceiveMode).
|
||||
u8 unk_xb; ///< Unknown / padding?
|
||||
u32 polling_mode; ///< \ref HidbusJoyPollingMode
|
||||
} HidbusStatusManagerEntryCommon;
|
||||
|
||||
@ -154,10 +154,10 @@ void* hidbusGetSharedmemAddr(void);
|
||||
* @brief GetBusHandle
|
||||
* @param[out] handle \ref HidbusBusHandle
|
||||
* @param[out] flag Output flag indicating whether the handle is valid.
|
||||
* @param[in] id \ref HidNpadIdType
|
||||
* @param[in] id \ref HidControllerID
|
||||
* @param[in] bus_type \ref HidbusBusType
|
||||
*/
|
||||
Result hidbusGetBusHandle(HidbusBusHandle *handle, bool *flag, HidNpadIdType id, HidbusBusType bus_type);
|
||||
Result hidbusGetBusHandle(HidbusBusHandle *handle, bool *flag, HidControllerID id, HidbusBusType bus_type);
|
||||
|
||||
/**
|
||||
* @brief Initialize
|
||||
|
@ -6,61 +6,8 @@
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/hid.h"
|
||||
#include "../services/hidsys.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
/// HiddbgNpadButton. For the remaining buttons, see \ref HidNpadButton.
|
||||
typedef enum {
|
||||
HiddbgNpadButton_Home = BIT(18), ///< HOME button
|
||||
HiddbgNpadButton_Capture = BIT(19), ///< Capture button
|
||||
} HiddbgNpadButton;
|
||||
|
||||
/// HdlsAttribute
|
||||
typedef enum {
|
||||
HiddbgHdlsAttribute_HasVirtualSixAxisSensorAcceleration = BIT(0), ///< HasVirtualSixAxisSensorAcceleration
|
||||
HiddbgHdlsAttribute_HasVirtualSixAxisSensorAngle = BIT(1), ///< HasVirtualSixAxisSensorAngle
|
||||
} HiddbgHdlsAttribute;
|
||||
|
||||
/// State for overriding \ref HidDebugPadState.
|
||||
typedef struct {
|
||||
u32 attributes; ///< Bitfield of \ref HidDebugPadAttribute.
|
||||
u32 buttons; ///< Bitfield of \ref HidDebugPadButton.
|
||||
HidAnalogStickState analog_stick_l; ///< AnalogStickL
|
||||
HidAnalogStickState analog_stick_r; ///< AnalogStickR
|
||||
} HiddbgDebugPadAutoPilotState;
|
||||
|
||||
/// State for overriding \ref HidMouseState.
|
||||
typedef struct {
|
||||
s32 x; ///< X
|
||||
s32 y; ///< Y
|
||||
s32 delta_x; ///< DeltaX
|
||||
s32 delta_y; ///< DeltaY
|
||||
s32 wheel_delta; ///< WheelDelta
|
||||
u32 buttons; ///< Bitfield of \ref HidMouseButton.
|
||||
u32 attributes; ///< Bitfield of \ref HidMouseAttribute.
|
||||
} HiddbgMouseAutoPilotState;
|
||||
|
||||
/// State for overriding \ref HidKeyboardState.
|
||||
typedef struct {
|
||||
u64 modifiers; ///< Bitfield of \ref HidKeyboardModifier.
|
||||
u64 keys[4];
|
||||
} HiddbgKeyboardAutoPilotState;
|
||||
|
||||
/// State for overriding SleepButtonState.
|
||||
typedef struct {
|
||||
u64 buttons; ///< Bitfield of buttons, only bit0 is used.
|
||||
} HiddbgSleepButtonAutoPilotState;
|
||||
|
||||
/// HdlsHandle
|
||||
typedef struct {
|
||||
u64 handle; ///< Handle
|
||||
} HiddbgHdlsHandle;
|
||||
|
||||
/// HdlsSessionId, returned by \ref hiddbgAttachHdlsWorkBuffer.
|
||||
typedef struct {
|
||||
u64 id; ///< Id
|
||||
} HiddbgHdlsSessionId;
|
||||
|
||||
/// HdlsDeviceInfo, for [7.0.0-8.1.0].
|
||||
typedef struct {
|
||||
u32 deviceTypeInternal; ///< Only one bit can be set. BIT(N*4+0) = Pro-Controller, BIT(N*4+1) = Joy-Con Left, BIT(N*4+2) = Joy-Con Right, BIT(N*4+3) = invalid. Where N is 0-1. BIT(8-10) = Pro-Controller, BIT(11) = Famicom-Controller, BIT(12) = Famicom-Controller II with microphone, BIT(13) = NES-Controller(DeviceType=0x200), BIT(14) = NES-Controller(DeviceType=0x400), BIT(15-16) = invalid, BIT(17) = unknown(DeviceType=0x8000), BIT(18-20) = invalid, BIT(21-23) = unknown(DeviceType=0x80000000).
|
||||
@ -73,7 +20,7 @@ typedef struct {
|
||||
/// HdlsDeviceInfo, for [9.0.0+]. Converted to/from \ref HiddbgHdlsDeviceInfoV7 on prior sysvers.
|
||||
typedef struct {
|
||||
u8 deviceType; ///< \ref HidDeviceType
|
||||
u8 npadInterfaceType; ///< \ref HidNpadInterfaceType. Additional type field used with the above type field (only applies to ::HidDeviceType_JoyRight1, ::HidDeviceType_JoyLeft2, ::HidDeviceType_FullKey3, and ::HidDeviceType_System19), if the value doesn't match one of the following a default is used. ::HidDeviceType_FullKey3: ::HidNpadInterfaceType_USB indicates that the controller is connected via USB. :::HidDeviceType_System19: ::HidNpadInterfaceType_USB = unknown. When value is ::HidNpadInterfaceType_Rail, state is merged with an existing controller (with ::HidDeviceType_JoyRight1 / ::HidDeviceType_JoyLeft2). Otherwise, it's a dedicated controller.
|
||||
u8 npadInterfaceType; ///< \ref HidNpadInterfaceType. Additional type field used with the above type field (only applies to ::HidDeviceType_JoyRight1, ::HidDeviceType_JoyLeft2, ::HidDeviceType_FullKey3, and ::HidDeviceType_System19), if the value doesn't match one of the following a default is used. ::HidDeviceType_FullKey3: ::NpadInterfaceType_USB indicates that the controller is connected via USB. :::HidDeviceType_System19: ::NpadInterfaceType_USB = unknown. When value is ::NpadInterfaceType_Rail, state is merged with an existing controller (with ::HidDeviceType_JoyRight1 / ::HidDeviceType_JoyLeft2). Otherwise, it's a dedicated controller.
|
||||
u8 pad[0x2]; ///< Padding.
|
||||
u32 singleColorBody; ///< RGBA Single Body Color.
|
||||
u32 singleColorButtons; ///< RGBA Single Buttons Color.
|
||||
@ -83,45 +30,29 @@ typedef struct {
|
||||
|
||||
/// HdlsState, for [7.0.0-8.1.0].
|
||||
typedef struct {
|
||||
u8 is_powered; ///< IsPowered for the main PowerInfo, see \ref HidNpadSystemProperties.
|
||||
u8 flags; ///< ORRed with IsPowered to set the value of the first byte for \ref HidNpadSystemProperties. For example, value 1 here will set IsCharging for the main PowerInfo.
|
||||
u8 powerConnected; ///< powerConnected for the main PowerInfo, see \ref HidFlags.
|
||||
u8 flags; ///< ORRed with powerConnected to set the value of the first byte for \ref HidFlags. For example, value 1 here will set isCharging for the main PowerInfo.
|
||||
u8 unk_x2[0x6]; ///< Unknown
|
||||
u32 battery_level; ///< BatteryLevel for the main PowerInfo, see \ref HidPowerInfo.
|
||||
u32 buttons; ///< See \ref HiddbgNpadButton.
|
||||
HidAnalogStickState analog_stick_l; ///< AnalogStickL
|
||||
HidAnalogStickState analog_stick_r; ///< AnalogStickR
|
||||
u8 indicator; ///< Indicator. Unused for input. Set with output from \ref hiddbgDumpHdlsStates. Not set by \ref hiddbgGetAbstractedPadsState.
|
||||
u32 batteryCharge; ///< batteryCharge for the main PowerInfo, see \ref HidPowerInfo.
|
||||
u32 buttons; ///< See \ref HidControllerKeys.
|
||||
JoystickPosition joysticks[JOYSTICK_NUM_STICKS]; ///< \ref JoystickPosition
|
||||
u8 unk_x20; ///< Unused for input. Set with output from \ref hiddbgDumpHdlsStates. Not set by \ref hiddbgGetAbstractedPadsState.
|
||||
u8 padding[0x3]; ///< Padding
|
||||
} HiddbgHdlsStateV7;
|
||||
|
||||
/// HdlsState, for [9.0.0-11.0.1].
|
||||
/// HdlsState, for [9.0.0+]. Converted to/from \ref HiddbgHdlsDeviceInfoV7 on prior sysvers.
|
||||
typedef struct {
|
||||
u32 battery_level; ///< BatteryLevel for the main PowerInfo, see \ref HidPowerInfo.
|
||||
u32 flags; ///< Used to set the main PowerInfo for \ref HidNpadSystemProperties. BIT(0) -> IsPowered, BIT(1) -> IsCharging.
|
||||
u64 buttons; ///< See \ref HiddbgNpadButton. [9.0.0+] Masked with 0xfffffffff00fffff.
|
||||
HidAnalogStickState analog_stick_l; ///< AnalogStickL
|
||||
HidAnalogStickState analog_stick_r; ///< AnalogStickR
|
||||
u8 indicator; ///< Indicator. Unused for input. Set with output from \ref hiddbgDumpHdlsStates.
|
||||
u8 padding[0x3]; ///< Padding
|
||||
} HiddbgHdlsStateV9;
|
||||
|
||||
/// HdlsState, for [12.0.0+].
|
||||
typedef struct {
|
||||
u32 battery_level; ///< BatteryLevel for the main PowerInfo, see \ref HidPowerInfo.
|
||||
u32 flags; ///< Used to set the main PowerInfo for \ref HidNpadSystemProperties. BIT(0) -> IsPowered, BIT(1) -> IsCharging.
|
||||
u64 buttons; ///< See \ref HiddbgNpadButton. [9.0.0+] Masked with 0xfffffffff00fffff.
|
||||
HidAnalogStickState analog_stick_l; ///< AnalogStickL
|
||||
HidAnalogStickState analog_stick_r; ///< AnalogStickR
|
||||
HidVector six_axis_sensor_acceleration; ///< VirtualSixAxisSensorAcceleration
|
||||
HidVector six_axis_sensor_angle; ///< VirtualSixAxisSensorAngle
|
||||
u32 attribute; ///< Bitfield of \ref HiddbgHdlsAttribute.
|
||||
u8 indicator; ///< Indicator. Unused for input.
|
||||
u32 batteryCharge; ///< batteryCharge for the main PowerInfo, see \ref HidPowerInfo.
|
||||
u32 flags; ///< Used to set the main PowerInfo for \ref HidFlags. BIT(0) -> powerConnected, BIT(1) -> isCharging.
|
||||
u64 buttons; ///< See \ref HidControllerKeys. [9.0.0+] Masked with 0xfffffffff00fffff.
|
||||
JoystickPosition joysticks[JOYSTICK_NUM_STICKS]; ///< \ref JoystickPosition
|
||||
u8 unk_x20; ///< Unused for input. Set with output from \ref hiddbgDumpHdlsStates.
|
||||
u8 padding[0x3]; ///< Padding
|
||||
} HiddbgHdlsState;
|
||||
|
||||
/// HdlsNpadAssignmentEntry
|
||||
typedef struct {
|
||||
HiddbgHdlsHandle handle; ///< \ref HiddbgHdlsHandle
|
||||
u64 HdlsHandle; ///< HdlsHandle
|
||||
u32 unk_x8; ///< Unknown
|
||||
u32 unk_xc; ///< Unknown
|
||||
u64 unk_x10; ///< Unknown
|
||||
@ -138,9 +69,9 @@ typedef struct {
|
||||
|
||||
/// HdlsStateListEntryV7, for [7.0.0-8.1.0].
|
||||
typedef struct {
|
||||
HiddbgHdlsHandle handle; ///< \ref HiddbgHdlsHandle
|
||||
u64 HdlsHandle; ///< HdlsHandle
|
||||
HiddbgHdlsDeviceInfoV7 device; ///< \ref HiddbgHdlsDeviceInfoV7. With \ref hiddbgApplyHdlsStateList this is only used when creating new devices.
|
||||
HiddbgHdlsStateV7 state; ///< \ref HiddbgHdlsStateV7
|
||||
HiddbgHdlsStateV7 state; ///< \ref HiddbgHdlsState
|
||||
} HiddbgHdlsStateListEntryV7;
|
||||
|
||||
/// HdlsStateListV7, for [7.0.0-8.1.0]. This contains a list of all controllers, including non-virtual controllers.
|
||||
@ -150,28 +81,14 @@ typedef struct {
|
||||
HiddbgHdlsStateListEntryV7 entries[0x10]; ///< \ref HiddbgHdlsStateListEntryV7
|
||||
} HiddbgHdlsStateListV7;
|
||||
|
||||
/// HdlsStateListEntry, for [9.0.0-11.0.1].
|
||||
/// HdlsStateListEntry, for [9.0.0+]. Converted to/from \ref HiddbgHdlsStateListEntryV7 on prior sysvers.
|
||||
typedef struct {
|
||||
HiddbgHdlsHandle handle; ///< \ref HiddbgHdlsHandle
|
||||
HiddbgHdlsDeviceInfo device; ///< \ref HiddbgHdlsDeviceInfo. With \ref hiddbgApplyHdlsStateList this is only used when creating new devices.
|
||||
alignas(8) HiddbgHdlsStateV9 state; ///< \ref HiddbgHdlsStateV9
|
||||
} HiddbgHdlsStateListEntryV9;
|
||||
|
||||
/// HdlsStateList, for [9.0.0-11.0.1].
|
||||
typedef struct {
|
||||
s32 total_entries; ///< Total entries for the below entries.
|
||||
u32 pad; ///< Padding
|
||||
HiddbgHdlsStateListEntryV9 entries[0x10]; ///< \ref HiddbgHdlsStateListEntryV9
|
||||
} HiddbgHdlsStateListV9;
|
||||
|
||||
/// HdlsStateListEntry, for [12.0.0+].
|
||||
typedef struct {
|
||||
HiddbgHdlsHandle handle; ///< \ref HiddbgHdlsHandle
|
||||
u64 HdlsHandle; ///< HdlsHandle
|
||||
HiddbgHdlsDeviceInfo device; ///< \ref HiddbgHdlsDeviceInfo. With \ref hiddbgApplyHdlsStateList this is only used when creating new devices.
|
||||
alignas(8) HiddbgHdlsState state; ///< \ref HiddbgHdlsState
|
||||
} HiddbgHdlsStateListEntry;
|
||||
|
||||
/// HdlsStateList, for [12.0.0+].
|
||||
/// HdlsStateList, for [9.0.0+]. Converted to/from \ref HiddbgHdlsStateListV7 on prior sysvers.
|
||||
/// This contains a list of all controllers, including non-virtual controllers.
|
||||
typedef struct {
|
||||
s32 total_entries; ///< Total entries for the below entries.
|
||||
@ -179,15 +96,10 @@ typedef struct {
|
||||
HiddbgHdlsStateListEntry entries[0x10]; ///< \ref HiddbgHdlsStateListEntry
|
||||
} HiddbgHdlsStateList;
|
||||
|
||||
/// AbstractedPadHandle
|
||||
typedef struct {
|
||||
u64 handle; ///< Handle
|
||||
} HiddbgAbstractedPadHandle;
|
||||
|
||||
/// AbstractedPadState
|
||||
typedef struct {
|
||||
u32 type; ///< Type. Converted to HiddbgHdlsDeviceInfoV7::type internally by \ref hiddbgSetAutoPilotVirtualPadState. BIT(0) -> BIT(0), BIT(1) -> BIT(15), BIT(2-3) -> BIT(1-2), BIT(4-5) -> BIT(1-2), BIT(6) -> BIT(3). BIT(7-11) -> BIT(11-15), BIT(12-14) -> BIT(12-14), BIT(15) -> BIT(17), BIT(31) -> BIT(21).
|
||||
u8 flags; ///< Flags. Only bit0 is used by \ref hiddbgSetAutoPilotVirtualPadState, when clear it will skip using the rest of the input and run \ref hiddbgUnsetAutoPilotVirtualPadState internally.
|
||||
u8 flags; ///< Flags. Only bit0 is used by \ref hiddbgSetAutoPilotVirtualPadState: when clear it will skip using the rest of the input and run \ref hiddbgUnsetAutoPilotVirtualPadState internally.
|
||||
u8 pad[0x3]; ///< Padding
|
||||
|
||||
u32 singleColorBody; ///< RGBA Single Body Color
|
||||
@ -195,9 +107,9 @@ typedef struct {
|
||||
u8 npadInterfaceType; ///< See HiddbgHdlsDeviceInfo::npadInterfaceType.
|
||||
u8 pad2[0x3]; ///< Padding
|
||||
|
||||
HiddbgHdlsStateV7 state; ///< State
|
||||
HiddbgHdlsStateV7 state; ///< State
|
||||
|
||||
u8 unused[0x60]; ///< Unused with \ref hiddbgSetAutoPilotVirtualPadState. Not set by \ref hiddbgGetAbstractedPadsState.
|
||||
u8 unused[0x60]; ///< Unused with \ref hiddbgSetAutoPilotVirtualPadState. Not set by \ref hiddbgGetAbstractedPadsState.
|
||||
} HiddbgAbstractedPadState;
|
||||
|
||||
/// Initialize hiddbg.
|
||||
@ -209,276 +121,89 @@ void hiddbgExit(void);
|
||||
/// Gets the Service object for the actual hiddbg service session.
|
||||
Service* hiddbgGetServiceSession(void);
|
||||
|
||||
/**
|
||||
* @brief SetDebugPadAutoPilotState
|
||||
* @param[in] state \ref HiddbgDebugPadAutoPilotState
|
||||
*/
|
||||
Result hiddbgSetDebugPadAutoPilotState(const HiddbgDebugPadAutoPilotState *state);
|
||||
/// Writes the input RGB colors to the spi-flash for the specified controller (offset 0x6050 size 0x6). See hidsys.h for UniquePadId. Only available with [3.0.0+].
|
||||
Result hiddbgUpdateControllerColor(u32 colorBody, u32 colorButtons, u64 UniquePadId);
|
||||
|
||||
/**
|
||||
* @brief UnsetDebugPadAutoPilotState
|
||||
*/
|
||||
Result hiddbgUnsetDebugPadAutoPilotState(void);
|
||||
/// Writes the input RGB colors followed by inval to the spi-flash for the specified controller (offset 0x6050 size 0xD). See hidsys.h for UniquePadId. Only available with [5.0.0+].
|
||||
Result hiddbgUpdateDesignInfo(u32 colorBody, u32 colorButtons, u32 colorLeftGrip, u32 colorRightGrip, u8 inval, u64 UniquePadId);
|
||||
|
||||
/**
|
||||
* @brief SetTouchScreenAutoPilotState
|
||||
* @param[in] states Input array of \ref HiddbgMouseAutoPilotState.
|
||||
* @param[in] count Total entries in the states array. Max is 16.
|
||||
*/
|
||||
Result hiddbgSetTouchScreenAutoPilotState(const HidTouchState *states, s32 count);
|
||||
/// Get the OperationEvent for the specified controller. See hidsys.h for UniquePadId.
|
||||
/// The Event must be closed by the user once finished with it.
|
||||
/// Only available with [6.0.0+].
|
||||
Result hiddbgAcquireOperationEventHandle(Event* out_event, bool autoclear, u64 UniquePadId);
|
||||
|
||||
/**
|
||||
* @brief UnsetTouchScreenAutoPilotState
|
||||
*/
|
||||
Result hiddbgUnsetTouchScreenAutoPilotState(void);
|
||||
/// Reads spi-flash for the specified controller. See hidsys.h for UniquePadId.
|
||||
/// This also uses \ref hiddbgAcquireOperationEventHandle to wait for the operation to finish, then \ref hiddbgGetOperationResult is used.
|
||||
/// Only available with [6.0.0+].
|
||||
Result hiddbgReadSerialFlash(u32 offset, void* buffer, size_t size, u64 UniquePadId);
|
||||
|
||||
/**
|
||||
* @brief SetMouseAutoPilotState
|
||||
* @param[in] state \ref HiddbgMouseAutoPilotState
|
||||
*/
|
||||
Result hiddbgSetMouseAutoPilotState(const HiddbgMouseAutoPilotState *state);
|
||||
/// Writes spi-flash for the specified controller. See hidsys.h for UniquePadId.
|
||||
/// buffer and tmem_size must be page-aligned. size is the actual transfer size.
|
||||
/// This also uses \ref hiddbgAcquireOperationEventHandle to wait for the operation to finish, then \ref hiddbgGetOperationResult is used.
|
||||
/// Only available with [6.0.0+].
|
||||
Result hiddbgWriteSerialFlash(u32 offset, void* buffer, size_t tmem_size, size_t size, u64 UniquePadId);
|
||||
|
||||
/**
|
||||
* @brief UnsetMouseAutoPilotState
|
||||
*/
|
||||
Result hiddbgUnsetMouseAutoPilotState(void);
|
||||
/// Get the Result for the Operation and handles cleanup, for the specified controller. See hidsys.h for UniquePadId.
|
||||
/// Only available with [6.0.0+].
|
||||
Result hiddbgGetOperationResult(u64 UniquePadId);
|
||||
|
||||
/**
|
||||
* @brief SetKeyboardAutoPilotState
|
||||
* @param[in] state \ref HiddbgKeyboardAutoPilotState
|
||||
*/
|
||||
Result hiddbgSetKeyboardAutoPilotState(const HiddbgKeyboardAutoPilotState *state);
|
||||
/// Gets the internal DeviceType for the specified controller. See hidsys.h for UniquePadId.
|
||||
/// Only available with [6.0.0+].
|
||||
/// Pre-9.0.0 the output is an u32, with [9.0.0+] it's an u8.
|
||||
Result hiddbgGetUniquePadDeviceTypeSetInternal(u64 UniquePadId, u32 *out);
|
||||
|
||||
/**
|
||||
* @brief UnsetKeyboardAutoPilotState
|
||||
*/
|
||||
Result hiddbgUnsetKeyboardAutoPilotState(void);
|
||||
/// Gets a list of AbstractedPadHandles, where AbstractedPadHandles is the output array with max entries = count. total_entries is total entries written to the output array.
|
||||
/// Only available with [5.0.0-8.1.0].
|
||||
Result hiddbgGetAbstractedPadHandles(u64 *AbstractedPadHandles, s32 count, s32 *total_entries);
|
||||
|
||||
/**
|
||||
* @brief Deactivates the HomeButton.
|
||||
*/
|
||||
Result hiddbgDeactivateHomeButton(void);
|
||||
/// Gets the state for the specified AbstractedPadHandle.
|
||||
/// Only available with [5.0.0-8.1.0].
|
||||
Result hiddbgGetAbstractedPadState(u64 AbstractedPadHandle, HiddbgAbstractedPadState *state);
|
||||
|
||||
/**
|
||||
* @brief SetSleepButtonAutoPilotState
|
||||
* @param[in] state \ref HiddbgSleepButtonAutoPilotState
|
||||
*/
|
||||
Result hiddbgSetSleepButtonAutoPilotState(const HiddbgSleepButtonAutoPilotState *state);
|
||||
/// Similar to \ref hiddbgGetAbstractedPadHandles except this also returns the state for each pad in output array states.
|
||||
/// Only available with [5.0.0-8.1.0].
|
||||
Result hiddbgGetAbstractedPadsState(u64 *AbstractedPadHandles, HiddbgAbstractedPadState *states, s32 count, s32 *total_entries);
|
||||
|
||||
/**
|
||||
* @brief UnsetSleepButtonAutoPilotState
|
||||
*/
|
||||
Result hiddbgUnsetSleepButtonAutoPilotState(void);
|
||||
|
||||
/**
|
||||
* @brief Writes the input RGB colors to the spi-flash for the specified UniquePad (offset 0x6050 size 0x6).
|
||||
* @note Only available with [3.0.0+].
|
||||
* @param[in] colorBody RGB body color.
|
||||
* @param[in] colorButtons RGB buttons color.
|
||||
* @param[in] unique_pad_id \ref HidsysUniquePadId
|
||||
*/
|
||||
Result hiddbgUpdateControllerColor(u32 colorBody, u32 colorButtons, HidsysUniquePadId unique_pad_id);
|
||||
|
||||
/**
|
||||
* @brief Writes the input RGB colors followed by inval to the spi-flash for the specified UniquePad (offset 0x6050 size 0xD).
|
||||
* @note Only available with [5.0.0+].
|
||||
* @param[in] colorBody RGB body color.
|
||||
* @param[in] colorButtons RGB buttons color.
|
||||
* @param[in] colorLeftGrip RGB left grip color.
|
||||
* @param[in] colorRightGrip RGB right grip color.
|
||||
* @param[in] inval Input value.
|
||||
* @param[in] unique_pad_id \ref HidsysUniquePadId
|
||||
*/
|
||||
Result hiddbgUpdateDesignInfo(u32 colorBody, u32 colorButtons, u32 colorLeftGrip, u32 colorRightGrip, u8 inval, HidsysUniquePadId unique_pad_id);
|
||||
|
||||
/**
|
||||
* @brief Get the OperationEvent for the specified UniquePad.
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @note Only available with [6.0.0+].
|
||||
* @param[out] out_event Output Event.
|
||||
* @param[in] autoclear The autoclear for the Event.
|
||||
* @param[in] unique_pad_id \ref HidsysUniquePadId
|
||||
**/
|
||||
Result hiddbgAcquireOperationEventHandle(Event* out_event, bool autoclear, HidsysUniquePadId unique_pad_id);
|
||||
|
||||
/**
|
||||
* @brief Reads spi-flash for the specified UniquePad.
|
||||
* @note This also uses \ref hiddbgAcquireOperationEventHandle to wait for the operation to finish, then \ref hiddbgGetOperationResult is used.
|
||||
* @note Only available with [6.0.0+].
|
||||
* @param[in] offset Offset in spi-flash.
|
||||
* @param[out] buffer Output buffer.
|
||||
* @param[in] size Output buffer size.
|
||||
* @param[in] unique_pad_id \ref HidsysUniquePadId
|
||||
**/
|
||||
Result hiddbgReadSerialFlash(u32 offset, void* buffer, size_t size, HidsysUniquePadId unique_pad_id);
|
||||
|
||||
/**
|
||||
* @brief Writes spi-flash for the specified UniquePad.
|
||||
* @note This also uses \ref hiddbgAcquireOperationEventHandle to wait for the operation to finish, then \ref hiddbgGetOperationResult is used.
|
||||
* @note Only available with [6.0.0+].
|
||||
* @param[in] offset Offset in spi-flash.
|
||||
* @param[in] buffer Input buffer, must be 0x1000-byte aligned.
|
||||
* @param[in] tmem_size Size of the buffer, must be 0x1000-byte aligned.
|
||||
* @param[in] size Actual transfer size.
|
||||
* @param[in] unique_pad_id \ref HidsysUniquePadId
|
||||
**/
|
||||
Result hiddbgWriteSerialFlash(u32 offset, void* buffer, size_t tmem_size, size_t size, HidsysUniquePadId unique_pad_id);
|
||||
|
||||
/**
|
||||
* @brief Get the Result for the Operation and handles cleanup, for the specified UniquePad.
|
||||
* @note Only available with [6.0.0+].
|
||||
* @param[in] unique_pad_id \ref HidsysUniquePadId
|
||||
**/
|
||||
Result hiddbgGetOperationResult(HidsysUniquePadId unique_pad_id);
|
||||
|
||||
/**
|
||||
* @brief Gets the internal DeviceType for the specified controller.
|
||||
* @note Only available with [6.0.0+].
|
||||
* @param[in] unique_pad_id \ref HidsysUniquePadId
|
||||
* @param[out] out Pre-9.0.0 this is an u32, with [9.0.0+] it's an u8.
|
||||
**/
|
||||
Result hiddbgGetUniquePadDeviceTypeSetInternal(HidsysUniquePadId unique_pad_id, u32 *out);
|
||||
|
||||
/** @name AbstractedPad
|
||||
* This is for virtual HID controllers. Only use this on pre-7.0.0, Hdls should be used otherwise.
|
||||
*/
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Gets a list of \ref HiddbgAbstractedPadHandle.
|
||||
* @note Only available with [5.0.0-8.1.0].
|
||||
* @param[out] handles Output array of \ref HiddbgAbstractedPadHandle.
|
||||
* @param[in] count Max number of entries for the handles array.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result hiddbgGetAbstractedPadHandles(HiddbgAbstractedPadHandle *handles, s32 count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Gets the state for the specified \ref HiddbgAbstractedPadHandle.
|
||||
* @note Only available with [5.0.0-8.1.0].
|
||||
* @param[in] handle \ref HiddbgAbstractedPadHandle
|
||||
* @param[out] state \ref HiddbgAbstractedPadState
|
||||
*/
|
||||
Result hiddbgGetAbstractedPadState(HiddbgAbstractedPadHandle handle, HiddbgAbstractedPadState *state);
|
||||
|
||||
/**
|
||||
* @brief Similar to \ref hiddbgGetAbstractedPadHandles except this also returns the state for each pad in output array states.
|
||||
* @note Only available with [5.0.0-8.1.0].
|
||||
* @param[out] handles Output array of \ref HiddbgAbstractedPadHandle.
|
||||
* @param[out] states Output array of \ref HiddbgAbstractedPadState.
|
||||
* @param[in] count Max number of entries for the handles/states arrays.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result hiddbgGetAbstractedPadsState(HiddbgAbstractedPadHandle *handles, HiddbgAbstractedPadState *states, s32 count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Sets AutoPilot state for the specified pad.
|
||||
* @note Only available with [5.0.0-8.1.0].
|
||||
* @param[in] AbstractedVirtualPadId This can be any unique value as long as it's within bounds. For example, 0-7 is usable.
|
||||
* @param[in] state \ref HiddbgAbstractedPadState
|
||||
*/
|
||||
/// Sets AutoPilot state for the specified pad.
|
||||
/// AbstractedVirtualPadId can be any unique value as long as it's within bounds. For example, 0-7 is usable.
|
||||
/// Only available with [5.0.0-8.1.0].
|
||||
Result hiddbgSetAutoPilotVirtualPadState(s8 AbstractedVirtualPadId, const HiddbgAbstractedPadState *state);
|
||||
|
||||
/**
|
||||
* @brief Clears AutoPilot state for the specified pad set by \ref hiddbgSetAutoPilotVirtualPadState.
|
||||
* @note Only available with [5.0.0-8.1.0].
|
||||
* @param[in] AbstractedVirtualPadId Id from \ref hiddbgSetAutoPilotVirtualPadState.
|
||||
*/
|
||||
/// Clears AutoPilot state for the specified pad set by \ref hiddbgSetAutoPilotVirtualPadState.
|
||||
/// Only available with [5.0.0-8.1.0].
|
||||
Result hiddbgUnsetAutoPilotVirtualPadState(s8 AbstractedVirtualPadId);
|
||||
|
||||
/**
|
||||
* @brief Clears AutoPilot state for all pads set by \ref hiddbgSetAutoPilotVirtualPadState.
|
||||
*/
|
||||
/// Clears AutoPilot state for all pads set by \ref hiddbgSetAutoPilotVirtualPadState.
|
||||
Result hiddbgUnsetAllAutoPilotVirtualPadState(void);
|
||||
|
||||
///@}
|
||||
/// Initialize Hdls. Hdls is for virtual HID controllers. Only available with [7.0.0+].
|
||||
Result hiddbgAttachHdlsWorkBuffer(void);
|
||||
|
||||
/** @name Hdls
|
||||
* This is for virtual HID controllers.
|
||||
*/
|
||||
///@{
|
||||
/// Exit Hdls, must be called at some point prior to hiddbgExit. Only available with [7.0.0+].
|
||||
Result hiddbgReleaseHdlsWorkBuffer(void);
|
||||
|
||||
/**
|
||||
* @brief Initialize Hdls.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[out] session_id [13.0.0+] \ref HiddbgHdlsSessionId
|
||||
* @param[in] buffer An existing buffer to be used as transfer memory.
|
||||
* @param[in] size Size of the supplied buffer.
|
||||
*/
|
||||
Result hiddbgAttachHdlsWorkBuffer(HiddbgHdlsSessionId *session_id, void *buffer, size_t size);
|
||||
/// Checks if the given HdlsHandle is still attached, where the result is written to isAttached. Only available with [7.0.0+].
|
||||
Result hiddbgIsHdlsVirtualDeviceAttached(u64 HdlsHandle, bool *isAttached);
|
||||
|
||||
/**
|
||||
* @brief Exit Hdls, must be called at some point prior to \ref hiddbgExit.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] session_id [13.0.0+] \ref HiddbgHdlsSessionId
|
||||
*/
|
||||
Result hiddbgReleaseHdlsWorkBuffer(HiddbgHdlsSessionId session_id);
|
||||
/// Gets state for \ref HiddbgHdlsNpadAssignment. Only available with [7.0.0+].
|
||||
Result hiddbgDumpHdlsNpadAssignmentState(HiddbgHdlsNpadAssignment *state);
|
||||
|
||||
/**
|
||||
* @brief Checks if the given device is still attached.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] session_id [13.0.0+] \ref HiddbgHdlsSessionId
|
||||
* @param[in] handle \ref HiddbgHdlsHandle
|
||||
* @param[out] out Whether the device is attached.
|
||||
*/
|
||||
Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsSessionId session_id, HiddbgHdlsHandle handle, bool *out);
|
||||
/// Gets state for \ref HiddbgHdlsStateList. Only available with [7.0.0+].
|
||||
Result hiddbgDumpHdlsStates(HiddbgHdlsStateList *state);
|
||||
|
||||
/**
|
||||
* @brief Gets state for \ref HiddbgHdlsNpadAssignment.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] session_id [13.0.0+] \ref HiddbgHdlsSessionId
|
||||
* @param[out] state \ref HiddbgHdlsNpadAssignment
|
||||
*/
|
||||
Result hiddbgDumpHdlsNpadAssignmentState(HiddbgHdlsSessionId session_id, HiddbgHdlsNpadAssignment *state);
|
||||
/// Sets state for \ref HiddbgHdlsNpadAssignment. Only available with [7.0.0+].
|
||||
Result hiddbgApplyHdlsNpadAssignmentState(const HiddbgHdlsNpadAssignment *state, bool flag);
|
||||
|
||||
/**
|
||||
* @brief Gets state for \ref HiddbgHdlsStateList.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] session_id [13.0.0+] \ref HiddbgHdlsSessionId
|
||||
* @param[out] state \ref HiddbgHdlsStateList
|
||||
*/
|
||||
Result hiddbgDumpHdlsStates(HiddbgHdlsSessionId session_id, HiddbgHdlsStateList *state);
|
||||
/// Sets state for \ref HiddbgHdlsStateList. Only available with [7.0.0+].
|
||||
/// The HiddbgHdlsState will be applied for each HdlsHandle. If a HdlsHandle is not found, code similar to \ref hiddbgAttachHdlsVirtualDevice will run with the \ref HiddbgHdlsDeviceInfo, then it will continue with applying state with the new device.
|
||||
Result hiddbgApplyHdlsStateList(const HiddbgHdlsStateList *state);
|
||||
|
||||
/**
|
||||
* @brief Sets state for \ref HiddbgHdlsNpadAssignment.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] session_id [13.0.0+] \ref HiddbgHdlsSessionId
|
||||
* @param[in] state \ref HiddbgHdlsNpadAssignment
|
||||
* @param[in] flag Flag
|
||||
*/
|
||||
Result hiddbgApplyHdlsNpadAssignmentState(HiddbgHdlsSessionId session_id, const HiddbgHdlsNpadAssignment *state, bool flag);
|
||||
/// Attach a device with the input info, where the output handle is written to HdlsHandle. Only available with [7.0.0+].
|
||||
Result hiddbgAttachHdlsVirtualDevice(u64 *HdlsHandle, const HiddbgHdlsDeviceInfo *info);
|
||||
|
||||
/**
|
||||
* @brief Sets state for \ref HiddbgHdlsStateList.
|
||||
* @note The \ref HiddbgHdlsState will be applied for each \ref HiddbgHdlsHandle. If a \ref HiddbgHdlsHandle is not found, code similar to \ref hiddbgAttachHdlsVirtualDevice will run with the \ref HiddbgHdlsDeviceInfo, then it will continue with applying state with the new device.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] session_id [13.0.0+] \ref HiddbgHdlsSessionId
|
||||
* @param[in] state \ref HiddbgHdlsStateList
|
||||
*/
|
||||
Result hiddbgApplyHdlsStateList(HiddbgHdlsSessionId session_id, const HiddbgHdlsStateList *state);
|
||||
/// Detach the specified device. Only available with [7.0.0+].
|
||||
Result hiddbgDetachHdlsVirtualDevice(u64 HdlsHandle);
|
||||
|
||||
/**
|
||||
* @brief Attach a device with the input info.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[out] handle \ref HiddbgHdlsHandle
|
||||
* @param[in] info \ref HiddbgHdlsDeviceInfo
|
||||
*/
|
||||
Result hiddbgAttachHdlsVirtualDevice(HiddbgHdlsHandle *handle, const HiddbgHdlsDeviceInfo *info);
|
||||
|
||||
/**
|
||||
* @brief Detach the specified device.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] handle \ref HiddbgHdlsHandle
|
||||
*/
|
||||
Result hiddbgDetachHdlsVirtualDevice(HiddbgHdlsHandle handle);
|
||||
|
||||
/**
|
||||
* @brief Sets state for the specified device.
|
||||
* @note Only available with [7.0.0+].
|
||||
* @param[in] handle \ref HiddbgHdlsHandle
|
||||
* @param[in] state \ref HiddbgHdlsState
|
||||
*/
|
||||
Result hiddbgSetHdlsState(HiddbgHdlsHandle handle, const HiddbgHdlsState *state);
|
||||
|
||||
///@}
|
||||
/// Sets state for the specified device. Only available with [7.0.0+].
|
||||
Result hiddbgSetHdlsState(u64 HdlsHandle, const HiddbgHdlsState *state);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,150 +0,0 @@
|
||||
/**
|
||||
* @file htcs.h
|
||||
* @brief HTC sockets (htcs) service IPC wrapper. Please use <<TODO>> instead.
|
||||
* @author SciresM
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../types.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
#define HTCS_PEER_NAME_MAX 32
|
||||
#define HTCS_PORT_NAME_MAX 32
|
||||
|
||||
#define HTCS_SESSION_COUNT_MAX 0x10
|
||||
#define HTCS_SOCKET_COUNT_MAX 40
|
||||
#define HTCS_FD_SET_SIZE HTCS_SOCKET_COUNT_MAX
|
||||
|
||||
typedef uint16_t HtcsAddressFamilyType;
|
||||
|
||||
typedef struct {
|
||||
char name[HTCS_PEER_NAME_MAX];
|
||||
} HtcsPeerName;
|
||||
|
||||
typedef struct {
|
||||
char name[HTCS_PORT_NAME_MAX];
|
||||
} HtcsPortName;
|
||||
|
||||
typedef struct {
|
||||
HtcsAddressFamilyType family;
|
||||
HtcsPeerName peer_name;
|
||||
HtcsPortName port_name;
|
||||
} HtcsSockAddr;
|
||||
|
||||
typedef struct {
|
||||
s64 tv_sec;
|
||||
s64 tv_usec;
|
||||
} HtcsTimeVal;
|
||||
|
||||
typedef struct {
|
||||
int fds[HTCS_FD_SET_SIZE];
|
||||
} HtcsFdSet;
|
||||
|
||||
typedef enum {
|
||||
HTCS_ENONE = 0,
|
||||
HTCS_EACCES = 2,
|
||||
HTCS_EADDRINUSE = 3,
|
||||
HTCS_EADDRNOTAVAIL = 4,
|
||||
HTCS_EAGAIN = 6,
|
||||
HTCS_EALREADY = 7,
|
||||
HTCS_EBADF = 8,
|
||||
HTCS_EBUSY = 10,
|
||||
HTCS_ECONNABORTED = 13,
|
||||
HTCS_ECONNREFUSED = 14,
|
||||
HTCS_ECONNRESET = 15,
|
||||
HTCS_EDESTADDRREQ = 17,
|
||||
HTCS_EFAULT = 21,
|
||||
HTCS_EINPROGRESS = 26,
|
||||
HTCS_EINTR = 27,
|
||||
HTCS_EINVAL = 28,
|
||||
HTCS_EIO = 29,
|
||||
HTCS_EISCONN = 30,
|
||||
HTCS_EMFILE = 33,
|
||||
HTCS_EMSGSIZE = 35,
|
||||
HTCS_ENETDOWN = 38,
|
||||
HTCS_ENETRESET = 39,
|
||||
HTCS_ENOBUFS = 42,
|
||||
HTCS_ENOMEM = 49,
|
||||
HTCS_ENOTCONN = 56,
|
||||
HTCS_ETIMEDOUT = 76,
|
||||
HTCS_EUNKNOWN = 79,
|
||||
|
||||
HTCS_EWOULDBLOCK = HTCS_EAGAIN,
|
||||
} HtcsSocketError;
|
||||
|
||||
typedef enum {
|
||||
HTCS_MSG_PEEK = 1,
|
||||
HTCS_MSG_WAITALL = 2,
|
||||
} HtcsMessageFlag;
|
||||
|
||||
typedef enum {
|
||||
HTCS_SHUT_RD = 0,
|
||||
HTCS_SHUT_WR = 1,
|
||||
HTCS_SHUT_RDWR = 2,
|
||||
} HtcsShutdownType;
|
||||
|
||||
typedef enum {
|
||||
HTCS_F_GETFL = 3,
|
||||
HTCS_F_SETFL = 4,
|
||||
} HtcsFcntlOperation;
|
||||
|
||||
typedef enum {
|
||||
HTCS_O_NONBLOCK = 4,
|
||||
} HtcsFcntlFlag;
|
||||
|
||||
typedef enum {
|
||||
HTCS_AF_HTCS = 0,
|
||||
} HtcsAddressFamily;
|
||||
|
||||
typedef struct {
|
||||
Service s;
|
||||
} HtcsSocket;
|
||||
|
||||
|
||||
/// Initialize the HTCS service.
|
||||
Result htcsInitialize(u32 num_sessions);
|
||||
|
||||
/// Exit the HTCS service.
|
||||
void htcsExit(void);
|
||||
|
||||
/// Gets the Service object for the actual HTCS manager service session.
|
||||
Service* htcsGetManagerServiceSession(void);
|
||||
|
||||
/// Gets the Service object for the actual HTCS monitor service session.
|
||||
Service* htcsGetMonitorServiceSession(void);
|
||||
|
||||
/// Manager functionality.
|
||||
Result htcsGetPeerNameAny(HtcsPeerName *out);
|
||||
Result htcsGetDefaultHostName(HtcsPeerName *out);
|
||||
Result htcsCreateSocket(s32 *out_err, HtcsSocket *out, bool enable_disconnection_emulation);
|
||||
Result htcsStartSelect(u32 *out_task_id, Handle *out_event_handle, const s32 *read, size_t num_read, const s32 *write, size_t num_write, const s32 *except, size_t num_except, s64 tv_sec, s64 tv_usec);
|
||||
Result htcsEndSelect(s32 *out_err, s32 *out_count, s32 *read, size_t num_read, s32 *write, size_t num_write, s32 *except, size_t num_except, u32 task_id);
|
||||
|
||||
/// Socket functionality.
|
||||
Result htcsSocketClose(HtcsSocket *s, s32 *out_err, s32 *out_res);
|
||||
Result htcsSocketConnect(HtcsSocket *s, s32 *out_err, s32 *out_res, const HtcsSockAddr *address);
|
||||
Result htcsSocketBind(HtcsSocket *s, s32 *out_err, s32 *out_res, const HtcsSockAddr *address);
|
||||
Result htcsSocketListen(HtcsSocket *s, s32 *out_err, s32 *out_res, s32 backlog_count);
|
||||
Result htcsSocketShutdown(HtcsSocket *s, s32 *out_err, s32 *out_res, s32 how);
|
||||
Result htcsSocketFcntl(HtcsSocket *s, s32 *out_err, s32 *out_res, s32 command, s32 value);
|
||||
|
||||
Result htcsSocketAcceptStart(HtcsSocket *s, u32 *out_task_id, Handle *out_event_handle);
|
||||
Result htcsSocketAcceptResults(HtcsSocket *s, s32 *out_err, HtcsSocket *out_socket, HtcsSockAddr *out_address, u32 task_id);
|
||||
|
||||
Result htcsSocketRecvStart(HtcsSocket *s, u32 *out_task_id, Handle *out_event_handle, s32 mem_size, s32 flags);
|
||||
Result htcsSocketRecvResults(HtcsSocket *s, s32 *out_err, s64 *out_size, void *buffer, size_t buffer_size, u32 task_id);
|
||||
|
||||
Result htcsSocketSendStart(HtcsSocket *s, u32 *out_task_id, Handle *out_event_handle, const void *buffer, size_t buffer_size, s32 flags);
|
||||
Result htcsSocketSendResults(HtcsSocket *s, s32 *out_err, s64 *out_size, u32 task_id);
|
||||
|
||||
Result htcsSocketStartSend(HtcsSocket *s, u32 *out_task_id, Handle *out_event_handle, s64 *out_max_size, s64 size, s32 flags);
|
||||
Result htcsSocketContinueSend(HtcsSocket *s, s64 *out_size, bool *out_wait, const void *buffer, size_t buffer_size, u32 task_id);
|
||||
Result htcsSocketEndSend(HtcsSocket *s, s32 *out_err, s64 *out_size, u32 task_id);
|
||||
|
||||
Result htcsSocketStartRecv(HtcsSocket *s, u32 *out_task_id, Handle *out_event_handle, s64 size, s32 flags);
|
||||
Result htcsSocketEndRecv(HtcsSocket *s, s32 *out_err, s64 *out_size, void *buffer, size_t buffer_size, u32 task_id);
|
||||
|
||||
Result htcsSocketGetPrimitive(HtcsSocket *s, s32 *out);
|
||||
|
||||
void htcsCloseSocket(HtcsSocket *s);
|
@ -1,55 +0,0 @@
|
||||
/**
|
||||
* @file ins.h
|
||||
* @brief INS services IPC wrapper.
|
||||
* @author averne
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
/// Initialize ins:r.
|
||||
Result insrInitialize(void);
|
||||
|
||||
/// Exit ins:r.
|
||||
void insrExit(void);
|
||||
|
||||
/// Gets the Service object for the actual ins:r service session.
|
||||
Service* insrGetServiceSession(void);
|
||||
|
||||
/**
|
||||
* @brief Retrieves the last system tick the event corresponding to the ID was signaled at.
|
||||
* @param[in] id Ins request ID (should be 0..4).
|
||||
* @param[out] tick.
|
||||
* @return Result code.
|
||||
* @note The tick is only updated once per second at minimum.
|
||||
*/
|
||||
Result insrGetLastTick(u32 id, u64 *tick);
|
||||
|
||||
/**
|
||||
* @brief Retrieves the event corresponding to the ID.
|
||||
* @param[in] id Ins request ID (should be 0..4).
|
||||
* @param[out] out.
|
||||
* @return Result code.
|
||||
* @note The event is only signaled once per second at minimum.
|
||||
*/
|
||||
Result insrGetReadableEvent(u32 id, Event *out);
|
||||
|
||||
/// Initialize ins:s.
|
||||
Result inssInitialize(void);
|
||||
|
||||
/// Exit ins:s.
|
||||
void inssExit(void);
|
||||
|
||||
/// Gets the Service object for the actual ins:s service session.
|
||||
Service* inssGetServiceSession(void);
|
||||
|
||||
/**
|
||||
* @brief Retrieves the event corresponding to the ID.
|
||||
* @param[in] id Ins send ID (should be 0..11).
|
||||
* @param[out] out.
|
||||
* @return Result code.
|
||||
* @note The returned event cannot be waited on, only signaled. Clearing is handled by the service.
|
||||
*/
|
||||
Result inssGetWritableEvent(u32 id, Event *out);
|
@ -391,7 +391,7 @@ Service* irsGetServiceSession(void);
|
||||
void* irsGetSharedmemAddr(void);
|
||||
|
||||
/// Gets the \ref IrsIrCameraHandle for the specified controller.
|
||||
Result irsGetIrCameraHandle(IrsIrCameraHandle *handle, HidNpadIdType id);
|
||||
Result irsGetIrCameraHandle(IrsIrCameraHandle *handle, HidControllerID id);
|
||||
|
||||
/// GetIrCameraStatus
|
||||
Result irsGetIrCameraStatus(IrsIrCameraHandle handle, IrsIrCameraStatus *out);
|
||||
|
@ -67,12 +67,6 @@ typedef enum {
|
||||
LdnWirelessControllerRestriction_Unknown1 = 1, ///< Unknown
|
||||
} LdnWirelessControllerRestriction;
|
||||
|
||||
/// Protocol
|
||||
typedef enum {
|
||||
LdnProtocol_NX = 1, ///< NX (default)
|
||||
LdnProtocol_Unknown3 = 3, ///< (NXAndOunce?)
|
||||
} LdnProtocol;
|
||||
|
||||
/// Ipv4Address. This is essentially the same as struct in_addr - hence this can be used with standard sockets (byteswap required).
|
||||
typedef struct {
|
||||
u32 addr; ///< Address
|
||||
@ -193,15 +187,6 @@ typedef struct {
|
||||
u8 reserved_x16[0xA]; ///< Cleared to zero for the tmp struct.
|
||||
} LdnNetworkConfig;
|
||||
|
||||
/// ActionFrameSettings
|
||||
typedef struct {
|
||||
s64 local_communication_id; ///< LocalCommunicationId (Same handling as LdnNetworkConfig::local_communication_id)
|
||||
u8 reserved[0x34]; ///< Reserved
|
||||
u16 security_mode; ///< SecurityMode (Must be 1-2, internally this is overriden)
|
||||
u16 passphrase_size; ///< PassphraseSize (Must be 0x10-0x40)
|
||||
u8 passphrase[0x40]; ///< Passphrase
|
||||
} LdnActionFrameSettings;
|
||||
|
||||
///@name ldn:m
|
||||
///@{
|
||||
|
||||
@ -346,14 +331,6 @@ Result ldnScanPrivate(s32 channel, const LdnScanFilter *filter, LdnNetworkInfo *
|
||||
*/
|
||||
Result ldnSetWirelessControllerRestriction(LdnWirelessControllerRestriction restriction);
|
||||
|
||||
/**
|
||||
* @brief SetProtocol
|
||||
* @note This is only usable with [20.0.0+] (with [18.0.0-19-0.1] this is available but not usable).
|
||||
* @note \ref LdnState must be ::LdnState_Initialized. If a non-default Protocol is wanted, use this after \ref ldnInitialize.
|
||||
* @param[in] protocol \ref LdnProtocol
|
||||
*/
|
||||
Result ldnSetProtocol(LdnProtocol protocol);
|
||||
|
||||
/**
|
||||
* @brief OpenAccessPoint
|
||||
* @note \ref LdnState must be ::LdnState_Initialized, this eventually sets the State to ::LdnState_AccessPointOpened.
|
||||
@ -485,71 +462,5 @@ Result ldnDisconnect(void);
|
||||
*/
|
||||
Result ldnSetOperationMode(LdnOperationMode mode);
|
||||
|
||||
/**
|
||||
* @brief EnableActionFrame
|
||||
* @note Only available on [18.0.0+].
|
||||
* @note \ref LdnState must be ::LdnState_Initialized.
|
||||
* @param[in] settings \ref LdnActionFrameSettings
|
||||
*/
|
||||
Result ldnEnableActionFrame(const LdnActionFrameSettings *settings);
|
||||
|
||||
/**
|
||||
* @brief DisableActionFrame
|
||||
* @note Only available on [18.0.0+].
|
||||
* @note \ref LdnState must be ::LdnState_Initialized.
|
||||
*/
|
||||
Result ldnDisableActionFrame(void);
|
||||
|
||||
/**
|
||||
* @brief SendActionFrame
|
||||
* @note Only available on [18.0.0+].
|
||||
* @note \ref LdnState must be ::LdnState_AccessPointCreated / ::LdnState_StationOpened.
|
||||
* @param[in] data Data buffer.
|
||||
* @param[in] size Data buffer size.
|
||||
* @param[in] destination Destination \ref LdnMacAddress.
|
||||
* @param[in] bssid Bssid \ref LdnMacAddress.
|
||||
* @param[in] channel Channel, must be non-zero.
|
||||
* @param[in] flags MessageFlag bit0 clear = block until the data can be sent, set = return error when the data can't be sent.
|
||||
*/
|
||||
Result ldnSendActionFrame(const void* data, size_t size, LdnMacAddress destination, LdnMacAddress bssid, s16 channel, u32 flags);
|
||||
|
||||
/**
|
||||
* @brief RecvActionFrame
|
||||
* @note Only available on [18.0.0+].
|
||||
* @note \ref ldnEnableActionFrame must be used prior to this.
|
||||
* @param[out] data Output data buffer.
|
||||
* @param[in] size Max size of the data buffer.
|
||||
* @param[out] addr0 First \ref LdnMacAddress.
|
||||
* @param[out] addr1 Second \ref LdnMacAddress.
|
||||
* @param[out] channel Channel
|
||||
* @param[out] out_size Output size.
|
||||
* @param[out] link_level LinkLevel
|
||||
* @param[in] flags MessageFlag bit0 clear = block until data is available, set = return error when data is not available.
|
||||
*/
|
||||
Result ldnRecvActionFrame(void* data, size_t size, LdnMacAddress *addr0, LdnMacAddress *addr1, s16 *channel, u32 *out_size, s32 *link_level, u32 flags);
|
||||
|
||||
/**
|
||||
* @brief SetHomeChannel
|
||||
* @note Only available on [18.0.0+].
|
||||
* @note \ref LdnState must be ::LdnState_StationOpened.
|
||||
* @param[in] channel Channel, must be non-zero.
|
||||
*/
|
||||
Result ldnSetHomeChannel(s16 channel);
|
||||
|
||||
/**
|
||||
* @brief SetTxPower
|
||||
* @note Only available on [18.0.0+].
|
||||
* @note \ref LdnState must be ::LdnState_AccessPoint* / ::LdnState_Station*.
|
||||
* @param[in] power Power, must be 0x0..0xFF.
|
||||
*/
|
||||
Result ldnSetTxPower(s16 power);
|
||||
|
||||
/**
|
||||
* @brief ResetTxPower
|
||||
* @note Only available on [18.0.0+].
|
||||
* @note \ref LdnState must be ::LdnState_AccessPoint* / ::LdnState_Station*.
|
||||
*/
|
||||
Result ldnResetTxPower(void);
|
||||
|
||||
///@}
|
||||
|
||||
|
@ -20,20 +20,6 @@ typedef struct {
|
||||
u32 acid_fac_size;
|
||||
u32 aci0_fah_size;
|
||||
u8 ac_buffer[0x3E0];
|
||||
} LoaderProgramInfoV1;
|
||||
|
||||
typedef struct {
|
||||
u8 main_thread_priority;
|
||||
u8 default_cpu_id;
|
||||
u16 application_type;
|
||||
u32 main_thread_stack_size;
|
||||
u64 program_id;
|
||||
u32 acid_sac_size;
|
||||
u32 aci0_sac_size;
|
||||
u32 acid_fac_size;
|
||||
u32 aci0_fah_size;
|
||||
u8 unused_20[0x10];
|
||||
u8 ac_buffer[0x3E0];
|
||||
} LoaderProgramInfo;
|
||||
|
||||
typedef struct {
|
||||
@ -42,11 +28,6 @@ typedef struct {
|
||||
u64 size;
|
||||
} LoaderModuleInfo;
|
||||
|
||||
typedef struct {
|
||||
u8 platform; ///< NcmContentMetaPlatform
|
||||
u8 content_attributes; ///< FsContentAttributes
|
||||
} LoaderProgramAttributes;
|
||||
|
||||
/// Initialize ldr:shel.
|
||||
Result ldrShellInitialize(void);
|
||||
|
||||
@ -81,9 +62,8 @@ Result ldrDmntSetProgramArguments(u64 program_id, const void *args, size_t args_
|
||||
Result ldrDmntFlushArguments(void);
|
||||
Result ldrDmntGetProcessModuleInfo(u64 pid, LoaderModuleInfo *out_module_infos, size_t max_out_modules, s32 *num_out);
|
||||
|
||||
Result ldrPmCreateProcess(u64 pin_id, u32 flags, Handle reslimit_h, const LoaderProgramAttributes *attrs, Handle *out_process_h);
|
||||
Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, const LoaderProgramAttributes *attrs, LoaderProgramInfo *out_program_info); ///< [19.0.0+/Atmosphere]
|
||||
Result ldrPmGetProgramInfoV1(const NcmProgramLocation *loc, LoaderProgramInfoV1 *out_program_info); ///< [1.0.0-18.1.0/Non-Atmosphere]
|
||||
Result ldrPmCreateProcess(u64 pin_id, u32 flags, Handle reslimit_h, Handle *out_process_h);
|
||||
Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, LoaderProgramInfo *out_program_info);
|
||||
Result ldrPmPinProgram(const NcmProgramLocation *loc, u64 *out_pin_id);
|
||||
Result ldrPmUnpinProgram(u64 pin_id);
|
||||
Result ldrPmSetEnabledProgramVerification(bool enabled); ///< [10.0.0+]
|
||||
|
@ -1,339 +0,0 @@
|
||||
/**
|
||||
* @file lp2p.h
|
||||
* @brief lp2p service IPC wrapper, for local-WLAN communications with accessories. See also: https://switchbrew.org/wiki/LDN_services
|
||||
* @note Only available on [9.1.0+].
|
||||
* @author yellows8
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../sf/service.h"
|
||||
#include "../kernel/event.h"
|
||||
|
||||
typedef enum {
|
||||
Lp2pServiceType_App = 0, ///< Initializes lp2p:app.
|
||||
Lp2pServiceType_System = 1, ///< Initializes lp2p:sys.
|
||||
} Lp2pServiceType;
|
||||
|
||||
/// MacAddress
|
||||
typedef struct {
|
||||
u8 addr[6]; ///< Address
|
||||
} Lp2pMacAddress;
|
||||
|
||||
/// GroupId
|
||||
typedef struct {
|
||||
u8 id[0x6]; ///< BSSID
|
||||
} Lp2pGroupId;
|
||||
|
||||
/// GroupInfo
|
||||
/// \ref lp2pScan only uses the following fields for the cmd input struct: supported_platform/priority, frequency/channel, and preshared_key_binary_size/preshared_key.
|
||||
typedef struct {
|
||||
u8 unk_x0[0x10]; ///< When zero, this is set to randomly-generated data. Used during key derivation.
|
||||
u64 local_communication_id; ///< LocalCommunicationId. When zero, the value from the user-process control.nacp is loaded. This is later validated by \ref lp2pJoin / \ref lp2pCreateGroup the same way as LdnNetworkConfig::local_communication_id. Used during key derivation.
|
||||
Lp2pGroupId group_id; ///< Should be all-zero for the input struct so that the default is used.
|
||||
char service_name[0x21]; ///< ServiceName. NUL-terminated string for the SSID. These characters must be '-' or alphanumeric (lowercase/uppercase). '_' must not be used, unless you generate valid data for that. The data for '_' will be automatically generated if it's not present.
|
||||
s8 flags_count; ///< Must be <=0x3F.
|
||||
s8 flags[0x40]; ///< Array of s8 with the above count. Each entry value must be <=0x3F. Each entry is an array index used to load a set of flags from a global array with the specified index.
|
||||
u8 supported_platform; ///< SupportedPlatform. Must match value 1. 0 is PlatformIdNX, 1 is PlatformIdFuji.
|
||||
s8 member_count_max; ///< MemberCountMax. Must be <=0x8. If zero during group-creation, a default of value 1 is used for the value passed to a service-cmd.
|
||||
u8 unk_x82; ///< Unknown
|
||||
u8 unk_x83; ///< Unknown
|
||||
u16 frequency; ///< Wifi frequency: 24 = 2.4GHz, 50 = 5GHz.
|
||||
s16 channel; ///< Wifi channel number. 0 = use default, otherwise this must be one of the following depending on the frequency field. 24: 1, 6, 11. 50: 36, 40, 44, 48.
|
||||
u8 network_mode; ///< NetworkMode
|
||||
u8 performance_requirement; ///< PerformanceRequirement
|
||||
u8 security_type; ///< Security type, used during key derivation. 0 = use defaults, 1 = plaintext, 2 = encrypted. [11.0.0+] 3: Standard WPA2-PSK.
|
||||
s8 static_aes_key_index; ///< StaticAesKeyIndex. Used as the array-index for selecting the KeySource used with GenerateAesKek during key derivation. Should be 1-2, otherwise GenerateAesKek is skipped and zeros are used for the AccessKey instead.
|
||||
u8 unk_x8C; ///< Unknown
|
||||
u8 priority; ///< Priority. Must match one of the following, depending on the used service (doesn't apply to \ref lp2pJoin): 55 = SystemPriority (lp2p:sys), 90 = ApplicationPriority (lp2p:app and lp2p:sys).
|
||||
u8 stealth_enabled; ///< StealthEnabled. Bool flag, controls whether the SSID is hidden.
|
||||
u8 unk_x8F; ///< If zero, a default value of 0x20 is used.
|
||||
u8 unk_x90[0x130]; ///< Unknown
|
||||
u8 preshared_key_binary_size; ///< PresharedKeyBinarySize
|
||||
u8 preshared_key[0x3F]; ///< PresharedKey. Used during key derivation.
|
||||
} Lp2pGroupInfo;
|
||||
|
||||
/// ScanResult
|
||||
typedef struct {
|
||||
Lp2pGroupInfo group_info; ///< \ref Lp2pGroupInfo
|
||||
u8 unk_x200; ///< Unknown
|
||||
u8 unk_x201[0x5]; ///< Unknown
|
||||
u16 advertise_data_size; ///< Size of the following AdvertiseData.
|
||||
u8 advertise_data[0x80]; ///< AdvertiseData, with the above size. This originates from \ref lp2pSetAdvertiseData.
|
||||
u8 unk_x288[0x78]; ///< Unknown
|
||||
} Lp2pScanResult;
|
||||
|
||||
/// NodeInfo
|
||||
typedef struct {
|
||||
u8 ip_addr[0x20]; ///< struct sockaddr for the IP address.
|
||||
u8 unk_x20[0x4]; ///< Unknown
|
||||
Lp2pMacAddress mac_addr; ///< \ref Lp2pMacAddress
|
||||
u8 unk_x2A[0x56]; ///< Unknown
|
||||
} Lp2pNodeInfo;
|
||||
|
||||
/// IpConfig. Only contains IPv4 addresses.
|
||||
typedef struct {
|
||||
u8 unk_x0[0x20]; ///< Always zeros.
|
||||
u8 ip_addr[0x20]; ///< struct sockaddr for the IP address.
|
||||
u8 subnet_mask[0x20]; ///< struct sockaddr for the subnet-mask.
|
||||
u8 gateway[0x20]; ///< struct sockaddr for the gateway(?).
|
||||
u8 unk_x80[0x80]; ///< Always zeros.
|
||||
} Lp2pIpConfig;
|
||||
|
||||
/// Initialize lp2p.
|
||||
Result lp2pInitialize(Lp2pServiceType service_type);
|
||||
|
||||
/// Exit lp2p.
|
||||
void lp2pExit(void);
|
||||
|
||||
/// Gets the Service object for INetworkService.
|
||||
Service* lp2pGetServiceSession_INetworkService(void);
|
||||
|
||||
/// Gets the Service object for INetworkServiceMonitor.
|
||||
Service* lp2pGetServiceSession_INetworkServiceMonitor(void);
|
||||
|
||||
/**
|
||||
* @brief Creates a default \ref Lp2pGroupInfo for use with \ref lp2pCreateGroup / \ref lp2pJoin.
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
*/
|
||||
void lp2pCreateGroupInfo(Lp2pGroupInfo *info);
|
||||
|
||||
/**
|
||||
* @brief Creates a default \ref Lp2pGroupInfo for use with \ref lp2pScan.
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
*/
|
||||
void lp2pCreateGroupInfoScan(Lp2pGroupInfo *info);
|
||||
|
||||
/**
|
||||
* @brief Sets Lp2pGroupInfo::service_name.
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
* @param[in] name ServiceName / SSID.
|
||||
*/
|
||||
void lp2pGroupInfoSetServiceName(Lp2pGroupInfo *info, const char *name);
|
||||
|
||||
/**
|
||||
* @brief Sets Lp2pGroupInfo::flags_count and Lp2pGroupInfo::flags.
|
||||
* @note The default is count=1 flags[0]=1, which is used by \ref lp2pCreateGroupInfo. [11.0.0+] To use standard WPA2-PSK, you can use flags[0]=0.
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
* @param[in] flags Lp2pGroupInfo::flags
|
||||
* @param[in] count Lp2pGroupInfo::flags_count
|
||||
*/
|
||||
void lp2pGroupInfoSetFlags(Lp2pGroupInfo *info, s8 *flags, size_t count);
|
||||
|
||||
/**
|
||||
* @brief Sets Lp2pGroupInfo::member_count_max.
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
* @param[in] count MemberCountMax
|
||||
*/
|
||||
NX_CONSTEXPR void lp2pGroupInfoSetMemberCountMax(Lp2pGroupInfo *info, size_t count) {
|
||||
info->member_count_max = count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets Lp2pGroupInfo::frequency and Lp2pGroupInfo::channel.
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
* @param[in] frequency Lp2pGroupInfo::frequency
|
||||
* @param[in] channel Lp2pGroupInfo::channel
|
||||
*/
|
||||
NX_CONSTEXPR void lp2pGroupInfoSetFrequencyChannel(Lp2pGroupInfo *info, u16 frequency, s16 channel) {
|
||||
info->frequency = frequency;
|
||||
info->channel = channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets Lp2pGroupInfo::stealth_enabled.
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
* @param[in] flag Lp2pGroupInfo::stealth_enabled
|
||||
*/
|
||||
NX_CONSTEXPR void lp2pGroupInfoSetStealthEnabled(Lp2pGroupInfo *info, bool flag) {
|
||||
info->stealth_enabled = flag!=0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the PresharedKey for the specified \ref Lp2pGroupInfo.
|
||||
* @note Using this is required before using the \ref Lp2pGroupInfo as input for any cmds, so that Lp2pGroupInfo::preshared_key_binary_size gets initialized.
|
||||
* @note If standard WPA2-PSK is being used, use \ref lp2pGroupInfoSetPassphrase instead.
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
* @param[in] key Data for the PresharedKey.
|
||||
* @param[in] size Size to copy into the PresharedKey, max is 0x20.
|
||||
*/
|
||||
void lp2pGroupInfoSetPresharedKey(Lp2pGroupInfo *info, const void* key, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Sets the passphrase, for when standard WPA2-PSK is being used.
|
||||
* @note Configure standard WPA2-PSK usage via \ref lp2pGroupInfoSetFlags / Lp2pGroupInfo::security_type.
|
||||
* @note Only available on [11.0.0+].
|
||||
* @param info \ref Lp2pGroupInfo
|
||||
* @param[in] passphrase Passphrase string, the required length is 0x8-0x3F.
|
||||
*/
|
||||
Result lp2pGroupInfoSetPassphrase(Lp2pGroupInfo *info, const char *passphrase);
|
||||
|
||||
///@name INetworkService
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief Scan
|
||||
* @param[in] info \ref Lp2pGroupInfo
|
||||
* @param[out] results Output array of \ref Lp2pScanResult.
|
||||
* @param[in] count Size of the results array in entries.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result lp2pScan(const Lp2pGroupInfo *info, Lp2pScanResult *results, s32 count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief CreateGroup
|
||||
* @note The role (\ref lp2pGetRole) must be 0. This eventually sets the role to value 1.
|
||||
* @param[in] info \ref Lp2pGroupInfo
|
||||
*/
|
||||
Result lp2pCreateGroup(const Lp2pGroupInfo *info);
|
||||
|
||||
/**
|
||||
* @brief This destroys the previously created group from \ref lp2pCreateGroup.
|
||||
* @note If no group was previously created (role from \ref lp2pGetRole is not 1), this just returns 0.
|
||||
*/
|
||||
Result lp2pDestroyGroup(void);
|
||||
|
||||
/**
|
||||
* @brief SetAdvertiseData
|
||||
* @note The role (\ref lp2pGetRole) must be <=1.
|
||||
* @note An empty buffer (buffer=NULL/size=0) can be used to reset the AdvertiseData size in state to zero.
|
||||
* @param[out] buffer Input buffer containing arbitrary user data.
|
||||
* @param[in] size Input buffer size, must be <=0x80.
|
||||
*/
|
||||
Result lp2pSetAdvertiseData(const void* buffer, size_t size);
|
||||
|
||||
/**
|
||||
* @brief This sends an Action frame to the specified \ref Lp2pGroupId, with the specified destination \ref Lp2pMacAddress.
|
||||
* @note The role (\ref lp2pGetRole) must be non-zero.
|
||||
* @note The error from \ref lp2pGetNetworkInterfaceLastError will be returned if it's set.
|
||||
* @note [11.0.0+] Lp2pGroupInfo::security_type must be value 2 (default encryption), otherwise an error is returned.
|
||||
* @param[in] buffer Input buffer containing arbitrary user data.
|
||||
* @param[in] size Input buffer size, must be <=0x400.
|
||||
* @param[in] addr \ref Lp2pMacAddress, this can be a broadcast address. This must be non-zero.
|
||||
* @param[in] group_id \ref Lp2pGroupId
|
||||
* @param[in] frequency Must be >=1. See Lp2pGroupInfo::frequency.
|
||||
* @param[in] channel Must be >=1. See Lp2pGroupInfo::channel.
|
||||
* @param[in] flags Only bit0 is used: clear = block until the data can be sent, set = return error when the data can't be sent.
|
||||
*/
|
||||
Result lp2pSendToOtherGroup(const void* buffer, size_t size, Lp2pMacAddress addr, Lp2pGroupId group_id, s16 frequency, s16 channel, u32 flags);
|
||||
|
||||
/**
|
||||
* @brief This receives an Action frame.
|
||||
* @note The role (\ref lp2pGetRole) must be non-zero.
|
||||
* @note When data is not available, the error from \ref lp2pGetNetworkInterfaceLastError will be returned if it's set.
|
||||
* @param[out] buffer Output buffer containing arbitrary user data.
|
||||
* @param[in] size Output buffer size.
|
||||
* @param[in] flags Only bit0 is used: clear = block until data is available, set = return error when data is not available.
|
||||
* @param[in] addr \ref Lp2pMacAddress
|
||||
* @param[in] unk0 Unknown
|
||||
* @param[in] unk1 Unknown
|
||||
* @param[out] out_size This is the original size used for copying to the output buffer, before it's clamped to the output-buffer size.
|
||||
* @param[out] unk2 Unknown
|
||||
*/
|
||||
Result lp2pRecvFromOtherGroup(void* buffer, size_t size, u32 flags, Lp2pMacAddress *addr, u16 *unk0, s32 *unk1, u64 *out_size, s32 *unk2);
|
||||
|
||||
/**
|
||||
* @brief AddAcceptableGroupId
|
||||
* @param[in] group_id \ref Lp2pGroupId
|
||||
*/
|
||||
Result lp2pAddAcceptableGroupId(Lp2pGroupId group_id);
|
||||
|
||||
/**
|
||||
* @brief RemoveAcceptableGroupId
|
||||
*/
|
||||
Result lp2pRemoveAcceptableGroupId(void);
|
||||
|
||||
///@name INetworkServiceMonitor
|
||||
///@{
|
||||
|
||||
/**
|
||||
* @brief AttachNetworkInterfaceStateChangeEvent
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=false.
|
||||
*/
|
||||
Result lp2pAttachNetworkInterfaceStateChangeEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetNetworkInterfaceLastError
|
||||
*/
|
||||
Result lp2pGetNetworkInterfaceLastError(void);
|
||||
|
||||
/**
|
||||
* @brief GetRole
|
||||
* @param[out] out Output Role.
|
||||
*/
|
||||
Result lp2pGetRole(u8 *out);
|
||||
|
||||
/**
|
||||
* @brief GetAdvertiseData
|
||||
* @note The role from \ref lp2pGetRole must be value 2.
|
||||
* @param[out] buffer Output buffer data.
|
||||
* @param[in] size Output buffer size.
|
||||
* @param[out] transfer_size Size of the data copied into the buffer.
|
||||
* @param[out] original_size Original size from state.
|
||||
*/
|
||||
Result lp2pGetAdvertiseData(void* buffer, size_t size, u16 *transfer_size, u16 *original_size);
|
||||
|
||||
/**
|
||||
* @brief GetAdvertiseData2
|
||||
* @note This is identical to \ref lp2pGetAdvertiseData except this doesn't run the role validation.
|
||||
* @param[out] buffer Output buffer data.
|
||||
* @param[in] size Output buffer size.
|
||||
* @param[out] transfer_size Size of the data copied into the buffer.
|
||||
* @param[out] original_size Original size from state.
|
||||
*/
|
||||
Result lp2pGetAdvertiseData2(void* buffer, size_t size, u16 *transfer_size, u16 *original_size);
|
||||
|
||||
/**
|
||||
* @brief GetGroupInfo
|
||||
* @note The role from \ref lp2pGetRole must be non-zero.
|
||||
* @param[out] out \ref Lp2pGroupInfo
|
||||
*/
|
||||
Result lp2pGetGroupInfo(Lp2pGroupInfo *out);
|
||||
|
||||
/**
|
||||
* @brief This runs the same code as \ref lp2pCreateGroup to generate the \ref Lp2pGroupInfo for the input struct.
|
||||
* @param[out] out \ref Lp2pGroupInfo
|
||||
* @param[in] info \ref Lp2pGroupInfo
|
||||
*/
|
||||
Result lp2pJoin(Lp2pGroupInfo *out, const Lp2pGroupInfo *info);
|
||||
|
||||
/**
|
||||
* @brief GetGroupOwner
|
||||
* @note The role from \ref lp2pGetRole must be non-zero.
|
||||
* @param[out] out \ref Lp2pNodeInfo
|
||||
*/
|
||||
Result lp2pGetGroupOwner(Lp2pNodeInfo *out);
|
||||
|
||||
/**
|
||||
* @brief GetIpConfig
|
||||
* @note The role from \ref lp2pGetRole must be non-zero.
|
||||
* @param[out] out \ref Lp2pIpConfig
|
||||
*/
|
||||
Result lp2pGetIpConfig(Lp2pIpConfig *out);
|
||||
|
||||
/**
|
||||
* @brief Leave
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result lp2pLeave(u32 *out);
|
||||
|
||||
/**
|
||||
* @brief AttachJoinEvent
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=false.
|
||||
*/
|
||||
Result lp2pAttachJoinEvent(Event* out_event);
|
||||
|
||||
/**
|
||||
* @brief GetMembers
|
||||
* @note The role from \ref lp2pGetRole must be value 1.
|
||||
* @param[out] members Output array of \ref Lp2pNodeInfo.
|
||||
* @param[in] count Size of the members array in entries. A maximum of 8 entries can be returned.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result lp2pGetMembers(Lp2pNodeInfo *members, s32 count, s32 *total_out);
|
||||
|
||||
///@}
|
||||
|
@ -113,27 +113,6 @@ typedef struct {
|
||||
u8 unk_x57;
|
||||
} MiiCharInfo;
|
||||
|
||||
typedef struct {
|
||||
u8 data[0x44];
|
||||
} MiiStoreData;
|
||||
|
||||
// Mii format used in 3DS (https://www.3dbrew.org/wiki/Mii#Mii_format).
|
||||
typedef struct {
|
||||
u8 data[0x5C];
|
||||
} MiiVer3StoreData;
|
||||
|
||||
// Original Mii colors and types before Ver3StoreData conversion
|
||||
typedef struct {
|
||||
u8 faceline_color;
|
||||
u8 hair_color;
|
||||
u8 eye_color;
|
||||
u8 eyebrow_color;
|
||||
u8 mouth_color;
|
||||
u8 beard_color;
|
||||
u8 glass_color;
|
||||
u8 glass_type;
|
||||
} MiiNfpStoreDataExtension;
|
||||
|
||||
/// Initialize mii.
|
||||
Result miiInitialize(MiiServiceType service_type);
|
||||
|
||||
|
@ -20,7 +20,7 @@ typedef struct {
|
||||
MiiCreateId create_id; ///< Mii's create ID.
|
||||
u32 unk;
|
||||
u16 mii_name[10+1]; ///< utf-16be, null-terminated
|
||||
} NX_PACKED MiiimgImageAttribute;
|
||||
} PACKED MiiimgImageAttribute;
|
||||
|
||||
/// Initialize miiimg.
|
||||
Result miiimgInitialize(void);
|
||||
|
@ -1,31 +0,0 @@
|
||||
/**
|
||||
* @file mmu.h
|
||||
* @brief Multimedia (mm) IPC wrapper.
|
||||
* @author averne
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
typedef enum {
|
||||
MmuModuleId_Ram = 2,
|
||||
MmuModuleId_Nvenc = 5,
|
||||
MmuModuleId_Nvdec = 6,
|
||||
MmuModuleId_Nvjpg = 7,
|
||||
} MmuModuleId;
|
||||
|
||||
typedef struct {
|
||||
MmuModuleId module;
|
||||
u32 id;
|
||||
} MmuRequest;
|
||||
|
||||
Result mmuInitialize(void);
|
||||
void mmuExit(void);
|
||||
Service* mmuGetServiceSession(void);
|
||||
|
||||
Result mmuRequestInitialize(MmuRequest *request, MmuModuleId module, u32 unk, bool autoclear); ///< unk is ignored by official software
|
||||
Result mmuRequestFinalize(const MmuRequest *request);
|
||||
Result mmuRequestGet(const MmuRequest *request, u32 *out_freq_hz);
|
||||
Result mmuRequestSetAndWait(const MmuRequest *request, u32 freq_hz, s32 timeout);
|
@ -50,7 +50,6 @@ Result ncmInactivateContentStorage(NcmStorageId storage_id); ///< [2.0.0+]
|
||||
Result ncmActivateContentMetaDatabase(NcmStorageId storage_id); ///< [2.0.0+]
|
||||
Result ncmInactivateContentMetaDatabase(NcmStorageId storage_id); ///< [2.0.0+]
|
||||
Result ncmInvalidateRightsIdCache(void); ///< [9.0.0+]
|
||||
Result ncmActivateFsContentStorage(FsContentStorageId fs_storage_id); ///< [16.0.0+]
|
||||
|
||||
void ncmContentStorageClose(NcmContentStorage* cs);
|
||||
Result ncmContentStorageGeneratePlaceHolderId(NcmContentStorage* cs, NcmPlaceHolderId* out_id);
|
||||
@ -72,18 +71,15 @@ Result ncmContentStorageDisableForcibly(NcmContentStorage* cs);
|
||||
Result ncmContentStorageRevertToPlaceHolder(NcmContentStorage* cs, const NcmPlaceHolderId* placeholder_id, const NcmContentId* old_content_id, const NcmContentId* new_content_id); ///< [2.0.0+]
|
||||
Result ncmContentStorageSetPlaceHolderSize(NcmContentStorage* cs, const NcmPlaceHolderId* placeholder_id, s64 size); ///< [2.0.0+]
|
||||
Result ncmContentStorageReadContentIdFile(NcmContentStorage* cs, void* out_data, size_t out_data_size, const NcmContentId* content_id, s64 offset); ///< [2.0.0+]
|
||||
Result ncmContentStorageGetRightsIdFromPlaceHolderId(NcmContentStorage* cs, NcmRightsId* out_rights_id, const NcmPlaceHolderId* placeholder_id, FsContentAttributes attr); ///< [2.0.0+]
|
||||
Result ncmContentStorageGetRightsIdFromContentId(NcmContentStorage* cs, NcmRightsId* out_rights_id, const NcmContentId* content_id, FsContentAttributes attr); ///< [2.0.0+]
|
||||
Result ncmContentStorageGetRightsIdFromPlaceHolderId(NcmContentStorage* cs, NcmRightsId* out_rights_id, const NcmPlaceHolderId* placeholder_id); ///< [2.0.0+]
|
||||
Result ncmContentStorageGetRightsIdFromContentId(NcmContentStorage* cs, NcmRightsId* out_rights_id, const NcmContentId* content_id); ///< [2.0.0+]
|
||||
Result ncmContentStorageWriteContentForDebug(NcmContentStorage* cs, const NcmContentId* content_id, s64 offset, const void* data, size_t data_size); ///< [2.0.0+]
|
||||
Result ncmContentStorageGetFreeSpaceSize(NcmContentStorage* cs, s64* out_size); ///< [2.0.0+]
|
||||
Result ncmContentStorageGetTotalSpaceSize(NcmContentStorage* cs, s64* out_size); ///< [2.0.0+]
|
||||
Result ncmContentStorageFlushPlaceHolder(NcmContentStorage* cs); ///< [3.0.0+]
|
||||
Result ncmContentStorageGetSizeFromPlaceHolderId(NcmContentStorage* cs, s64* out_size, const NcmPlaceHolderId* placeholder_id); ///< [4.0.0+]
|
||||
Result ncmContentStorageRepairInvalidFileAttribute(NcmContentStorage* cs); ///< [4.0.0+]
|
||||
Result ncmContentStorageGetRightsIdFromPlaceHolderIdWithCache(NcmContentStorage* cs, NcmRightsId* out_rights_id, const NcmPlaceHolderId* placeholder_id, const NcmContentId* cache_content_id, FsContentAttributes attr); ///< [8.0.0+]
|
||||
Result ncmContentStorageRegisterPath(NcmContentStorage* cs, const NcmContentId* content_id, const char *path); ///< [13.0.0+]
|
||||
Result ncmContentStorageClearRegisteredPath(NcmContentStorage* cs); ///< [13.0.0+]
|
||||
Result ncmContentStorageGetProgramId(NcmContentStorage* cs, u64* out, const NcmContentId* content_id, FsContentAttributes attr); ///< [17.0.0+]
|
||||
Result ncmContentStorageGetRightsIdFromPlaceHolderIdWithCache(NcmContentStorage* cs, NcmRightsId* out_rights_id, const NcmPlaceHolderId* placeholder_id, const NcmContentId* cache_content_id); ///< [8.0.0+]
|
||||
|
||||
void ncmContentMetaDatabaseClose(NcmContentMetaDatabase* db);
|
||||
Result ncmContentMetaDatabaseSet(NcmContentMetaDatabase* db, const NcmContentMetaKey* key, const void* data, u64 data_size);
|
||||
@ -98,7 +94,7 @@ Result ncmContentMetaDatabaseHas(NcmContentMetaDatabase* db, bool* out, const Nc
|
||||
Result ncmContentMetaDatabaseHasAll(NcmContentMetaDatabase* db, bool* out, const NcmContentMetaKey* keys, s32 count);
|
||||
Result ncmContentMetaDatabaseGetSize(NcmContentMetaDatabase* db, u64* out_size, const NcmContentMetaKey* key);
|
||||
Result ncmContentMetaDatabaseGetRequiredSystemVersion(NcmContentMetaDatabase* db, u32* out_version, const NcmContentMetaKey* key);
|
||||
Result ncmContentMetaDatabaseGetPatchContentMetaId(NcmContentMetaDatabase* db, u64* out_patch_id, const NcmContentMetaKey* key);
|
||||
Result ncmContentMetaDatabaseGetPatchId(NcmContentMetaDatabase* db, u64* out_patch_id, const NcmContentMetaKey* key);
|
||||
Result ncmContentMetaDatabaseDisableForcibly(NcmContentMetaDatabase* db);
|
||||
Result ncmContentMetaDatabaseLookupOrphanContent(NcmContentMetaDatabase* db, bool* out_orphaned, const NcmContentId* content_ids, s32 count);
|
||||
Result ncmContentMetaDatabaseCommit(NcmContentMetaDatabase* db);
|
||||
@ -107,4 +103,3 @@ Result ncmContentMetaDatabaseListContentMetaInfo(NcmContentMetaDatabase* db, s32
|
||||
Result ncmContentMetaDatabaseGetAttributes(NcmContentMetaDatabase* db, const NcmContentMetaKey* key, u8* out);
|
||||
Result ncmContentMetaDatabaseGetRequiredApplicationVersion(NcmContentMetaDatabase* db, u32* out_version, const NcmContentMetaKey* key); ///< [2.0.0+]
|
||||
Result ncmContentMetaDatabaseGetContentIdByTypeAndIdOffset(NcmContentMetaDatabase* db, NcmContentId* out_content_id, const NcmContentMetaKey* key, NcmContentType type, u8 id_offset); ///< [5.0.0+]
|
||||
Result ncmContentMetaDatabaseGetPlatform(NcmContentMetaDatabase* db, u8* out, const NcmContentMetaKey* key); ///< [17.0.0+]
|
||||
|
@ -42,7 +42,6 @@ typedef enum {
|
||||
NcmContentMetaType_Patch = 0x81, ///< Patch
|
||||
NcmContentMetaType_AddOnContent = 0x82, ///< AddOnContent
|
||||
NcmContentMetaType_Delta = 0x83, ///< Delta
|
||||
NcmContentMetaType_DataPatch = 0x84, ///< DataPatch
|
||||
} NcmContentMetaType;
|
||||
|
||||
/// ContentMetaAttribute
|
||||
@ -50,7 +49,6 @@ typedef enum {
|
||||
NcmContentMetaAttribute_None = 0, ///< None
|
||||
NcmContentMetaAttribute_IncludesExFatDriver = BIT(0), ///< IncludesExFatDriver
|
||||
NcmContentMetaAttribute_Rebootless = BIT(1), ///< Rebootless
|
||||
NcmContentMetaAttribute_Compacted = BIT(2), ///< Compacted
|
||||
} NcmContentMetaAttribute;
|
||||
|
||||
/// ContentInstallType
|
||||
@ -60,19 +58,14 @@ typedef enum {
|
||||
NcmContentInstallType_Unknown = 7, ///< Unknown
|
||||
} NcmContentInstallType;
|
||||
|
||||
/// ContentMetaPlatform
|
||||
typedef enum {
|
||||
NcmContentMetaPlatform_Nx = 0, ///< Nx
|
||||
} NcmContentMetaPlatform;
|
||||
|
||||
/// ContentId
|
||||
typedef struct {
|
||||
u8 c[0x10]; ///< Id
|
||||
alignas(4) u8 c[0x10]; ///< Id
|
||||
} NcmContentId;
|
||||
|
||||
/// PlaceHolderId
|
||||
typedef struct {
|
||||
Uuid uuid; ///< UUID
|
||||
alignas(8) Uuid uuid; ///< UUID
|
||||
} NcmPlaceHolderId;
|
||||
|
||||
/// ContentMetaKey
|
||||
@ -93,9 +86,7 @@ typedef struct {
|
||||
/// ContentInfo
|
||||
typedef struct {
|
||||
NcmContentId content_id; ///< \ref NcmContentId
|
||||
u32 size_low; ///< Content size (low).
|
||||
u8 size_high; ///< Content size (high).
|
||||
u8 attr; ///< Content attributes.
|
||||
u8 size[0x6]; ///< Content size.
|
||||
u8 content_type; ///< \ref NcmContentType.
|
||||
u8 id_offset; ///< Offset of this content. Unused by most applications.
|
||||
} NcmContentInfo;
|
||||
@ -139,30 +130,12 @@ typedef struct {
|
||||
u8 reserved[0x8]; ///< Unused.
|
||||
} NcmPatchMetaExtendedHeader;
|
||||
|
||||
/// AddOnContentMetaExtendedHeader [15.0.0+]
|
||||
typedef struct {
|
||||
u64 application_id; ///< ApplicationId of this add-on-content's corresponding application.
|
||||
u32 required_application_version; ///< Version of the application required by this add-on-content.
|
||||
u8 content_accessibilities; ///< Content accessibilities.
|
||||
u8 padding[3]; ///< Padding.
|
||||
u64 data_patch_id; ///< DataPatchId of this add-on-content's corresponding data patch.
|
||||
} NcmAddOnContentMetaExtendedHeader;
|
||||
|
||||
/// LegacyAddOnContentMetaExtendedHeader [1.0.0-14.1.2]
|
||||
/// AddOnContentMetaExtendedHeader
|
||||
typedef struct {
|
||||
u64 application_id; ///< ApplicationId of this add-on-content's corresponding application.
|
||||
u32 required_application_version; ///< Version of the application required by this add-on-content.
|
||||
u32 padding; ///< Padding.
|
||||
} NcmLegacyAddOnContentMetaExtendedHeader;
|
||||
|
||||
/// DataPatchMetaExtendedHeader
|
||||
typedef struct {
|
||||
u64 data_id; ///< DataId of this data patch's corresponding add-on-content.
|
||||
u64 application_id; ///< ApplicationId of this data patch's add-on-content's corresponding application.
|
||||
u32 required_application_version; ///< Version of the application required by this data patch.
|
||||
u32 extended_data_size; ///< Size of the extended data following the NcmContentInfos.
|
||||
u64 padding; ///< Padding.
|
||||
} NcmDataPatchMetaExtendedHeader;
|
||||
} NcmAddOnContentMetaExtendedHeader;
|
||||
|
||||
/// SystemUpdateMetaExtendedHeader
|
||||
typedef struct {
|
||||
@ -175,22 +148,3 @@ typedef struct {
|
||||
u8 storageID; ///< \ref NcmStorageId
|
||||
u8 pad[7]; ///< Padding
|
||||
} NcmProgramLocation;
|
||||
|
||||
/**
|
||||
* @brief Retrieves the content size from a \ref NcmContentInfo struct.
|
||||
* @param[in] info Pointer to \ref NcmContentInfo struct.
|
||||
* @param[out] out Output size.
|
||||
*/
|
||||
NX_CONSTEXPR void ncmContentInfoSizeToU64(const NcmContentInfo *info, u64 *out) {
|
||||
*out = ((u64)info->size_high << 32) | info->size_low;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Updates the content size from a \ref NcmContentInfo struct.
|
||||
* @param[in] size Input size.
|
||||
* @param[out] out Pointer to \ref NcmContentInfo struct.
|
||||
*/
|
||||
NX_CONSTEXPR void ncmU64ToContentInfoSize(const u64 size, NcmContentInfo *info) {
|
||||
info->size_low = size & 0xFFFFFFFF;
|
||||
info->size_high = (u8)(size >> 32);
|
||||
}
|
||||
|
@ -1,109 +0,0 @@
|
||||
/**
|
||||
* @file news.h
|
||||
* @brief News service IPC wrapper.
|
||||
* @author Behemoth
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../kernel/event.h"
|
||||
#include "../services/acc.h"
|
||||
#include "../sf/service.h"
|
||||
#include "../types.h"
|
||||
|
||||
typedef enum {
|
||||
NewsServiceType_Administrator = 0, ///< Initializes news:a
|
||||
NewsServiceType_Configuration = 1, ///< Initializes news:c
|
||||
NewsServiceType_Manager = 2, ///< Initializes news:m
|
||||
NewsServiceType_Post = 3, ///< Initializes news:p
|
||||
NewsServiceType_Viewer = 4, ///< Initializes news:v
|
||||
|
||||
NewsServiceType_Count
|
||||
} NewsServiceType;
|
||||
|
||||
typedef struct {
|
||||
char name[0x20];
|
||||
} NewsTopicName;
|
||||
|
||||
typedef struct {
|
||||
Service s;
|
||||
} NewsNewlyArrivedEventHolder;
|
||||
|
||||
typedef struct {
|
||||
Service s;
|
||||
} NewsDataService;
|
||||
|
||||
typedef struct {
|
||||
Service s;
|
||||
} NewsDatabaseService;
|
||||
|
||||
typedef struct {
|
||||
Service s;
|
||||
} NewsOverwriteEventHolder;
|
||||
|
||||
typedef struct {
|
||||
char news_id[0x18];
|
||||
char user_id[0x18];
|
||||
s64 received_at;
|
||||
s32 read;
|
||||
s32 newly;
|
||||
s32 displayed;
|
||||
} NewsRecordV1;
|
||||
|
||||
typedef struct {
|
||||
char news_id[0x18];
|
||||
char user_id[0x18];
|
||||
NewsTopicName topic_id;
|
||||
s64 received_at;
|
||||
s64 pad_0;
|
||||
s32 decoration_type;
|
||||
s32 read;
|
||||
s32 newly;
|
||||
s32 displayed;
|
||||
s32 feedback;
|
||||
s32 pad_1;
|
||||
s32 extra_1;
|
||||
s32 extra_2;
|
||||
} NewsRecord;
|
||||
|
||||
Result newsInitialize(NewsServiceType service_type);
|
||||
void newsExit(void);
|
||||
|
||||
Service *newsGetServiceSession(void);
|
||||
|
||||
Result newsCreateNewlyArrivedEventHolder(NewsNewlyArrivedEventHolder *out);
|
||||
Result newsCreateNewsDataService(NewsDataService *out);
|
||||
Result newsCreateNewsDatabaseService(NewsDatabaseService *out);
|
||||
Result newsCreateOverwriteEventHolder(NewsOverwriteEventHolder *out); ///< [2.0.0+]
|
||||
|
||||
Result newsPostLocalNews(const void *news, size_t size);
|
||||
Result newsSetPassphrase(u64 program_id, const char *passphrase);
|
||||
Result newsGetSubscriptionStatus(const char *filter, u32 *status);
|
||||
Result newsGetTopicList(u32 channel, u32 *out_count, NewsTopicName *out, u32 max_count); ///< [3.0.0+]
|
||||
Result newsGetSavedataUsage(u64 *current, u64 *total); ///< [6.0.0+]
|
||||
Result newsIsSystemUpdateRequired(bool *out);
|
||||
Result newsGetDatabaseVersion(u32 *version); ///< [10.0.0+]
|
||||
Result newsRequestImmediateReception(const char *filter);
|
||||
Result newsSetSubscriptionStatus(const char *filter, u32 status);
|
||||
Result newsClearStorage(void);
|
||||
Result newsClearSubscriptionStatusAll(void);
|
||||
Result newsGetNewsDatabaseDump(void *buffer, u64 size, u64 *out);
|
||||
|
||||
void newsNewlyArrivedEventHolderClose(NewsNewlyArrivedEventHolder *srv);
|
||||
Result newsNewlyArrivedEventHolderGet(NewsNewlyArrivedEventHolder *srv, Event *out);
|
||||
|
||||
void newsDataClose(NewsDataService *srv);
|
||||
Result newsDataOpen(NewsDataService *srv, const char *file_name);
|
||||
Result newsDataOpenWithNewsRecordV1(NewsDataService *srv, NewsRecordV1 *record);
|
||||
Result newsDataRead(NewsDataService *srv, u64 *bytes_read, u64 offset, void *out, size_t out_size);
|
||||
Result newsDataGetSize(NewsDataService *srv, u64 *size);
|
||||
Result newsDataOpenWithNewsRecord(NewsDataService *srv, NewsRecord *record); ///< [6.0.0+]
|
||||
|
||||
void newsDatabaseClose(NewsDatabaseService *srv);
|
||||
Result newsDatabaseGetListV1(NewsDatabaseService *srv, NewsRecordV1 *out, u32 max_count, const char *where, const char *order, u32 *count, u32 offset);
|
||||
Result newsDatabaseCount(NewsDatabaseService *srv, const char *filter, u32 *count);
|
||||
Result newsDatabaseGetList(NewsDatabaseService *srv, NewsRecord *out, u32 max_count, const char *where, const char *order, u32 *count, u32 offset); ///< [6.0.0+]
|
||||
|
||||
void newsOverwriteEventHolderClose(NewsOverwriteEventHolder *srv);
|
||||
Result newsOverwriteEventHolderGet(NewsOverwriteEventHolder *srv, Event *out);
|
@ -24,9 +24,9 @@ typedef enum {
|
||||
} NfcServiceType;
|
||||
|
||||
typedef enum {
|
||||
NfcState_NonInitialized = 0,
|
||||
NfcState_Initialized = 1,
|
||||
} NfcState;
|
||||
NfpState_NonInitialized = 0,
|
||||
NfpState_Initialized = 1,
|
||||
} NfpState;
|
||||
|
||||
typedef enum {
|
||||
NfpDeviceState_Initialized = 0,
|
||||
@ -35,218 +35,51 @@ typedef enum {
|
||||
NfpDeviceState_TagRemoved = 3,
|
||||
NfpDeviceState_TagMounted = 4,
|
||||
NfpDeviceState_Unavailable = 5,
|
||||
NfpDeviceState_Finalized = 6,
|
||||
} NfpDeviceState;
|
||||
|
||||
typedef enum {
|
||||
NfcDeviceState_Initialized = 0,
|
||||
NfcDeviceState_SearchingForTag = 1,
|
||||
NfcDeviceState_TagFound = 2,
|
||||
NfcDeviceState_TagRemoved = 3,
|
||||
NfcDeviceState_TagMounted = 4,
|
||||
} NfcDeviceState;
|
||||
|
||||
typedef enum {
|
||||
NfcMifareDeviceState_Initialized = 0,
|
||||
NfcMifareDeviceState_SearchingForTag = 1,
|
||||
NfcMifareDeviceState_TagFound = 2,
|
||||
NfcMifareDeviceState_TagRemoved = 3,
|
||||
NfcMifareDeviceState_TagMounted = 4,
|
||||
NfcMifareDeviceState_Unavailable = 5,
|
||||
} NfcMifareDeviceState;
|
||||
|
||||
typedef enum {
|
||||
NfpApplicationAreaVersion_3DS = 0, ///< Application area created by a 3DS game.
|
||||
NfpApplicationAreaVersion_WiiU = 1, ///< Application area created by a Wii U game.
|
||||
NfpApplicationAreaVersion_3DSv2 = 2, ///< Application area created by a (new?) 3DS game.
|
||||
NfpApplicationAreaVersion_Switch = 3, ///< Application area created by a Switch game.
|
||||
NfpApplicationAreaVersion_Invalid = 0xFF, ///< Invalid value (application area not created).
|
||||
} NfpApplicationAreaVersion;
|
||||
|
||||
typedef enum {
|
||||
NfpDeviceType_Amiibo = 0,
|
||||
} NfpDeviceType;
|
||||
|
||||
typedef enum {
|
||||
NfpMountTarget_Rom = BIT(0),
|
||||
NfpMountTarget_Ram = BIT(1),
|
||||
NfpMountTarget_All = NfpMountTarget_Rom | NfpMountTarget_Ram,
|
||||
NfpMountTarget_Rom = 1,
|
||||
NfpMountTarget_Ram = 2,
|
||||
NfpMountTarget_All = 3,
|
||||
} NfpMountTarget;
|
||||
|
||||
typedef enum {
|
||||
NfcProtocol_None = 0,
|
||||
NfcProtocol_TypeA = BIT(0), ///< ISO14443A
|
||||
NfcProtocol_TypeB = BIT(1), ///< ISO14443B
|
||||
NfcProtocol_TypeF = BIT(2), ///< Sony FeliCa
|
||||
NfcProtocol_All = 0xFFFFFFFF,
|
||||
} NfcProtocol;
|
||||
|
||||
typedef enum {
|
||||
NfcTagType_None = 0,
|
||||
NfcTagType_Type1 = BIT(0), ///< ISO14443A RW. Topaz
|
||||
NfcTagType_Type2 = BIT(1), ///< ISO14443A RW. Ultralight, NTAGX, ST25TN
|
||||
NfcTagType_Type3 = BIT(2), ///< ISO14443A RW/RO. Sony FeliCa
|
||||
NfcTagType_Type4A = BIT(3), ///< ISO14443A RW/RO. DESFire
|
||||
NfcTagType_Type4B = BIT(4), ///< ISO14443B RW/RO. DESFire
|
||||
NfcTagType_Type5 = BIT(5), ///< ISO15693 RW/RO. SLI, SLIX, ST25TV
|
||||
NfcTagType_Mifare = BIT(6), ///< Mifare clasic. Skylanders
|
||||
NfcTagType_All = 0xFFFFFFFF,
|
||||
} NfcTagType;
|
||||
|
||||
typedef enum {
|
||||
NfcMifareCommand_Read = 0x30,
|
||||
NfcMifareCommand_AuthA = 0x60,
|
||||
NfcMifareCommand_AuthB = 0x61,
|
||||
NfcMifareCommand_Write = 0xA0,
|
||||
NfcMifareCommand_Transfer = 0xB0,
|
||||
NfcMifareCommand_Decrement = 0xC0,
|
||||
NfcMifareCommand_Increment = 0xC1,
|
||||
NfcMifareCommand_Store = 0xC2,
|
||||
} NfcMifareCommand;
|
||||
|
||||
typedef enum {
|
||||
NfpAmiiboFlag_Valid = BIT(0), ///< Initialized in system settings.
|
||||
NfpAmiiboFlag_ApplicationAreaExists = BIT(1), ///< Application area exists.
|
||||
} NfpAmiiboFlag;
|
||||
|
||||
typedef enum {
|
||||
NfpBreakType_Flush = 0,
|
||||
NfpBreakType_Break1 = 1,
|
||||
NfpBreakType_Break2 = 2,
|
||||
} NfpBreakType;
|
||||
typedef struct {
|
||||
u8 uuid[10];
|
||||
u8 uuid_length;
|
||||
u8 reserved1[0x15];
|
||||
u32 protocol;
|
||||
u32 tag_type;
|
||||
u8 reserved2[0x30];
|
||||
} PACKED NfpTagInfo;
|
||||
|
||||
typedef struct {
|
||||
u16 year;
|
||||
u8 month;
|
||||
u8 day;
|
||||
} NfpDate;
|
||||
|
||||
typedef struct {
|
||||
u8 uid[10]; ///< UUID.
|
||||
u8 uid_length; ///< UUID length.
|
||||
u8 reserved[0x15];
|
||||
} NfcTagUid;
|
||||
|
||||
typedef struct {
|
||||
NfcTagUid uid; ///< UUID.
|
||||
u32 protocol; ///< \ref NfcProtocol
|
||||
u32 tag_type; ///< \ref NfcTagType
|
||||
u8 reserved[0x30];
|
||||
} NfpTagInfo;
|
||||
|
||||
typedef struct {
|
||||
NfcTagUid uid; ///< UUID.
|
||||
u32 protocol; ///< \ref NfcProtocol
|
||||
u32 tag_type; ///< \ref NfcTagType
|
||||
u8 reserved[0x30];
|
||||
} NfcTagInfo;
|
||||
|
||||
typedef struct {
|
||||
NfpDate last_write_date;
|
||||
u16 last_write_year;
|
||||
u8 last_write_month;
|
||||
u8 last_write_day;
|
||||
u16 write_counter;
|
||||
u16 version;
|
||||
u32 application_area_size;
|
||||
u8 reserved[0x34];
|
||||
} NfpCommonInfo;
|
||||
u8 reserved[0x34];
|
||||
} PACKED NfpCommonInfo;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
u8 character_id[3];
|
||||
struct {
|
||||
u16 game_character_id;
|
||||
u8 character_variant;
|
||||
} NX_PACKED;
|
||||
};
|
||||
u8 series_id; ///< Series.
|
||||
u16 numbering_id; ///< Model number.
|
||||
u8 nfp_type; ///< Figure type.
|
||||
u8 reserved[0x39];
|
||||
} NfpModelInfo;
|
||||
u8 amiibo_id[0x8];
|
||||
u8 reserved[0x38];
|
||||
} PACKED NfpModelInfo;
|
||||
|
||||
typedef struct {
|
||||
MiiCharInfo mii;
|
||||
NfpDate first_write_date;
|
||||
char amiibo_name[(10*4)+1]; ///< Amiibo name (utf-8, null-terminated).
|
||||
u8 font_region;
|
||||
u8 reserved[0x7A];
|
||||
} NfpRegisterInfo;
|
||||
|
||||
typedef struct {
|
||||
MiiStoreData mii_store_data;
|
||||
NfpDate first_write_date;
|
||||
char amiibo_name[(10*4)+1]; ///< Amiibo name (utf-8, null-terminated).
|
||||
u8 font_region;
|
||||
u8 reserved[0x8E];
|
||||
} NfpRegisterInfoPrivate;
|
||||
|
||||
typedef struct {
|
||||
u64 application_id;
|
||||
u32 access_id;
|
||||
u16 crc32_change_counter;
|
||||
u8 flags;
|
||||
u8 tag_type;
|
||||
u8 application_area_version;
|
||||
u8 reserved[0x2F];
|
||||
} NfpAdminInfo;
|
||||
|
||||
typedef struct {
|
||||
u8 tag_magic; ///< Tag magic (always 0xA5: https://www.3dbrew.org/wiki/Amiibo#Page_layout).
|
||||
u8 reserved1[0x1];
|
||||
u16 tag_write_counter; ///< Incremented every tag write.
|
||||
u32 crc32_1; ///< CRC32 of some internal 8-byte data.
|
||||
u8 reserved2[0x38];
|
||||
NfpDate last_write_date; ///< Updated every write.
|
||||
u16 write_counter; ///< Incremented every write, until it maxes out at 0xFFFF.
|
||||
u16 version; ///< Version.
|
||||
u32 application_area_size; ///< Size of the application area.
|
||||
u8 reserved3[0x34];
|
||||
MiiVer3StoreData mii_v3; ///< Ver3StoreData (Mii format used in 3DS).
|
||||
u8 pad[0x2];
|
||||
u16 mii_v3_crc16; ///< CRC16 of Ver3StoreData.
|
||||
MiiNfpStoreDataExtension mii_store_data_extension; ///< StoreDataExtension
|
||||
NfpDate first_write_date; ///< Set when the amiibo is first written to.
|
||||
u16 amiibo_name[10+1]; ///< Amiibo name (utf-16, null-terminated).
|
||||
u8 font_region; ///< Font region.
|
||||
u8 unknown1; ///< Normally zero
|
||||
u32 crc32_2; ///< CRC32 of Ver3StoreData + application_id_byte + unknown1 + StoreDataExtension + unknown2 (0x7E bytes total)
|
||||
u32 unknown2[0x5]; ///< Normally zero
|
||||
u8 reserved4[0x64];
|
||||
u64 application_id; ///< Modified application ID (Application ID & 0xFFFFFFFF0FFFFFFF | 0x30000000)
|
||||
u32 access_id; ///< Application area access ID
|
||||
u16 settings_crc32_change_counter;
|
||||
u8 flags; ///< \ref NfpAmiiboFlag
|
||||
u8 tag_type; ///< \ref NfcTagType
|
||||
u8 application_area_version; ///< \ref NfpApplicationAreaVersion
|
||||
u8 application_id_byte; ///< Application ID byte ((Application ID >> 28) & 0xFF)
|
||||
u8 reserved5[0x2E];
|
||||
u8 application_area[0xD8]; ///< Application area.
|
||||
} NfpData;
|
||||
|
||||
typedef struct {
|
||||
u8 mifare_command;
|
||||
u8 unknown; ///< Usually 1
|
||||
u8 reserved1[0x6];
|
||||
u8 sector_key[0x6];
|
||||
u8 reserved2[0x2];
|
||||
} NX_PACKED NfcSectorKey;
|
||||
|
||||
typedef struct {
|
||||
u8 sector_number;
|
||||
u8 reserved[0x7];
|
||||
NfcSectorKey sector_key;
|
||||
} NX_PACKED NfcMifareReadBlockParameter;
|
||||
|
||||
typedef struct {
|
||||
u8 data[0x10];
|
||||
u8 sector_number;
|
||||
u8 reserved[0x7];
|
||||
} NX_PACKED NfcMifareReadBlockData;
|
||||
|
||||
typedef struct {
|
||||
u8 data[0x10];
|
||||
u8 sector_number;
|
||||
u8 reserved[0x7];
|
||||
NfcSectorKey sector_key;
|
||||
} NfcMifareWriteBlockParameter;
|
||||
u16 first_write_year;
|
||||
u8 first_write_month;
|
||||
u8 first_write_day;
|
||||
char amiibo_name[10+1]; ///< utf-8, null-terminated
|
||||
u8 reserved[0x99];
|
||||
} PACKED NfpRegisterInfo;
|
||||
|
||||
typedef struct {
|
||||
u64 version;
|
||||
@ -270,12 +103,6 @@ Result nfcInitialize(NfcServiceType service_type);
|
||||
/// Exit nfc:*.
|
||||
void nfcExit(void);
|
||||
|
||||
/// Initialize nfc:mf:u.
|
||||
Result nfcMfInitialize();
|
||||
|
||||
/// Exit nfc:mf:u.
|
||||
void nfcMfExit(void);
|
||||
|
||||
/// Gets the Service object for the actual nfp:* service session.
|
||||
Service* nfpGetServiceSession(void);
|
||||
|
||||
@ -288,179 +115,43 @@ Service* nfcGetServiceSession(void);
|
||||
/// Gets the Service object for the interface from nfc:*.
|
||||
Service* nfcGetServiceSession_Interface(void);
|
||||
|
||||
/// Gets the Service object for the actual nfc:mf:u service session.
|
||||
Service* nfcMfGetServiceSession(void);
|
||||
|
||||
/// Gets the Service object for the interface from nfc:mf:u.
|
||||
Service* nfcMfGetServiceSession_Interface(void);
|
||||
|
||||
Result nfpListDevices(s32 *total_out, NfcDeviceHandle *out, s32 count);
|
||||
Result nfpStartDetection(const NfcDeviceHandle *handle);
|
||||
Result nfpStopDetection(const NfcDeviceHandle *handle);
|
||||
Result nfpMount(const NfcDeviceHandle *handle, NfpDeviceType device_type, NfpMountTarget mount_target);
|
||||
Result nfpUnmount(const NfcDeviceHandle *handle);
|
||||
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcListDevices(s32 *total_out, NfcDeviceHandle *out, s32 count);
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcStartDetection(const NfcDeviceHandle *handle, NfcProtocol protocol);
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcStopDetection(const NfcDeviceHandle *handle);
|
||||
|
||||
Result nfcMfListDevices(s32 *total_out, NfcDeviceHandle *out, s32 count);
|
||||
Result nfcMfStartDetection(const NfcDeviceHandle *handle);
|
||||
Result nfcMfStopDetection(const NfcDeviceHandle *handle);
|
||||
|
||||
/// Not available with ::NfpServiceType_System.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpOpenApplicationArea(const NfcDeviceHandle *handle, u32 app_id);
|
||||
|
||||
/// Not available with ::NfpServiceType_System.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram, and the application area to be opened.
|
||||
Result nfpGetApplicationArea(const NfcDeviceHandle *handle, void* buf, size_t buf_size, u32 *out_size);
|
||||
Result nfpGetApplicationArea(const NfcDeviceHandle *handle, void* buf, size_t buf_size);
|
||||
|
||||
/// Not available with ::NfpServiceType_System.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram, and the application area to be opened.
|
||||
Result nfpSetApplicationArea(const NfcDeviceHandle *handle, const void* buf, size_t buf_size);
|
||||
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpFlush(const NfcDeviceHandle *handle);
|
||||
|
||||
Result nfpRestore(const NfcDeviceHandle *handle);
|
||||
|
||||
/// Not available with ::NfpServiceType_System.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpCreateApplicationArea(const NfcDeviceHandle *handle, u32 app_id, const void* buf, size_t buf_size);
|
||||
|
||||
/// Not available with ::NfpServiceType_System.
|
||||
/// Only available with [3.0.0+].
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram, and the application area to be opened.
|
||||
Result nfpRecreateApplicationArea(const NfcDeviceHandle *handle, u32 app_id, const void* buf, size_t buf_size);
|
||||
|
||||
/// Not available with ::NfpServiceType_System.
|
||||
Result nfpGetApplicationAreaSize(const NfcDeviceHandle *handle, u32 *out_app_area_size);
|
||||
|
||||
/// Not available with ::NfpServiceType_User.
|
||||
Result nfpDeleteApplicationArea(const NfcDeviceHandle *handle);
|
||||
|
||||
/// Not available with ::NfpServiceType_User.
|
||||
Result nfpExistsApplicationArea(const NfcDeviceHandle *handle, bool *out);
|
||||
|
||||
Result nfpGetTagInfo(const NfcDeviceHandle *handle, NfpTagInfo *out);
|
||||
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpGetRegisterInfo(const NfcDeviceHandle *handle, NfpRegisterInfo *out);
|
||||
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpGetCommonInfo(const NfcDeviceHandle *handle, NfpCommonInfo *out);
|
||||
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Rom.
|
||||
Result nfpGetModelInfo(const NfcDeviceHandle *handle, NfpModelInfo *out);
|
||||
|
||||
/// Not available with ::NfpServiceType_User.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpGetAdminInfo(const NfcDeviceHandle *handle, NfpAdminInfo *out);
|
||||
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcGetTagInfo(const NfcDeviceHandle *handle, NfcTagInfo *out);
|
||||
|
||||
Result nfcMfGetTagInfo(const NfcDeviceHandle *handle, NfcTagInfo *out);
|
||||
|
||||
/// Returned event will have autoclear off.
|
||||
Result nfpAttachActivateEvent(const NfcDeviceHandle *handle, Event *out_event);
|
||||
/// Returned event will have autoclear off.
|
||||
Result nfpAttachDeactivateEvent(const NfcDeviceHandle *handle, Event *out_event);
|
||||
|
||||
/// Returned event will have autoclear off.
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcAttachActivateEvent(const NfcDeviceHandle *handle, Event *out_event);
|
||||
/// Returned event will have autoclear off.
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcAttachDeactivateEvent(const NfcDeviceHandle *handle, Event *out_event);
|
||||
|
||||
/// Returned event will have autoclear off.
|
||||
Result nfcMfAttachActivateEvent(const NfcDeviceHandle *handle, Event *out_event);
|
||||
/// Returned event will have autoclear off.
|
||||
Result nfcMfAttachDeactivateEvent(const NfcDeviceHandle *handle, Event *out_event);
|
||||
|
||||
Result nfpGetState(NfcState *out);
|
||||
Result nfpGetState(NfpState *out);
|
||||
Result nfpGetDeviceState(const NfcDeviceHandle *handle, NfpDeviceState *out);
|
||||
Result nfpGetNpadId(const NfcDeviceHandle *handle, u32 *out);
|
||||
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcGetState(NfcState *out);
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcGetDeviceState(const NfcDeviceHandle *handle, NfcDeviceState *out);
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcGetNpadId(const NfcDeviceHandle *handle, u32 *out);
|
||||
|
||||
Result nfcMfGetState(NfcState *out);
|
||||
Result nfcMfGetDeviceState(const NfcDeviceHandle *handle, NfcMifareDeviceState *out);
|
||||
Result nfcMfGetNpadId(const NfcDeviceHandle *handle, u32 *out);
|
||||
|
||||
/// Returned event will have autoclear on.
|
||||
/// Only available with [3.0.0+].
|
||||
Result nfpAttachAvailabilityChangeEvent(Event *out_event);
|
||||
/// Returned event will have autoclear on.
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcAttachAvailabilityChangeEvent(Event *out_event);
|
||||
/// Returned event will have autoclear on.
|
||||
Result nfcMfAttachAvailabilityChangeEvent(Event *out_event);
|
||||
|
||||
/// Not available with ::NfpServiceType_User.
|
||||
Result nfpFormat(const NfcDeviceHandle *handle);
|
||||
|
||||
/// Not available with ::NfpServiceType_User.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpGetRegisterInfoPrivate(const NfcDeviceHandle *handle, NfpRegisterInfoPrivate *out);
|
||||
|
||||
/// Not available with ::NfpServiceType_User.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpSetRegisterInfoPrivate(const NfcDeviceHandle *handle, const NfpRegisterInfoPrivate *register_info_private);
|
||||
|
||||
/// Not available with ::NfpServiceType_User.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpDeleteRegisterInfo(const NfcDeviceHandle *handle);
|
||||
|
||||
/// Only available with ::NfpServiceType_Debug.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpGetAll(const NfcDeviceHandle *handle, NfpData *out);
|
||||
|
||||
/// Only available with ::NfpServiceType_Debug.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpSetAll(const NfcDeviceHandle *handle, const NfpData *nfp_data);
|
||||
|
||||
/// Only available with ::NfpServiceType_Debug.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpFlushDebug(const NfcDeviceHandle *handle);
|
||||
|
||||
/// Only available with ::NfpServiceType_Debug.
|
||||
/// Requires the amiibo to be mounted with ::NfpMountTarget_Ram.
|
||||
Result nfpBreakTag(const NfcDeviceHandle *handle, NfpBreakType break_type);
|
||||
|
||||
/// Only available with ::NfpServiceType_Debug.
|
||||
Result nfpReadBackupData(const NfcDeviceHandle *handle, void* out_buf, size_t buf_size, u32 *out_size);
|
||||
|
||||
/// Only available with ::NfpServiceType_Debug.
|
||||
Result nfpWriteBackupData(const NfcDeviceHandle *handle, const void* buf, size_t buf_size);
|
||||
|
||||
/// Only available with ::NfpServiceType_Debug.
|
||||
Result nfpWriteNtf(const NfcDeviceHandle *handle, u32 write_type, const void* buf, size_t buf_size);
|
||||
|
||||
/// This uses nfc:*.
|
||||
Result nfcIsNfcEnabled(bool *out);
|
||||
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcReadMifare(const NfcDeviceHandle *handle, NfcMifareReadBlockData *out_block_data, const NfcMifareReadBlockParameter *read_block_parameter, s32 count);
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcWriteMifare(const NfcDeviceHandle *handle, const NfcMifareWriteBlockParameter *write_block_parameter, s32 count);
|
||||
|
||||
Result nfcMfReadMifare(const NfcDeviceHandle *handle, NfcMifareReadBlockData *out_block_data, const NfcMifareReadBlockParameter *read_block_parameter, s32 count);
|
||||
Result nfcMfWriteMifare(const NfcDeviceHandle *handle, const NfcMifareWriteBlockParameter *write_block_parameter, s32 count);
|
||||
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcSendCommandByPassThrough(const NfcDeviceHandle *handle, u64 timeout, const void* cmd_buf, size_t cmd_buf_size, void* reply_buf, size_t reply_buf_size, u64 *out_size);
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcKeepPassThroughSession(const NfcDeviceHandle *handle);
|
||||
/// Only available with [4.0.0+].
|
||||
Result nfcReleasePassThroughSession(const NfcDeviceHandle *handle);
|
||||
|
@ -229,14 +229,6 @@ Result nifmIsAnyForegroundRequestAccepted(bool* out);
|
||||
Result nifmPutToSleep(void);
|
||||
Result nifmWakeUp(void);
|
||||
|
||||
/**
|
||||
* @brief SetWowlDelayedWakeTime
|
||||
* @note Only available with ::NifmServiceType_System or ::NifmServiceType_Admin.
|
||||
* @note Only available on [9.0.0+].
|
||||
* @param[in] val Input value.
|
||||
*/
|
||||
Result nifmSetWowlDelayedWakeTime(s32 val);
|
||||
|
||||
///@name IRequest
|
||||
///@{
|
||||
|
||||
@ -277,45 +269,5 @@ Result nifmRequestSubmit(NifmRequest* r);
|
||||
*/
|
||||
Result nifmRequestSubmitAndWait(NifmRequest* r);
|
||||
|
||||
/**
|
||||
* @brief GetAppletInfo
|
||||
* @note This is used by \ref nifmLaHandleNetworkRequestResult.
|
||||
* @param r \ref NifmRequest
|
||||
* @param[in] theme_color ThemeColor
|
||||
* @param[out] buffer Output buffer for storage data.
|
||||
* @param[in] size Output buffer size.
|
||||
* @param[out] applet_id \ref AppletId
|
||||
* @param[out] mode \ref LibAppletMode
|
||||
* @param[out] out_size Total data size written to the output buffer.
|
||||
*/
|
||||
Result nifmRequestGetAppletInfo(NifmRequest* r, u32 theme_color, void* buffer, size_t size, u32 *applet_id, u32 *mode, u32 *out_size);
|
||||
|
||||
/**
|
||||
* @brief SetKeptInSleep
|
||||
* @note Only available on [3.0.0+].
|
||||
* @note ::NifmRequestState must be ::NifmRequestState_Unknown1.
|
||||
* @param r \ref NifmRequest
|
||||
* @param[in] flag Flag
|
||||
*/
|
||||
Result nifmRequestSetKeptInSleep(NifmRequest* r, bool flag);
|
||||
|
||||
/**
|
||||
* @brief RegisterSocketDescriptor. Only 1 socket can be registered at a time with a NifmRequest. Do not use directly, use \ref socketNifmRequestRegisterSocketDescriptor instead.
|
||||
* @note Only available on [3.0.0+].
|
||||
* @note ::NifmRequestState must be ::NifmRequestState_Available.
|
||||
* @param r \ref NifmRequest
|
||||
* @param[in] sockfd Socket fd
|
||||
*/
|
||||
Result nifmRequestRegisterSocketDescriptor(NifmRequest* r, int sockfd);
|
||||
|
||||
/**
|
||||
* @brief UnregisterSocketDescriptor. Do not use directly, use \ref socketNifmRequestUnregisterSocketDescriptor instead.
|
||||
* @note Only available on [3.0.0+].
|
||||
* @note ::NifmRequestState must be ::NifmRequestState_Available.
|
||||
* @param r \ref NifmRequest
|
||||
* @param[in] sockfd Socket fd, must match the fd previously registered with \ref nifmRequestRegisterSocketDescriptor.
|
||||
*/
|
||||
Result nifmRequestUnregisterSocketDescriptor(NifmRequest* r, int sockfd);
|
||||
|
||||
///@}
|
||||
|
||||
|
@ -44,7 +44,7 @@ typedef struct {
|
||||
/// Maximum alarms that can be registered at the same time by the host Application.
|
||||
#define NOTIF_MAX_ALARMS 8
|
||||
|
||||
/// Initialize notif. Only available on [9.0.0+].
|
||||
/// Initialize notif. Only available on [9.0.0+]. Note that using Alarms also requires the [9.0.0+] firmware update for controllers to be installed.
|
||||
Result notifInitialize(NotifServiceType service_type);
|
||||
|
||||
/// Exit notif.
|
||||
@ -116,7 +116,6 @@ Result notifAlarmSettingDisable(NotifAlarmSetting *alarm_setting, u32 day_of_wee
|
||||
/**
|
||||
* @brief Registers the specified AlarmSetting.
|
||||
* @note See \ref NOTIF_MAX_ALARMS for the maximum alarms.
|
||||
* @note When indicated by the output from \ref hidIsFirmwareUpdateNeededForNotification, this will use \ref hidLaShowControllerFirmwareUpdate.
|
||||
* @param[out] alarm_setting_id AlarmSettingId
|
||||
* @param[in] alarm_setting \ref NotifAlarmSetting
|
||||
* @param[in] buffer Input buffer containing the ApplicationParameter. Optional, can be NULL.
|
||||
|
@ -771,18 +771,6 @@ Result nsIsAnyApplicationEntityInstalled(u64 application_id, bool *out);
|
||||
*/
|
||||
Result nsCleanupUnavailableAddOnContents(u64 application_id, AccountUid uid);
|
||||
|
||||
/**
|
||||
* @brief EstimateSizeToMove
|
||||
* @note Only available on [10.0.0+].
|
||||
* @param[in] storage_ids Array of u8 \ref NcmStorageId.
|
||||
* @param[in] count Size of the storage_ids array in entries.
|
||||
* @param[in] storage_id storage_id \ref NcmStorageId
|
||||
* @param[in] flags Flags
|
||||
* @param[in] application_id ApplicationId.
|
||||
* @param[out] Out Output value.
|
||||
*/
|
||||
Result nsEstimateSizeToMove(u8 *storage_ids, s32 count, NcmStorageId storage_id, u32 flags, u64 application_id, s64 *out);
|
||||
|
||||
/**
|
||||
* @brief FormatSdCard
|
||||
* @note Only available on [2.0.0+].
|
||||
@ -1339,8 +1327,8 @@ Result nsdevGetShellEventInfo(NsShellEventInfo* out); ///< [1.0.0-9.2.0]
|
||||
Result nsdevTerminateApplication(void);
|
||||
Result nsdevPrepareLaunchProgramFromHost(NsLaunchProperties* out, const char* path, size_t path_len); ///< [1.0.0-9.2.0]
|
||||
Result nsdevLaunchApplicationForDevelop(u64* out_pid, u64 application_id, u32 flags); ///< [1.0.0-9.2.0]
|
||||
Result nsdevLaunchApplicationFromHost(u64* out_pid, const char* path, size_t path_len, u32 flags); ///< [10.0.0-17.0.1]
|
||||
Result nsdevLaunchApplicationWithStorageIdForDevelop(u64* out_pid, u64 application_id, u32 flags, u8 app_storage_id, u8 patch_storage_id); ///< [1.0.0-17.0.1]
|
||||
Result nsdevLaunchApplicationFromHost(u64* out_pid, const char* path, size_t path_len, u32 flags); ///< [10.0.0+]
|
||||
Result nsdevLaunchApplicationWithStorageIdForDevelop(u64* out_pid, u64 application_id, u32 flags, u8 app_storage_id, u8 patch_storage_id);
|
||||
Result nsdevIsSystemMemoryResourceLimitBoosted(bool* out); ///< [6.0.0-8.1.0]
|
||||
Result nsdevGetRunningApplicationProcessIdForDevelop(u64* out_pid); ///< [6.0.0+]
|
||||
Result nsdevSetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop(bool can_be_active); ///< [6.0.0+]
|
||||
|
@ -9,15 +9,6 @@
|
||||
#include "../sf/service.h"
|
||||
#include "../kernel/event.h"
|
||||
|
||||
/// NvServiceType, for __nx_nv_service_type.
|
||||
typedef enum {
|
||||
NvServiceType_Auto = -1, ///< This is the default. Automatically select the type using \ref appletGetAppletType.
|
||||
NvServiceType_Application = 0, ///< Initializes nvdrv.
|
||||
NvServiceType_Applet = 1, ///< Initializes nvdrv:a.
|
||||
NvServiceType_System = 2, ///< Initializes nvdrv:s.
|
||||
NvServiceType_Factory = 3, ///< Initializes nvdrv:t.
|
||||
} NvServiceType;
|
||||
|
||||
/// Initialize nvdrv*.
|
||||
Result nvInitialize(void);
|
||||
|
||||
@ -41,8 +32,7 @@ typedef enum {
|
||||
|
||||
Result nvOpen(u32 *fd, const char *devicepath);
|
||||
Result nvIoctl(u32 fd, u32 request, void* argp);
|
||||
Result nvIoctl2(u32 fd, u32 request, void* argp, const void* inbuf, size_t inbuf_size); ///< [3.0.0+]
|
||||
Result nvIoctl3(u32 fd, u32 request, void* argp, void* outbuf, size_t outbuf_size); ///< [3.0.0+]
|
||||
Result nvIoctl2(u32 fd, u32 request, void* argp, const void* inbuf, size_t inbuf_size);
|
||||
Result nvClose(u32 fd);
|
||||
Result nvQueryEvent(u32 fd, u32 event_id, Event *event_out);
|
||||
|
||||
|
@ -7,15 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
typedef struct {
|
||||
u8 rating_age;
|
||||
bool sns_post_restriction;
|
||||
bool free_communication_restriction;
|
||||
} PctlRestrictionSettings;
|
||||
|
||||
/// Initialize pctl.
|
||||
Result pctlInitialize(void);
|
||||
|
||||
@ -28,41 +21,15 @@ Service* pctlGetServiceSession(void);
|
||||
/// Gets the Service object for IParentalControlService.
|
||||
Service* pctlGetServiceSession_Service(void);
|
||||
|
||||
/// Gets whether Parental Controls restrictions are temporarily unlocked.
|
||||
Result pctlIsRestrictionTemporaryUnlocked(bool *flag);
|
||||
|
||||
/// Confirm whether VrMode is allowed. Only available with [4.0.0+].
|
||||
Result pctlConfirmStereoVisionPermission(void);
|
||||
|
||||
/// Gets whether Parental Controls are enabled.
|
||||
Result pctlIsRestrictionEnabled(bool *flag);
|
||||
|
||||
/// Gets whether Parental Controls are enabled.
|
||||
Result pctlGetSafetyLevel(u32 *safety_level);
|
||||
|
||||
/// Returns the current restrictions settings.
|
||||
Result pctlGetCurrentSettings(PctlRestrictionSettings *settings);
|
||||
|
||||
/// Gets the count of applications that have free communication.
|
||||
Result pctlGetFreeCommunicationApplicationListCount(u32 *count);
|
||||
|
||||
/// Reset the confirmation done by \ref pctlConfirmStereoVisionPermission. Only available with [5.0.0+].
|
||||
Result pctlResetConfirmedStereoVisionPermission(void);
|
||||
|
||||
/// Gets whether VrMode is allowed. Only available with [5.0.0+].
|
||||
Result pctlIsStereoVisionPermitted(bool *flag);
|
||||
|
||||
/// Confirm whether pairing is active.
|
||||
Result pctlIsPairingActive(bool *flag);
|
||||
|
||||
/// Returns the synchronization event.
|
||||
Result pctlGetSynchronizationEvent(Event* out_event);
|
||||
|
||||
/// Returns the supension event.
|
||||
Result pctlGetPlayTimerEventToRequestSuspension(Event* out_event);
|
||||
|
||||
/// Confirm whether play timer alarm is disabled. Only available with [4.0.0+].
|
||||
Result pctlIsPlayTimerAlarmDisabled(bool *flag);
|
||||
|
||||
/// Returns the unlinked event.
|
||||
Result pctlGetUnlinkedEvent(Event* out_event);
|
||||
|
@ -191,13 +191,6 @@ typedef enum {
|
||||
PcvModuleId_EXTPERIPH2 = 0x40000057,
|
||||
} PcvModuleId;
|
||||
|
||||
// Clock list type returned by GetPossibleClockRates
|
||||
typedef enum {
|
||||
PcvClockRatesListType_Invalid = 0,
|
||||
PcvClockRatesListType_Discrete = 1,
|
||||
PcvClockRatesListType_Range = 2,
|
||||
} PcvClockRatesListType;
|
||||
|
||||
/// Initialize pcv.
|
||||
Result pcvInitialize(void);
|
||||
|
||||
@ -217,5 +210,3 @@ Result pcvSetClockRate(PcvModule module, u32 hz);
|
||||
Result pcvSetVoltageEnabled(u32 power_domain, bool state);
|
||||
/// Only available on [1.0.0-7.0.1].
|
||||
Result pcvGetVoltageEnabled(bool *isEnabled, u32 power_domain);
|
||||
/// Only available on [1.0.0-7.0.1].
|
||||
Result pcvGetPossibleClockRates(PcvModule module, u32 *rates, s32 max_count, PcvClockRatesListType *out_type, s32 *out_count);
|
||||
|
@ -38,71 +38,41 @@ typedef enum {
|
||||
PdmPlayLogPolicy_Unknown3 = 3, ///< [10.0.0+] The cmds which require ::PdmPlayLogPolicy_All, now also allow value 3 if the cmd input flag is set.
|
||||
} PdmPlayLogPolicy;
|
||||
|
||||
/// AppletEventV1. AppletEvent for [1.0.0-15.0.1], converted to \ref PdmAppletEvent when needed.
|
||||
/// AppletEvent.
|
||||
/// Timestamp format, converted from PosixTime: total minutes since epoch UTC 1999/12/31 00:00:00.
|
||||
/// See \ref pdmPlayTimestampToPosix.
|
||||
typedef struct {
|
||||
u64 program_id; ///< ProgramId.
|
||||
u32 entry_index; ///< Entry index.
|
||||
u32 timestamp_user; ///< See PdmPlayEvent::timestamp_user, with the above timestamp format.
|
||||
u32 timestamp_network; ///< See PdmPlayEvent::timestamp_network, with the above timestamp format.
|
||||
u8 event_type; ///< \ref PdmAppletEventType
|
||||
u32 timestampUser; ///< See PdmPlayEvent::timestampUser, with the above timestamp format.
|
||||
u32 timestampNetwork; ///< See PdmPlayEvent::timestampNetwork, with the above timestamp format.
|
||||
u8 eventType; ///< \ref PdmAppletEventType
|
||||
u8 pad[3]; ///< Padding.
|
||||
} PdmAppletEventV1;
|
||||
|
||||
/// AppletEvent. AppletEvent for [16.0.0+], converted from \ref PdmAppletEventV1 on [1.0.0-15.0.1].
|
||||
typedef struct {
|
||||
u64 program_id; ///< ProgramId.
|
||||
u32 entry_index; ///< Entry index.
|
||||
u32 pad; ///< Padding
|
||||
u64 timestamp_user; ///< See PdmPlayEvent::timestamp_user.
|
||||
u64 timestamp_network; ///< See PdmPlayEvent::timestamp_network.
|
||||
u8 event_type; ///< \ref PdmAppletEventType
|
||||
u8 pad2[7]; ///< Padding.
|
||||
} PdmAppletEvent;
|
||||
|
||||
/// PlayStatisticsV1. PlayStatistics for [1.0.0-15.0.1], converted to \ref PdmPlayStatistics when needed.
|
||||
/// PlayStatistics
|
||||
typedef struct {
|
||||
u64 program_id; ///< ProgramId.
|
||||
u64 application_id; ///< ApplicationId.
|
||||
|
||||
u32 first_entry_index; ///< Entry index for the first time the program was played.
|
||||
u32 first_timestamp_user; ///< See PdmAppletEventV1::timestamp_user. This is for the first time the program was played.
|
||||
u32 first_timestamp_network; ///< See PdmAppletEventV1::timestamp_network. This is for the first time the program was played.
|
||||
u32 first_entry_index; ///< Entry index for the first time the application was played.
|
||||
u32 first_timestampUser; ///< See PdmAppletEvent::timestampUser. This is for the first time the application was played.
|
||||
u32 first_timestampNetwork; ///< See PdmAppletEvent::timestampNetwork. This is for the first time the application was played.
|
||||
|
||||
u32 last_entry_index; ///< Entry index for the last time the program was played.
|
||||
u32 last_timestamp_user; ///< See PdmAppletEventV1::timestamp_user. This is for the last time the program was played.
|
||||
u32 last_timestamp_network; ///< See PdmAppletEventV1::timestamp_network. This is for the last time the program was played.
|
||||
u32 last_entry_index; ///< Entry index for the last time the application was played.
|
||||
u32 last_timestampUser; ///< See PdmAppletEvent::timestampUser. This is for the last time the application was played.
|
||||
u32 last_timestampNetwork; ///< See PdmAppletEvent::timestampNetwork. This is for the last time the application was played.
|
||||
|
||||
u32 playtime_minutes; ///< Total play-time in minutes.
|
||||
u32 total_launches; ///< Total times the program was launched.
|
||||
} PdmPlayStatisticsV1;
|
||||
|
||||
/// PlayStatistics. PlayStatistics for [16.0.0+], converted from \ref PdmPlayStatisticsV1 on [1.0.0-15.0.1].
|
||||
typedef struct {
|
||||
u64 program_id; ///< ProgramId.
|
||||
|
||||
u32 first_entry_index; ///< Entry index for the first time the program was played.
|
||||
u32 pad; ///< Padding
|
||||
u64 first_timestamp_user; ///< See PdmAppletEvent::timestamp_user. This is for the first time the program was played, in PosixTime.
|
||||
u64 first_timestamp_network; ///< See PdmAppletEvent::timestamp_network. This is for the first time the program was played, in PosixTime.
|
||||
|
||||
u32 last_entry_index; ///< Entry index for the last time the program was played.
|
||||
u32 pad2; ///< Padding
|
||||
u64 last_timestamp_user; ///< See PdmAppletEvent::timestamp_user. This is for the last time the program was played, in PosixTime.
|
||||
u64 last_timestamp_network; ///< See PdmAppletEvent::timestamp_network. This is for the last time the program was played, in PosixTime.
|
||||
|
||||
u64 playtime; ///< Total play-time in nanoseconds.
|
||||
u32 total_launches; ///< Total times the program was launched.
|
||||
u32 pad3; ///< Padding
|
||||
u32 playtimeMinutes; ///< Total play-time in minutes.
|
||||
u32 totalLaunches; ///< Total times the application was launched.
|
||||
} PdmPlayStatistics;
|
||||
|
||||
/// LastPlayTime.
|
||||
/// This contains data from the last time the application was played.
|
||||
typedef struct {
|
||||
u64 application_id; ///< ApplicationId.
|
||||
u32 timestamp_user; ///< See PdmAppletEventV1::timestamp_user.
|
||||
u32 timestamp_network; ///< See PdmAppletEventV1::timestamp_network.
|
||||
u32 last_played_minutes; ///< Total minutes since the application was last played.
|
||||
u32 timestampUser; ///< See PdmAppletEvent::timestampUser.
|
||||
u32 timestampNetwork; ///< See PdmAppletEvent::timestampNetwork.
|
||||
u32 lastPlayedMinutes; ///< Total minutes since the application was last played.
|
||||
u8 flag; ///< Flag indicating whether the above field is set.
|
||||
u8 pad[3]; ///< Padding.
|
||||
} PdmLastPlayTime;
|
||||
@ -128,10 +98,10 @@ typedef struct {
|
||||
u32 data;
|
||||
} unk_x8;
|
||||
|
||||
u8 applet_id; ///< \ref AppletId
|
||||
u8 storage_id; ///< \ref NcmStorageId
|
||||
u8 log_policy; ///< \ref PdmPlayLogPolicy
|
||||
u8 event_type; ///< \ref PdmAppletEventType
|
||||
u8 appletId; ///< \ref AppletId
|
||||
u8 storageId; ///< \ref NcmStorageId
|
||||
u8 logPolicy; ///< \ref PdmPlayLogPolicy
|
||||
u8 eventType; ///< \ref PdmAppletEventType
|
||||
u8 unused[0xc]; ///< Unused.
|
||||
} applet;
|
||||
|
||||
@ -144,59 +114,34 @@ typedef struct {
|
||||
struct {
|
||||
u8 value; ///< Input value from the pdm:ntfy command.
|
||||
u8 unused[0x1b]; ///< Unused.
|
||||
} power_state_change;
|
||||
} powerStateChange;
|
||||
|
||||
struct {
|
||||
u8 value; ///< Input value from the pdm:ntfy command.
|
||||
u8 unused[0x1b]; ///< Unused.
|
||||
} operation_mode_change;
|
||||
} operationModeChange;
|
||||
|
||||
u8 data[0x1c];
|
||||
} event_data; ///< ProgramId/ApplicationId/userId stored within here have the u32 low/high swapped in each u64.
|
||||
} eventData; ///< ProgramId/ApplicationId/userId stored within here have the u32 low/high swapped in each u64.
|
||||
|
||||
u8 play_event_type; ///< \ref PdmPlayEventType. Controls which struct in the above event_data is used. ::PdmPlayEventType_Initialize doesn't use event_data.
|
||||
u8 playEventType; ///< \ref PdmPlayEventType. Controls which struct in the above eventData is used. ::PdmPlayEventType_Initialize doesn't use eventData.
|
||||
u8 pad[3]; ///< Padding.
|
||||
|
||||
u64 timestamp_user; ///< PosixTime timestamp from StandardUserSystemClock.
|
||||
u64 timestamp_network; ///< PosixTime timestamp from StandardNetworkSystemClock.
|
||||
u64 timestamp_steady; ///< Timestamp in seconds derived from StandardSteadyClock.
|
||||
u64 timestampUser; ///< PosixTime timestamp from StandardUserSystemClock.
|
||||
u64 timestampNetwork; ///< PosixTime timestamp from StandardNetworkSystemClock.
|
||||
u64 timestampSteady; ///< Timestamp in seconds derived from StandardSteadyClock.
|
||||
} PdmPlayEvent;
|
||||
|
||||
/// AccountEventV3. AccountEvent for [3.0.0-9.2.0], converted to \ref PdmAccountEvent when needed.
|
||||
/// AccountEvent
|
||||
typedef struct {
|
||||
AccountUid uid; ///< \ref AccountUid
|
||||
u32 entry_index; ///< Entry index.
|
||||
u8 pad[4]; ///< Padding.
|
||||
u64 timestamp_user; ///< See PdmPlayEvent::timestamp_user.
|
||||
u64 timestamp_network; ///< See PdmPlayEvent::timestamp_network.
|
||||
u64 timestamp_steady; ///< See PdmPlayEvent::timestamp_steady.
|
||||
u8 type; ///< See PdmPlayEvent::event_data::account::type.
|
||||
u8 pad2[7]; ///< Padding.
|
||||
} PdmAccountEventV3;
|
||||
|
||||
/// AccountEventV10. AccountEvent for [10.0.0-15.0.1], converted to \ref PdmAccountEvent when needed.
|
||||
typedef struct {
|
||||
AccountUid uid; ///< \ref AccountUid
|
||||
u64 program_id; ///< ProgramId
|
||||
u32 entry_index; ///< Entry index.
|
||||
u8 pad[4]; ///< Padding.
|
||||
u64 timestamp_user; ///< See PdmPlayEvent::timestamp_user.
|
||||
u64 timestamp_network; ///< See PdmPlayEvent::timestamp_network.
|
||||
u64 timestamp_steady; ///< See PdmPlayEvent::timestamp_steady.
|
||||
u8 type; ///< See PdmPlayEvent::event_data::account::type.
|
||||
u8 pad2[7]; ///< Padding.
|
||||
} PdmAccountEventV10;
|
||||
|
||||
/// AccountEvent. AccountEvent for [16.0.0+], converted from the older structs when needed.
|
||||
typedef struct {
|
||||
AccountUid uid; ///< \ref AccountUid
|
||||
u64 program_id; ///< [10.0.0+] ProgramId
|
||||
u32 entry_index; ///< Entry index.
|
||||
u8 pad[4]; ///< Padding.
|
||||
u64 timestamp_user; ///< See PdmPlayEvent::timestamp_user.
|
||||
u64 timestamp_network; ///< See PdmPlayEvent::timestamp_network.
|
||||
u8 type; ///< See PdmPlayEvent::event_data::account::type.
|
||||
u8 pad2[7]; ///< Padding.
|
||||
u64 timestampUser; ///< See PdmPlayEvent::timestampUser.
|
||||
u64 timestampNetwork; ///< See PdmPlayEvent::timestampNetwork.
|
||||
u64 timestampSteady; ///< See PdmPlayEvent::timestampSteady.
|
||||
u8 type; ///< See PdmPlayEvent::eventData::account::type.
|
||||
u8 pad_x31[7]; ///< Padding.
|
||||
} PdmAccountEvent;
|
||||
|
||||
/// AccountPlayEvent.
|
||||
@ -212,8 +157,8 @@ typedef struct {
|
||||
/// ApplicationPlayStatistics
|
||||
typedef struct {
|
||||
u64 application_id; ///< ApplicationId.
|
||||
u64 playtime; ///< Total play-time in nanoseconds.
|
||||
u64 total_launches; ///< Total times the application was launched.
|
||||
u64 totalPlayTime; ///< Total play-time in nanoseconds.
|
||||
u64 totalLaunches; ///< Total times the application was launched.
|
||||
} PdmApplicationPlayStatistics;
|
||||
|
||||
/// Initialize pdm:qry.
|
||||
@ -281,7 +226,6 @@ Result pdmqryGetAvailablePlayEventRange(s32 *total_entries, s32 *start_entry_ind
|
||||
|
||||
/**
|
||||
* @brief Gets a list of \ref PdmAccountEvent.
|
||||
* @note Only available with [3.0.0+].
|
||||
* @param[in] entry_index Start entry index.
|
||||
* @param[out] events Output \ref PdmAccountEvent array.
|
||||
* @param[in] count Max entries in the output array.
|
||||
@ -311,7 +255,7 @@ Result pdmqryGetAvailableAccountPlayEventRange(AccountUid uid, s32 *total_entrie
|
||||
|
||||
/**
|
||||
* @brief Gets a list of applications played by the specified user.
|
||||
* @note Only available with [6.0.0-14.1.2].
|
||||
* @note Only available with [6.0.0+].
|
||||
* @param[in] uid \ref AccountUid
|
||||
* @param[in] flag [10.0.0+] Whether to additionally allow using entries with ::PdmPlayLogPolicy_Unknown3.
|
||||
* @param[out] application_ids Output ApplicationIds array.
|
||||
@ -321,8 +265,8 @@ Result pdmqryGetAvailableAccountPlayEventRange(AccountUid uid, s32 *total_entrie
|
||||
Result pdmqryQueryRecentlyPlayedApplication(AccountUid uid, bool flag, u64 *application_ids, s32 count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Gets an Event which is signaled when logging a new \ref PdmPlayEvent which would be available via \ref pdmqryQueryAccountEvent, where PdmPlayEvent::event_data::account::type is 0.
|
||||
* @note Only available with [6.0.0-14.1.2].
|
||||
* @brief Gets an Event which is signaled when logging a new \ref PdmPlayEvent which would be available via \ref pdmqryQueryAccountEvent, where PdmPlayEvent::eventData::account::type is 0.
|
||||
* @note Only available with [6.0.0+].
|
||||
* @note The Event must be closed by the user once finished with it.
|
||||
* @param[out] out_event Output Event with autoclear=false.
|
||||
*/
|
||||
|
@ -7,7 +7,6 @@
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../sf/service.h"
|
||||
#include "../sf/tipc.h"
|
||||
#include "../services/ncm_types.h"
|
||||
#include "../services/pm.h"
|
||||
|
||||
@ -34,9 +33,8 @@ typedef struct {
|
||||
u8 reserved_0E[2]; ///< Padding
|
||||
} PglContentMetaInfo;
|
||||
|
||||
typedef union {
|
||||
Service s;
|
||||
TipcService t;
|
||||
typedef struct {
|
||||
Service s;
|
||||
} PglEventObserver;
|
||||
|
||||
/// Initialize pgl.
|
||||
@ -45,11 +43,8 @@ Result pglInitialize(void);
|
||||
/// Exit pgl.
|
||||
void pglExit(void);
|
||||
|
||||
/// Gets the Service object for the actual pgl service session. Requires < 12.0.0
|
||||
Service* pglGetServiceSessionCmif(void);
|
||||
|
||||
/// Gets the TipcService object for the actual pgl service session. Requires 12.0.0+
|
||||
TipcService* pglGetServiceSessionTipc(void);
|
||||
/// Gets the Service object for the actual pgl service session.
|
||||
Service* pglGetServiceSession(void);
|
||||
|
||||
Result pglLaunchProgram(u64 *out_pid, const NcmProgramLocation *loc, u32 pm_launch_flags, u8 pgl_launch_flags);
|
||||
Result pglTerminateProcess(u64 pid);
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
typedef enum {
|
||||
PlServiceType_User = 0, ///< Initializes pl:u.
|
||||
PlServiceType_System = 1, ///< Initializes pl:s. With [16.0.0+] SharedFont is no longer available with this, pl:u must be used for that.
|
||||
PlServiceType_System = 1, ///< Initializes pl:s.
|
||||
} PlServiceType;
|
||||
|
||||
/// SharedFontType
|
||||
|
@ -57,15 +57,6 @@ typedef enum {
|
||||
PmBootMode_SafeMode = 2, ///< SafeMode
|
||||
} PmBootMode;
|
||||
|
||||
/// ResourceLimitValues
|
||||
typedef struct {
|
||||
u64 physical_memory;
|
||||
u32 thread_count;
|
||||
u32 event_count;
|
||||
u32 transfer_memory_count;
|
||||
u32 session_count;
|
||||
} PmResourceLimitValues;
|
||||
|
||||
/// Initialize pm:dmnt.
|
||||
Result pmdmntInitialize(void);
|
||||
|
||||
@ -120,11 +111,8 @@ Result pmdmntHookToCreateProcess(Event* out, u64 program_id);
|
||||
Result pmdmntGetApplicationProcessId(u64* pid_out);
|
||||
Result pmdmntHookToCreateApplicationProcess(Event* out);
|
||||
Result pmdmntClearHook(u32 which);
|
||||
Result pmdmntGetProgramId(u64* program_id_out, u64 pid);
|
||||
|
||||
Result pminfoGetProgramId(u64* program_id_out, u64 pid);
|
||||
Result pminfoGetAppletCurrentResourceLimitValues(PmResourceLimitValues* out);
|
||||
Result pminfoGetAppletPeakResourceLimitValues(PmResourceLimitValues* out);
|
||||
|
||||
Result pmshellLaunchProgram(u32 launch_flags, const NcmProgramLocation *location, u64 *pid);
|
||||
Result pmshellTerminateProcess(u64 processID);
|
||||
@ -136,5 +124,4 @@ Result pmshellClearJitDebugOccured(u64 pid);
|
||||
Result pmshellNotifyBootFinished(void);
|
||||
Result pmshellGetApplicationProcessIdForShell(u64* pid_out);
|
||||
Result pmshellBoostSystemMemoryResourceLimit(u64 boost_size);
|
||||
Result pmshellBoostApplicationThreadResourceLimit(void);
|
||||
Result pmshellBoostSystemThreadResourceLimit(void);
|
||||
Result pmshellEnableApplicationExtraThread(void);
|
||||
|
@ -94,7 +94,7 @@ void pscmExit(void);
|
||||
/// Gets the Service object for the actual psc:m service session.
|
||||
Service* pscmGetServiceSession(void);
|
||||
|
||||
Result pscmGetPmModule(PscPmModule *out, PscPmModuleId module_id, const u32 *dependencies, size_t dependency_count, bool autoclear);
|
||||
Result pscmGetPmModule(PscPmModule *out, PscPmModuleId module_id, const u16 *dependencies, size_t dependency_count, bool autoclear);
|
||||
|
||||
Result pscPmModuleGetRequest(PscPmModule *module, PscPmState *out_state, u32 *out_flags);
|
||||
Result pscPmModuleAcknowledge(PscPmModule *module, PscPmState state);
|
||||
|
@ -10,11 +10,10 @@
|
||||
#include "../kernel/event.h"
|
||||
|
||||
typedef enum {
|
||||
PsmChargerType_Unconnected = 0, ///< No charger
|
||||
PsmChargerType_EnoughPower = 1, ///< Full supported power
|
||||
PsmChargerType_LowPower = 2, ///< Lower power supported USB-PD mode
|
||||
PsmChargerType_NotSupported = 3, ///< No common supported USB-PD modes
|
||||
} PsmChargerType;
|
||||
ChargerType_None = 0, ///< No charger
|
||||
ChargerType_Charger = 1, ///< Official charger or dock
|
||||
ChargerType_Usb = 2 ///< Other USB-C chargers
|
||||
} ChargerType;
|
||||
|
||||
typedef enum {
|
||||
PsmBatteryVoltageState_NeedsShutdown = 0, ///< Power state should transition to shutdown
|
||||
@ -39,11 +38,8 @@ void psmExit(void);
|
||||
Service* psmGetServiceSession(void);
|
||||
|
||||
Result psmGetBatteryChargePercentage(u32 *out);
|
||||
Result psmGetChargerType(PsmChargerType *out);
|
||||
Result psmGetChargerType(ChargerType *out);
|
||||
Result psmGetBatteryVoltageState(PsmBatteryVoltageState *out);
|
||||
Result psmGetRawBatteryChargePercentage(double *out);
|
||||
Result psmIsEnoughPowerSupplied(bool *out);
|
||||
Result psmGetBatteryAgePercentage(double *out);
|
||||
|
||||
/**
|
||||
* @brief Wrapper func which opens a PsmSession and handles event setup.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user