PDL_ServiceCall
Description
Makes a one-time call to a device service without a callback response.
See Accessing Services for more information and examples.
Syntax
PDL_Err PDL_ServiceCall(const char *uri, const char *payload);
Argument | Description |
---|---|
uri |
Service's URI (Uniform Resource Identifier). Has the form: "palm://<service name>/<service type>". For example: "palm://com.palm.applicationManager/launch" -- call the Application Manager's launch (an app) service. |
payload |
JSON (JavaScript Object Notation) style parameters. For example: "{ par1:"val1", par2:"val2", ...}" Note that, in C code, the inner double quotes would need to be escaped with a backslash ("\") |
Returns
PDL_ECONNECTION - Unable to dispatch service call. PDL_NOERROR - Success.
Example
PDL_err err = PDL_ServiceCall("palm://com.palm.applicationManager/launch", "{ \"id\":\"com.palm.app.email\"}");
This invokes the system's Application Manager service to launch the Palm's resident email application. Note the use of the backslash character ("\") to allow using a double quote within a double quote.
See also:
- PDL_ServiceCallWithCallback
- PDL_UnregisterServiceCallback
- PDL_GetParamDouble
- PDL_GetParamInt
- PDL_GetParamString
- PDL_ParamExists