© 2009 OMTP Ltd. All rights reserved. OMTP and OMTP BONDI are registered trademarks of OMTP Ltd.
Common BONDI functionality.
StringArray
ByteArray
ShortArray
LongArray
FloatArray
Map
SuccessCallback
ErrorCallback
GenericError
DeviceAPIError
SecurityError
PendingOperation
bondi
| Interface | Method |
|---|---|
| SuccessCallback | void onSuccess(Object ob) |
| ErrorCallback | void onError(GenericError error) |
| GenericError | |
| DeviceAPIError | |
| SecurityError | |
| PendingOperation | boolean cancel() |
| bondi | PendingOperation requestFeature(SuccessCallback successCallback, ErrorCallback errorCallback, DOMString name) |
These definitions can be used in all other BONDI modules as dependencies.
StringArray
Array of DOMStrings.
typedef sequence<DOMString> StringArray;
ByteArray
Array of 8-bit unsigned integer values.
typedef sequence<octet> ByteArray;
ShortArray
Array of 16-bit signed integer values.
typedef sequence<short> ShortArray;
LongArray
Array of 32-bit signed integer values.
typedef sequence<long> LongArray;
FloatArray
Array of floating point values.
typedef sequence<float> FloatArray;
Map
Generic Map object.
typedef Object Map;
SuccessCallback
Generic success callback interface.
[Callback=FunctionOnly, NoInterfaceObject] interface SuccessCallback {
void onSuccess(in Object ob);
};
onSuccess
Method invoked when the asynchronous call completes successfully
void onSuccess(Object ob);
ErrorCallback
Generic error callback interface.
[Callback=FunctionOnly, NoInterfaceObject] interface ErrorCallback {
void onError(in GenericError error);
};
onError
Method invoked when an error occurs
void onError(GenericError error);
GenericError
Generic error interface.
interface GenericError {
readonly attribute unsigned short code;
};
[readonly]
unsigned
short
code
16-bit error code.
DeviceAPIError
DeviceApiError error interface.
interface DeviceAPIError : GenericError {
const unsigned short UNKNOWN_ERROR = 10000;
const unsigned short INVALID_ARGUMENT_ERROR = 10001;
const unsigned short NOT_FOUND_ERROR = 10002;
const unsigned short PENDING_OPERATION_ERROR = 10003;
const unsigned short IO_ERROR = 10004;
const unsigned short NOT_SUPPORTED_ERROR = 10005;
};
The error codes must be in the range 10000-19999.
This interface inherits from: GenericError
unsigned
short
UNKNOWN_ERROR
Unknown error.
unsigned
short
INVALID_ARGUMENT_ERROR
Invalid value was specified as input parameter.
unsigned
short
NOT_FOUND_ERROR
The searched value or object was not found.
unsigned
short
PENDING_OPERATION_ERROR
Operation is pending.
unsigned
short
IO_ERROR
Input/Output error.
unsigned
short
NOT_SUPPORTED_ERROR
Not supported error.
SecurityError
Security error interface.
interface SecurityError : GenericError {
const unsigned short PERMISSION_DENIED_ERROR = 20000;
};
The error codes must be in the range 20000-29999
This interface inherits from: GenericError
PendingOperation
PendingOperation.
interface PendingOperation {
boolean cancel();
};
Interface that is returned by asynchronous operations in order to provide a cancellation operation.
cancel
Call to cancel the underlying asynchronous operation.
boolean cancel();
This call is always successful, i.e. the pending operation i.e. either cancelled or one of the callback is called.
bondi
BONDI root API.
[NoInterfaceObject]
interface bondi {
PendingOperation requestFeature(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in DOMString name)
raises(DeviceAPIError, SecurityError);
};
requestFeature
Requests a feature.
PendingOperation requestFeature(SuccessCallback successCallback, ErrorCallback errorCallback, DOMString name);
This function requests a named feature asynchronously and returns a pending operation object. If it succeeds it calls the successCallback and passes in the object of the requested feature. If it fails it calls the errorCallback passing in a DeviceAPIError which provides an error message and error code indicating the nature of the error.
If the requested feature binds itself to a root namespace ( for example, "bondi.pim.contact") this will happen prior to the successCallback being invoked.
The errorCallback will receive one of the following errors: