Difference between revisions of "Services API"

From Nintendo Switch Brew
Jump to navigation Jump to search
Line 80: Line 80:
 
! scope="col" width="200" | Notes
 
! scope="col" width="200" | Notes
 
|-
 
|-
| acc:u1, acc:su
+
| acc:u1, acc:aa, acc:su
 
| [[Account services]]
 
| [[Account services]]
 
| u1: User, su: Admin
 
| u1: User, su: Admin
 
|-
 
|-
| appletAE
+
| aoc:u
 +
| AddOn Content services
 +
|
 +
|-
 +
| appletAE, appletOE
 
| Applet services
 
| Applet services
 +
|
 
|-
 
|-
| apm
+
| apm, apm:p, apm:sys
 
| ?
 
| ?
|
 
|-
 
| aoc:u
 
| AddOn Content services
 
 
|
 
|
 
|-
 
|-
Line 99: Line 100:
 
| r: Reader, w: Writer
 
| r: Reader, w: Writer
 
|-
 
|-
| audin:u, audout:u, audren:u
+
| audin:a, audin:d, audin:u, audout:a, audout:d, audout:u, audren:a, audren:d, audren:u
 
| Audio services
 
| Audio services
 
|
 
|
Line 107: Line 108:
 
|
 
|
 
|-
 
|-
| bpc
+
| bpc, bpc:r
 
| ?
 
| ?
 
|  
 
|  
Line 115: Line 116:
 
|
 
|
 
|-
 
|-
| btm
+
| btm, btm:dbg, btm:sys
| ?
+
| Bluetooth services?
 
|  
 
|  
 
|-
 
|-
| caps:a, caps:c, caps:ss
+
| caps:a, caps:c, caps:sc, caps:ss
 
| Capture services
 
| Capture services
 
| a: Album, ss: Screenshot
 
| a: Album, ss: Screenshot
 +
|-
 +
| erpt:c, erpt:r
 +
| Error Report services
 +
|
 
|-
 
|-
 
| es
 
| es
Line 131: Line 136:
 
|  
 
|  
 
|-
 
|-
| fatal:u
+
| fatal:u, fatal:p
 
| Fatal Error services
 
| Fatal Error services
|
+
| u: User, p: Privileged?
 
|-
 
|-
 
| fgm
 
| fgm
Line 145: Line 150:
 
| fsp-srv, fsp-ldr, fsp-pr
 
| fsp-srv, fsp-ldr, fsp-pr
 
| [[Filesystem services]]
 
| [[Filesystem services]]
|
+
| srv: Main, ldr: Loader, pr: Program Registry
 
|-
 
|-
 
| gpio
 
| gpio
Line 151: Line 156:
 
|  
 
|  
 
|-
 
|-
| i2c
+
| hid, hid:dbg, hid:sys
 +
| [[HID services]]
 +
|
 +
|-
 +
| i2c, i2c:pcv
 
| I2C services
 
| I2C services
 
|  
 
|  
 
|-
 
|-
| irs
+
| irs, irs:sys
 
| IR Sensor services?
 
| IR Sensor services?
 
|  
 
|  
|-
 
| hid, hid:dbg, hid:sys
 
| [[HID services]]
 
|
 
 
|-
 
|-
 
| lbl
 
| lbl
Line 167: Line 172:
 
|  
 
|  
 
|-
 
|-
| ldn:m
+
| ldn:m, ldn:s, ldn:u
 
| [[Local Network Monitor services]]
 
| [[Local Network Monitor services]]
 
|
 
|
 
|-
 
|-
| ldr:ro, ldr:shel
+
| ldr:pm, ldr:ro, ldr:shel
 
| [[Loader services]]
 
| [[Loader services]]
 
|
 
|
Line 181: Line 186:
 
| lr
 
| lr
 
| ?
 
| ?
|
 
|-
 
| erpt:c
 
| Error Report services
 
 
|
 
|
 
|-
 
|-
Line 219: Line 220:
 
|  
 
|  
 
|-
 
|-
| nvdrv:a, nvmemp, mm:u
+
| nvdrv:a, nvdrv:s, nvdrv:t, nvmemp, mm:u
 
| [[NV services]]
 
| [[NV services]]
 
|
 
|
Line 229: Line 230:
 
| ovln:rcv, ovln:snd
 
| ovln:rcv, ovln:snd
 
