libctru
v2.4.1
|
Service API. More...
Go to the source code of this file.
Functions | |
Result | srvInit (void) |
Initializes the service API. | |
void | srvExit (void) |
Exits the service API. | |
void | srvSetBlockingPolicy (bool nonBlocking) |
Makes srvGetServiceHandle non-blocking for the current thread (or blocking, the default), in case of unavailable (full) requested services. More... | |
Handle * | srvGetSessionHandle (void) |
Gets the current service API session handle. More... | |
Result | srvGetServiceHandle (Handle *out, const char *name) |
Retrieves a service handle, retrieving from the environment handle list if possible. More... | |
Result | srvRegisterClient (void) |
Registers the current process as a client to the service API. | |
Result | srvEnableNotification (Handle *semaphoreOut) |
Enables service notificatios, returning a notification semaphore. More... | |
Result | srvRegisterService (Handle *out, const char *name, int maxSessions) |
Registers the current process as a service. More... | |
Result | srvUnregisterService (const char *name) |
Unregisters the current process as a service. More... | |
Result | srvGetServiceHandleDirect (Handle *out, const char *name) |
Retrieves a service handle. More... | |
Result | srvRegisterPort (const char *name, Handle clientHandle) |
Registers a port. More... | |
Result | srvUnregisterPort (const char *name) |
Unregisters a port. More... | |
Result | srvGetPort (Handle *out, const char *name) |
Retrieves a port handle. More... | |
Result | srvWaitForPortRegistered (const char *name) |
Waits for a port to be registered. More... | |
Result | srvSubscribe (u32 notificationId) |
Subscribes to a notification. More... | |
Result | srvUnsubscribe (u32 notificationId) |
Unsubscribes from a notification. More... | |
Result | srvReceiveNotification (u32 *notificationIdOut) |
Receives a notification. More... | |
Result | srvPublishToSubscriber (u32 notificationId, u32 flags) |
Publishes a notification to subscribers. More... | |
Result | srvPublishAndGetSubscriber (u32 *processIdCountOut, u32 *processIdsOut, u32 notificationId) |
Publishes a notification to subscribers and retrieves a list of all processes that were notified. More... | |
Result | srvIsServiceRegistered (bool *registeredOut, const char *name) |
Checks whether a service is registered. More... | |
Result | srvIsPortRegistered (bool *registeredOut, const char *name) |
Checks whether a port is registered. More... | |
Service API.
Enables service notificatios, returning a notification semaphore.
semaphoreOut | Pointer to output the notification semaphore to. |
Retrieves a port handle.
out | Pointer to output the handle to. |
name | Name of the port. |
Retrieves a service handle, retrieving from the environment handle list if possible.
out | Pointer to write the handle to. |
name | Name of the service. |
Retrieves a service handle.
out | Pointer to output the handle to. |
name | Name of the service. |
Handle* srvGetSessionHandle | ( | void | ) |
Gets the current service API session handle.
Result srvIsPortRegistered | ( | bool * | registeredOut, |
const char * | name | ||
) |
Checks whether a port is registered.
registeredOut | Pointer to output the registration status to. |
name | Name of the port to check. |
Result srvIsServiceRegistered | ( | bool * | registeredOut, |
const char * | name | ||
) |
Checks whether a service is registered.
registeredOut | Pointer to output the registration status to. |
name | Name of the service to check. |
Result srvPublishAndGetSubscriber | ( | u32 * | processIdCountOut, |
u32 * | processIdsOut, | ||
u32 | notificationId | ||
) |
Publishes a notification to subscribers and retrieves a list of all processes that were notified.
processIdCountOut | Pointer to output the number of process IDs to. |
processIdsOut | Pointer to output the process IDs to. Should have size "60 * sizeof(u32)". |
notificationId | ID of the notification. |
Publishes a notification to subscribers.
notificationId | ID of the notification. |
flags | Flags to publish with. (bit 0 = only fire if not fired, bit 1 = do not report an error if there are more than 16 pending notifications) |
Receives a notification.
notificationIdOut | Pointer to output the ID of the received notification to. |
Registers a port.
name | Name of the port. |
clientHandle | Client handle of the port. |
Registers the current process as a service.
out | Pointer to write the service handle to. |
name | Name of the service. |
maxSessions | Maximum number of sessions the service can handle. |
void srvSetBlockingPolicy | ( | bool | nonBlocking | ) |
Makes srvGetServiceHandle non-blocking for the current thread (or blocking, the default), in case of unavailable (full) requested services.
blocking | Whether srvGetServiceHandle should be non-blocking. srvGetServiceHandle will always block if the service hasn't been registered yet, use srvIsServiceRegistered to check whether that is the case or not. |
Subscribes to a notification.
notificationId | ID of the notification. |
Result srvUnregisterPort | ( | const char * | name | ) |
Unregisters a port.
name | Name of the port. |
Result srvUnregisterService | ( | const char * | name | ) |
Unregisters the current process as a service.
name | Name of the service. |
Unsubscribes from a notification.
notificationId | ID of the notification. |
Result srvWaitForPortRegistered | ( | const char * | name | ) |
Waits for a port to be registered.
name | Name of the port to wait for registration. |