Previous Topic

Next Topic

Book Contents

Book Index

Peripheral JSON-RPC API

JSON-RPC interfacing methods provided by the Peripheral Module.

The bundle exporting this API is Peripheral JSON-RPC Bundle

PeripheralAdmin

Method

Return Value

Parameters

Parameter Description

PeripheralAdmin/getPeripheral

Peripheral. Error if no peripheral with such uid is found or if the filter is incorrect

  • uid: string
  • uid: string – The unique ID of the peripheral.

PeripheralAdmin/getPeripheral

Peripheral[]. Null can be return if no peripherals are found against filter. Error will be returned if the filter is incorrect.

  • filter: string
  • filter: string – LDAP filter that matches the properties of the peripheral. If it is null or empty string all peripherals are returned.

PeripheralAdmin/addPeripheral

void

  • nativeID: String
  • properties: Map
  • peer: Object
  • nativeID: String – UID of the peripheral to be added.
  • properties: Map – The new peripheral described as a key-value map of properties.
  • peer: Object – Protocol (interface) specific object, in mos cases: null.

PeripheralAdmin/removePeripheral

void

  • nativeID: String
  • nativeID: String – UID of the peripheral to be removed.

PeripheralAdmin/actionPeripheral

Error as a string or an empty string on success.

  • uid: string
  • action: string
  • uid: string – The UID of the peripheral upon which the action is performed.
  • action: string – The action name. Currently supported actions are: "uninstal", "enable" and "disable".

PeripheralDescriptorAdmin

Method

Return Value

Parameters

Parameter Description

PeripheralDescriptorAdmin/addDescriptor

Error if the descriptor with the given UID already exists or the descriptor to be added contains inconsistent information.

  • descriptor: PeripheralDescriptorExt
  • descriptor: PeripheralDescriptorExt – The new peripheral descriptor described as a key-value map of UID and other properties.

PeripheralDescriptorAdmin/removeDescriptor

boolean. Return true if the descriptor is removed.

  • uid: string
  • uid: string – The UID the the peripheral descriptor.

PeripheralDescriptorAdmin/getDescriptor

Map of the descriptor's properties. Null if peripheral descriptor was not found

  • uid: string
  • uid: string – The UID of the peripheral descriptor.

PeripheralDescriptorAdmin/getDescriptors

PeripheralDescriptor[]. Empty array if no elements.

 

 

PeripheralDescriptorAdmin/setDescriptors

Error if the some of the descriptors to be added contains inconsistent information or is null.

  • descriptors: PeripheralDescriptorExt[]
  • descriptors: PeripheralDescriptorExt[] – The new peripheral descriptors. The old descriptors will be removed.

PeripheralDescriptorAdmin/setPeripheralDescripto

 

  • peripheralUID: string
  • descriptorUID: string
  • peripheralUID: string – The UID of the peripheral.
  • descriptorUID: string – The UID of the peripheral descriptor.

PeripheralDescriptorAdmin/actionDriver

Error as a string or an empty string on success.

  • descriptorUID: string
  • action: string
  • descriptorUID: string – The UID of the peripheral descriptor upon which the action is performed.
  • action: string – The action name. Currently supported actions are: "start", "stop", "install", "uninstall", "update", "enable" and "disable".

PeripheralObserverAdmin

Method

Return Value

Parameters

Parameter Description

PeripheralObserverAdmin/getObservers

Map[] containing bundle ids, symbolic names and state. Empty array if missing.

 

 

PeripheralObserverAdmin/actionObserver

Error as a string or an empty string on success.

  • strBundleId: string
  • action: string
  • strBundleId: string – The ID of the observer bundle. The bundle id is represented as a string. It must contain the numeric (long) value of the bundle id.
  • action: string – The action name. Currently supported actions are: "start", "stop" and "restart".

Common Object Definitions

Object

Field

Field Description

Supported JSON Types

  • No
  • string, number, object, array, true, false, null. We use boolean when boolean can be return. Number can be used to represent int and double.