| Overlay Notification services
 
| Overlay Notification services
|
+
| rcv: Receiver, snd: Sender
 
|-
 
|-
 
| pcie
 
| pcie
Line 239: Line 240:
 
|
 
|
 
|-
 
|-
| pcv
+
| pcv, pcv:imm
 
| ?
 
| ?
 
|  
 
|  
Line 267: Line 268:
 
|  
 
|  
 
|-
 
|-
| set, set:sys
+
| set, set:fd, set:cal, set:sys
 
| [[Settings services]]
 
| [[Settings services]]
| sys: System Settings
+
| cal: Calendar?, sys: System Settings
 
|-
 
|-
 
| sfdnsres
 
| sfdnsres

Revision as of 16:47, 7 June 2017

Services are system processes running in the background which wait for incoming requests. When a process wants to communicate with a service, it first needs to get a handle to the named service, and then it can communicate with the service via inter-process communication (each service has a name up to 8 characters).

Handles for services are retrieved from the service manager port, "sm:". Services are an abstraction of ports, they operate the same way except regular ports can have their handles retrieved directly from a SVC.

sm:

Cmd Name
0 #Initialize
1 #GetService
2 #RegisterService
3

Initialize

Word Value
0 0x00000004
1 0x8000000A
2 0x00000001
0-1 Pid
0 "SFCI"
1 0x00000000
2 Always 0.

GetService

Word Value
0 0x00000004
1 0x0000000A
0 "SFCI"
1 0x00000001
2 Service name, zero padded and casted to u64.

RegisterService

Word Value
0 0x00000004
1 0x0000000C
0 "SFCI"
1 0x00000002
2 Service name, zero padded and casted to u64.
3 Max sessions? 32-bit integer.
4 Unknown bool

Service List

Service names Description Notes
acc:u1, acc:aa, acc:su Account services u1: User, su: Admin
aoc:u AddOn Content services
appletAE, appletOE Applet services
apm, apm:p, apm:sys ?
arp:r, arp:w Activity Report services? r: Reader, w: Writer
audin:a, audin:d, audin:u, audout:a, audout:d, audout:u, audren:a, audren:d, audren:u Audio services
bgtc:t, bgtc:sc Task services
bpc, bpc:r ?
bsd:u, bsd:s Sockets services
btm, btm:dbg, btm:sys Bluetooth services?
caps:a, caps:c, caps:sc, caps:ss Capture services a: Album, ss: Screenshot
erpt:c, erpt:r Error Report services
es ETicket services?
fan ?
fatal:u, fatal:p Fatal Error services u: User, p: Privileged?
fgm ?
friend:u, friend:v, friend:m, friend:s, friend:a Friend services
fsp-srv, fsp-ldr, fsp-pr Filesystem services srv: Main, ldr: Loader, pr: Program Registry
gpio GPIO services
hid, hid:dbg, hid:sys HID services
i2c, i2c:pcv I2C services
irs, irs:sys IR Sensor services?
lbl ?
ldn:m, ldn:s, ldn:u Local Network Monitor services
ldr:pm, ldr:ro, ldr:shel Loader services
lm Log services
lr ?
mii:u, mii:e Mii services
ncm Content Manager services
nifm:u, nifm:a, nifm:s Network Interface services
nim, nim:shp NIM services shp: eShop
npns:u, npns:s ?
ns:am, ns:su, ns:dev NS Services am: Application Manager, su: System Update
nsd:u, nsd:a NSD services
ntc ?
nvdrv:a, nvdrv:s, nvdrv:t, nvmemp, mm:u NV services
omm ?
ovln:rcv, ovln:snd Overlay Notification services rcv: Receiver, snd: Sender
pcie PCIe services
pctl, pctl:a, pctl:s, pctl:r Parental Control services
pcv, pcv:imm ?
pdm:ntfy, pdm:qry Play Log services
pl:u Shared Font services
pm:bm, pm:shell Process Manager services
prepo:u, prepo:s, prepo:m, prepo:a Play Report services
psm ?
pwm ?
set, set:fd, set:cal, set:sys Settings services cal: Calendar?, sys: System Settings
sfdnsres DNS resolver services
spsm ?
ssl SSL services
tc ?
time:u, time:a, time:s Time services
ts ?
uart UART services
vi:m, vi:s, vi:u Display services