6.11.2 SetInfo
SetInfo
modifies the value of a system attribute. It takes a set of input parameters that define entity and key of SystemAttribute
to modify the value of system attribute.
It is available in only synchronous mode.
The following is an example for using GetInfo
:
Synchronous
sysinfo_handle.call("SetInfo", {"Entity": u"General",
"Key":u"VibraActive",
"SystemData" {"Status": 1}})
The following table summarizes the specification of GetInfo
:
Interface |
ISysinfo |
Description |
Modifies the value of a system attribute. |
Response Model |
Synchronous |
Pre-condition |
ISysInfo Interface is loaded. |
Post-condition |
Changes the system attribute on success |
Input Parameters
Input parameter specifies an entity and key of system attribute.
Table 6.209:
Input parameters for SetInfo
Name |
Type |
Range |
Description |
Entity |
unicode string |
For complete list of supported Entities, refer Key Values 6.11.4 section. |
Entity of system attribute. For example, Connectivity
Display and so on. |
Key |
unicode string |
For complete list of supported Keys, refer Key Values 6.11.4 section. |
Key of system attribute. For example, Bluetooth
Wallpaper and so on. |
SystemData |
map |
Status information
Status: int
Wallpaper path
StringData : unicode string |
This map must contain one of the input data specifiers defined in System Data.
For more information on input specifier refer the section Key Values 6.11.4. |
|
Output Parameters
Output parameter contains ErrorCode
and an ErrorMessage
, if the operation fails.
Table 6.210:
Output parameters for GetInfo
Name |
Type |
Range |
Description |
ErrorCode |
int |
NA |
Contains the SAPI specific error code when the operation fails. |
ErrorMessage |
string |
NA |
Error Description in Engineering English. |
|
Errors
The following table lists the error codes and their values:
Table 6.211:
Error codes
Error code value |
Description |
1002 |
Bad argument type |
1003 |
Missing argument |
1004 |
Service not supported |
1011 |
Access denied |
1012 |
Item not found |
1014 |
General error |
1017 |
Path not found |
|
Error Messages
The following table lists the error messages and their description:
Table 6.212:
Error messages
Error messages |
Description |
SysInfo:SetInfo: Insufficient Arguments to process |
At least two input arguments are expected to process SetInfo service request. |
SysInfo:SetInfo: Entity:Input Parameter Missing |
Indicates mandatory parameter Entity is missing in the service request. |
SysInfo:SetInfo: Key:Input Parameter Missing |
Indicates mandatory parameter Key is missing in the service request. |
SysInfo:SetInfo: Incorrect SystemData Type, SystemData Must be a Map |
Indicates that either the optional parameter SystemData specified is not a map or content of the map is inappropriate to process request. |
SysInfo:SetInfo: SystemData Argument Missing |
Indicates that mandatory parameter SystemData is not specified in input argument list. |
SysInfo:SetInfo: ASync Version Not Supported |
This message is given when SetInfo is requested by specifying callback or CmdOptions set to Asynchronous request type. |
|
Example
The following sample code illustrates how to set Vibra mode:
# Synchronous example: Setting Vibra mode
import scriptext
# Load sysinfo service
sysinfo_handle = scriptext.load('Service.SysInfo', 'ISysInfo')
# Make a request to set vibra mode
try:
sysinfo_handle.call("SetInfo", {"Entity": u"General", "Key": u"VibraActive", "SystemData": {"Status": 1}})
print "Request complete!"
except scriptext.ScriptextError:
print 'Error in servicing the request'
Release 2.0.0 final , documentation updated on 10 Feb 2010.
See About this document... for information on suggesting changes.