Peripheral

  • UID: string
  • Name: string
  • Vendor: string
  • Version: string
  • Type: string
  • Interface: int
  • Status: int
  • StatusDetails: StatusDetails
  • ConfiguredPID: string
  • SpecificProperties: object
  • Properties: object
  • PeripheralDescriptor: PeripheralDescriptor
  • UID: string – The unique ID of the peripheral.
  • Name: string – Descriptive name of the peripheral. It is optional.
  • Vendor: string – The vendor of the peripheral. It is optional.
  • Version: string – The version of the peripheral. It is optional.
  • Type: string – The type of the peripheral. Example is Network Adapter, Storage, Camera, etc. It is optional.
  • Interface: int – The peripheral interface type. Can be one of :
  • -1 – Simulation,
  • 0 – USB,
  • 1 – ESATA,
  • 2 – FireWire,
  • 3 – Ethernet,
  • 4 – Serial COM,
  • 5 – LPT,
  • 6 – PCMCIA,
  • 7 – ExpressCard,
  • 8 – UPnP.
  • Status: int – The peripheral status. Can be one of:
  • 0 – online,
  • 1 – offline,
  • 2 – not associated,
  • 3 – removed.
  • Online means that peripheral is working correctly. Offline means that that there is a problem. Not associated means that this is unknown peripheral.
  • StatusDetails: StatusDetails – Detailed info for the status of the peripheral. It is optional.
  • ConfiguredPID: string – The pid configured for the peripheral. It is optional.
  • SpecificProperties: object – Specific properties of the peripheral. It is optional.
  • Properties: object – The properties of the peripheral. They are protocol related.
  • PeripheralDescriptor: PeripheralDescriptor – Info about the mapped peripheral descriptor to a peripheral. It is optional.

PeripheralDescriptor

  • UID: string
  • SpecificPropertyNames: string[]
  • MatchProperties: object
  • DriverInfo: DriverInfo
  • UID: string – The unique ID of the peripheral descriptor.
  • SpecificPropertyNames: string[] – Specific property names for the peripheral descriptor. It is optional
  • MatchProperties: object – Peripheral descriptor match properties. These properties are protocol specific. They are use to match descriptor with peripheral.
  • DriverInfo: DriverInfo – The driver info. It is optional. If not present, driver is not required.

PeripheralDescriptorExt

  • Name: string
  • Vendor: string
  • Version: string
  • Type: string
  • PeripheralDescriptor: PeripheralDescriptor
  • Name: string – Descriptive name of the peripheral. It is optional.
  • Vendor: string – The vendor of the peripheral. It is optional.
  • Version: string – The version of the peripheral. It is optional.
  • Type: string – The type of the peripheral. Example is Network Adapter, Storage, Camera, etc. It is optional.
  • PeripheralDescriptor: PeripheralDescriptor – The peripheral descriptor.

DriverInfo

  • Status: int
  • OperationError: OperationError
  • FPID: string
  • PID: string
  • ConfigurationProperties: String[]
  • DriverElementsInfo: DriverElementInfo[]
  • Status: int – The status of the driver. Can be one of:
  • 0 – not initialized,
  • 1 – installed,
  • 2 – not installed,
  • 3 – partially installed,
  • 4 – not available,
  • 5 – installing,
  • 6 – updating,
  • 7 – uninstalling.
  • OperationError: OperationError – The exception thrown during last install, uninstall or update. It is optional.
  • FPID: string – The fpid of the factory configuration. It is optional.
  • PID: string – The pid of the configuration. It is optional.
  • ConfigurationProperties: String[] – The configuration properties. It is optional.
  • DriverElementsInfo: DriverElementInfo[] – The elements of the driver. It is optional.

OperationError

  • ErrorCode: int
  • ErrorMessage: string
  • ErrorCode: int – The error code. Can be one of:
  • 1 – network,
  • 2 – driver not available,
  • 3 – installer not available,
  • 4 – driver not started,
  • 5 – operation failed
  • ErrorMessage: string – The message of the error. It is optional.

StatusDetails

  • Code: int
  • Message: string
  • Code: int – Can be one of :
  • -2 – wrong credentials,
  • -1 – communication error,
  • 0 – driver operation pending,
  • 1 – driver not operational
  • Message: string – The status message. It is optional.

DriverElementInfo

  • UID: string
  • Type: int
  • Vendor: string
  • RequiredVersion: string
  • RuntimeVersion: string
  • UID: string – The unique ID of the driver element.
  • Type: int – The type of the driver element. The type can be one of:
  • 0 – OSGi bundle,
  • 1 – OS driver,
  • 2 – Remote Management application.
  • Vendor: string – The vendor of the driver element. It is optional.
  • RequiredVersion: string – The required version of the driver element.
  • RuntimeVersion: string – The runtime version of the installed driver element. It is optional. If it is missing, then the driver element is not installed.