com.tibbo.aggregate.common.device

## Interface DeviceContext<C extends ServerContext>

- All Superinterfaces:
    java.lang.Comparable<C>, Context<C>, EvaluationPoint, ServerContext<C>

      public interface DeviceContext<C extends ServerContext>
      extends ServerContext<C>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CHANGE_EVENT_TIMESTAMP_DRIVER`
    `static int` | `CHANGE_EVENT_TIMESTAMP_SERVER`
    `static int` | `CONNECTION_STATUS_MAINTENANCE`
    `static int` | `CONNECTION_STATUS_OFFLINE`
    `static int` | `CONNECTION_STATUS_ONLINE`
    `static int` | `CONNECTION_STATUS_SUSPENDED`
    `static int` | `CONNECTION_STATUS_UNKNOWN`
    `static int` | `CURRENT_SYNC_STATUS_CONNECTING`
    `static int` | `CURRENT_SYNC_STATUS_READING_METADATA`
    `static int` | `CURRENT_SYNC_STATUS_SYNCHRONIZING_PROPERTIES`
    `static int` | `DIRECTION_AUTO`
    `static int` | `DIRECTION_DEVICE_TO_SERVER`
    `static int` | `DIRECTION_NONE`
    `static int` | `DIRECTION_SERVER_TO_DEVICE`
    `static int` | `HISTORY_RATE_ERROR`
    `static int` | `HISTORY_RATE_NORMAL`
    `static int` | `HISTORY_RATE_OFFLINE_ERROR`
    `static int` | `HISTORY_RATE_UNCHANGED`
    `static int` | `HISTORY_RATE_UNCHANGED_ERROR`
    `static int` | `HISTORY_RATE_UNCHANGED_OFFLINE`
    `static int` | `HISTORY_RATE_UNCHANGED_OFFLINE_ERROR`
    `static int` | `SYNC_MODE_CUSTOM`
    `static int` | `SYNC_MODE_DIRECT_ACCESS`
    `static int` | `SYNC_MODE_DIRECT_WRITE`
    `static int` | `SYNC_MODE_DISABLED`
    `static int` | `SYNC_MODE_IGNORE_MODIFICATION_TIME`
    `static int` | `SYNC_MODE_MASTER_VALUE`
    `static int` | `SYNC_MODE_NORMAL`
    `static int` | `SYNC_MODE_READ_ONLY`
    `static int` | `SYNC_STATUS_CONNECTING`
    `static int` | `SYNC_STATUS_ERROR`
    `static int` | `SYNC_STATUS_OK`
    `static int` | `SYNC_STATUS_READING_METADATA`
    `static int` | `SYNC_STATUS_SYNCHRONIZING_SETTINGS`
    `static int` | `SYNC_STATUS_UNDEFINED`
    `static int` | `SYNC_STATUS_WAITING`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `asyncVariableUpdate(java.lang.String variable, DataTable value)` Should be called by the device driver once new setting's value was asynchronously received from the hardware.
    `EventDefinition` | `discoverDeviceEvent(java.lang.String name, int timeout, java.lang.Object helper)` Forces the device driver to discover a new event and adds it to context if found.
    `FunctionDefinition` | `discoverDeviceFunction(java.lang.String name, int timeout, java.lang.Object helper)` Forces the device driver to discover a new function and adds it to context if found.
    `VariableDefinition` | `discoverDeviceVariable(java.lang.String name, int timeout, java.lang.Object helper)` Forces the device driver to discover a new variable and adds it to context if found.
    `SynchronizationResult` | `executeSynchronization(SynchronizationParameters parameters)` Executes a synchronous synchronization using provided parameters.
    `java.lang.String` | `getAddress()` This method returns string representation of device address or null if device has no address.
    `java.util.List<DeviceAssetDefinition>` | `getAssets()` This method returns the list of device assets.
    `CallerController` | `getCallerController()` Returns caller controller with effective permissions of the user owning this device account.
    `DeviceDriver` | `getDriver()` Returns device driver used by this device account.
    `DeviceSettingStatus` | `getSettingStatus(java.lang.String variable)` Returns synchronization status of a device setting variable.
    `java.util.concurrent.locks.ReentrantLock` | `getSynchronizationLock()` Returns synchronization lock.
    `SettingSynchronizationOptions` | `getSynchronizationOptions(java.lang.String variable)` Returns synchronization options of a device setting variable.
    `boolean` | `isOnline()` Returns device online status.
    `void` | `processHistoricalValue(java.lang.String variable, java.util.Date timestamp, DataTable value)` Should be called by the device driver once a new historical value of a device setting was received from hardware.
    `void` | `removeCustomSynchronizationHandler(java.lang.String variable)` Removes custom synchronization handler of a device setting variable.
    `void` | `requestAssetsUpdate()` Should be called by the driver to force re-reading of device assets during next synchronization.
    `void` | `requestReconnection()` Should be called by device driver to request reconnection to the hardware in the beginning of the next synchronization cycle.
    `void` | `requestSynchronization()` Should be called by the device driver to request full synchronization.
    `void` | `requestSynchronization(boolean useExtendedStatus)` Same as `requestSynchronization()`, but allows to temporarily enable extended connection status.
    `void` | `requestSynchronization(SynchronizationParameters parameters)` Same as `requestSynchronization()`, but allows to specify custom synchronization options.
    `void` | `setAccessSettingReinitializer(java.lang.String variable, AccessSettingReinizializer reinitializer)` Sets an access setting reinitializer in the device context.
    `void` | `setCustomSynchronizationHandler(java.lang.String variable, SynchronizationHandler handler, boolean forceCustomSyncMode)` Sets custom synchronization handler for a device setting variable.
    `void` | `setDefaultCacheMode(int mode)` Sets default device setting cache mode.
    `void` | `setDefaultColorExpression(java.lang.String expression)` Sets default color expression for the device account.
    `void` | `setDefaultEventStoragePeriod(long defaultEventStoragePeriod)` Sets default event storage period for the device account.
    `void` | `setDefaultLatitudeExpression(java.lang.String expression)` Sets default latitude expression for the device account.
    `void` | `setDefaultLongitudeExpression(java.lang.String expression)` Sets default longitude expression for the device account.
    `void` | `setDefaultStatusExpression(java.lang.String expression)` Sets default status expression for the device account.
    `void` | `setDefaultSynchronizationOptions(java.lang.String variable, boolean local, SettingSynchronizationOptions options)` Sets default synchronization options for a device setting variable.
    `void` | `setDefaultSynchronizationOptions(java.lang.String variable, SettingSynchronizationOptions options)` Sets default synchronization options for a device setting variable.
    `void` | `setDefaultSynchronizationPeriod(long period)` Sets default synchronization period for the device account.
    `void` | `setDeviceType(java.lang.String deviceType)` Sets the "secondary" type of device context.
    `void` | `setOnline(boolean online)` Sets new synchronization status for the device.
    `void` | `setUsePredefinedQualityCodes(boolean value)` Allows the server to use predefined quality codes for device settings.

    - ### Methods inherited from interface com.tibbo.aggregate.common.server.ServerContext

      `addedToGroup, addVisibleChild, alertActivated, alertDeactivated, checkPermissions, createDefaultStatisticsChannels, eventAcknowledged, eventEnriched, getDefaultValue, getDependentContexts, getDependentVariables, getGroups, getMembers, getMembers, getShortDescription, hasVisibleChild, initAction, removedFromGroup, removeVariableValue, removeVisibleChild, setIndex, shouldBeHidden`

    - ### Methods inherited from interface com.tibbo.aggregate.common.context.Context

      `accept, addActionDefinition, addAlias, addChild, addEventDefinition, addEventListener, addEventListener, addFunctionDefinition, addVariableDefinition, callFunction, callFunction, callFunction, callFunction, callFunction, callFunction, callFunction, destroy, destroyChild, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, get, get, getActionDefinition, getActionDefinition, getActionDefinitions, getActionDefinitions, getActionDefinitions, getChild, getChild, getChildren, getChildren, getChildrenViewPermissions, getContextManager, getDefaultActionDefinition, getDescription, getEventData, getEventDefinition, getEventDefinition, getEventDefinitions, getEventDefinitions, getEventDefinitions, getEventDefinitions, getEventDefinitions, getEventHistory, getFunctionData, getFunctionDefinition, getFunctionDefinition, getFunctionDefinitions, getFunctionDefinitions, getFunctionDefinitions, getFunctionDefinitions, getFunctionDefinitions, getGroup, getIconId, getIndex, getLocalPrimaryRoot, getLocalRoot, getMappedChildren, getMappedChildren, getName, getParent, getPath, getPeerPath, getPeerRoot, getPermissions, getRemotePath, getRemoteRoot, getRoot, getStatus, getType, getVariable, getVariable, getVariable, getVariableClone, getVariableData, getVariableDefinition, getVariableDefinition, getVariableDefinitions, getVariableDefinitions, getVariableDefinitions, getVariableDefinitions, getVariableDefinitions, getVariableObject, getVisibleChildren, getVisibleChildren, hasMappedChild, hasParent, hasVisibleChild, isContainer, isDistributed, isInitializedChildren, isInitializedEvents, isInitializedFunctions, isInitializedInfo, isInitializedStatus, isInitializedVariables, isInstallationAllowed, isMapped, isProxy, isSetupComplete, isStarted, move, removeActionDefinition, removeChild, removeChild, removeEventDefinition, removeEventListener, removeFunctionDefinition, removeVariableDefinition, setParent, setup, setVariable, setVariable, setVariable, setVariable, setVariable, setVariableField, setVariableField, setVariableField, setVariableField, start, stop, teardown, toDetailedString, updateEventDefinitions, updateFunctionDefinitions, updatePrepare, updateVariableDefinitions`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

    - ### Methods inherited from interface com.tibbo.aggregate.common.expression.EvaluationPoint

      `isDebuggingEvaluations, processEvaluation, processEvaluationError`

- - ### Field Detail

    - #### CONNECTION_STATUS_OFFLINE

          static final int CONNECTION_STATUS_OFFLINE

      See Also:
        Constant Field Values

    - #### CONNECTION_STATUS_ONLINE

          static final int CONNECTION_STATUS_ONLINE

      See Also:
        Constant Field Values

    - #### CONNECTION_STATUS_SUSPENDED

          static final int CONNECTION_STATUS_SUSPENDED

      See Also:
        Constant Field Values

    - #### CONNECTION_STATUS_UNKNOWN

          static final int CONNECTION_STATUS_UNKNOWN

      See Also:
        Constant Field Values

    - #### CONNECTION_STATUS_MAINTENANCE

          static final int CONNECTION_STATUS_MAINTENANCE

      See Also:
        Constant Field Values

    - #### SYNC_STATUS_OK

          static final int SYNC_STATUS_OK

      See Also:
        Constant Field Values

    - #### SYNC_STATUS_WAITING

          static final int SYNC_STATUS_WAITING

      See Also:
        Constant Field Values

    - #### SYNC_STATUS_ERROR

          static final int SYNC_STATUS_ERROR

      See Also:
        Constant Field Values

    - #### SYNC_STATUS_UNDEFINED

          static final int SYNC_STATUS_UNDEFINED

      See Also:
        Constant Field Values

    - #### SYNC_STATUS_CONNECTING

          static final int SYNC_STATUS_CONNECTING

      See Also:
        Constant Field Values

    - #### SYNC_STATUS_READING_METADATA

          static final int SYNC_STATUS_READING_METADATA

      See Also:
        Constant Field Values

    - #### SYNC_STATUS_SYNCHRONIZING_SETTINGS

          static final int SYNC_STATUS_SYNCHRONIZING_SETTINGS

      See Also:
        Constant Field Values

    - #### CURRENT_SYNC_STATUS_CONNECTING

          static final int CURRENT_SYNC_STATUS_CONNECTING

      See Also:
        Constant Field Values

    - #### CURRENT_SYNC_STATUS_READING_METADATA

          static final int CURRENT_SYNC_STATUS_READING_METADATA

      See Also:
        Constant Field Values

    - #### CURRENT_SYNC_STATUS_SYNCHRONIZING_PROPERTIES

          static final int CURRENT_SYNC_STATUS_SYNCHRONIZING_PROPERTIES

      See Also:
        Constant Field Values

    - #### SYNC_MODE_NORMAL

          static final int SYNC_MODE_NORMAL

      See Also:
        Constant Field Values

    - #### SYNC_MODE_DISABLED

          static final int SYNC_MODE_DISABLED

      See Also:
        Constant Field Values

    - #### SYNC_MODE_DIRECT_ACCESS

          static final int SYNC_MODE_DIRECT_ACCESS

      See Also:
        Constant Field Values

    - #### SYNC_MODE_MASTER_VALUE

          static final int SYNC_MODE_MASTER_VALUE

      See Also:
        Constant Field Values

    - #### SYNC_MODE_IGNORE_MODIFICATION_TIME

          static final int SYNC_MODE_IGNORE_MODIFICATION_TIME

      See Also:
        Constant Field Values

    - #### SYNC_MODE_READ_ONLY

          static final int SYNC_MODE_READ_ONLY

      See Also:
        Constant Field Values

    - #### SYNC_MODE_DIRECT_WRITE

          static final int SYNC_MODE_DIRECT_WRITE

      See Also:
        Constant Field Values

    - #### SYNC_MODE_CUSTOM

          static final int SYNC_MODE_CUSTOM

      See Also:
        Constant Field Values

    - #### DIRECTION_NONE

          static final int DIRECTION_NONE

      See Also:
        Constant Field Values

    - #### DIRECTION_AUTO

          static final int DIRECTION_AUTO

      See Also:
        Constant Field Values

    - #### DIRECTION_DEVICE_TO_SERVER

          static final int DIRECTION_DEVICE_TO_SERVER

      See Also:
        Constant Field Values

    - #### DIRECTION_SERVER_TO_DEVICE

          static final int DIRECTION_SERVER_TO_DEVICE

      See Also:
        Constant Field Values

    - #### HISTORY_RATE_UNCHANGED

          static final int HISTORY_RATE_UNCHANGED

      See Also:
        Constant Field Values

    - #### HISTORY_RATE_NORMAL

          static final int HISTORY_RATE_NORMAL

      See Also:
        Constant Field Values

    - #### HISTORY_RATE_ERROR

          static final int HISTORY_RATE_ERROR

      See Also:
        Constant Field Values

    - #### HISTORY_RATE_UNCHANGED_OFFLINE

          static final int HISTORY_RATE_UNCHANGED_OFFLINE

      See Also:
        Constant Field Values

    - #### HISTORY_RATE_UNCHANGED_ERROR

          static final int HISTORY_RATE_UNCHANGED_ERROR

      See Also:
        Constant Field Values

    - #### HISTORY_RATE_OFFLINE_ERROR

          static final int HISTORY_RATE_OFFLINE_ERROR

      See Also:
        Constant Field Values

    - #### HISTORY_RATE_UNCHANGED_OFFLINE_ERROR

          static final int HISTORY_RATE_UNCHANGED_OFFLINE_ERROR

      See Also:
        Constant Field Values

    - #### CHANGE_EVENT_TIMESTAMP_DRIVER

          static final int CHANGE_EVENT_TIMESTAMP_DRIVER

      See Also:
        Constant Field Values

    - #### CHANGE_EVENT_TIMESTAMP_SERVER

          static final int CHANGE_EVENT_TIMESTAMP_SERVER

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getCallerController

          CallerController getCallerController()

      Returns caller controller with effective permissions of the user owning this device account.
      Returns:
        Caller controller

    - #### getDriver

          DeviceDriver getDriver()

      Returns device driver used by this device account.
      Returns:
        Device driver

    - #### getAddress

          java.lang.String getAddress()

      This method returns string representation of device address or null if device has no address. The call is delegated to device driver.
      Returns:
        Device address

    - #### getAssets

          java.util.List<DeviceAssetDefinition> getAssets()

      This method returns the list of device assets.
      Returns:
        Device assets list

    - #### getSynchronizationOptions

          SettingSynchronizationOptions getSynchronizationOptions(java.lang.String variable)

      Returns synchronization options of a device setting variable.
      Parameters:
        `variable` - Name of variable
      Returns:
        Synchronization options

    - #### getSettingStatus

          DeviceSettingStatus getSettingStatus(java.lang.String variable)

      Returns synchronization status of a device setting variable.
      Parameters:
        `variable` - Name of variable
      Returns:
        Synchronization status

    - #### isOnline

          boolean isOnline()

      Returns device online status. Note that online status may be reported incorrectly if device is suspended.
      Returns:
        true if device is online, false otherwise

    - #### setDefaultSynchronizationPeriod

          void setDefaultSynchronizationPeriod(long period)

      Sets default synchronization period for the device account. This method is often called from DeviceDriver.setupDeviceContext(). The default period will be used only for newly created device accounts. This method will have no effect if default synchronization period has already been changed for an account.
      Parameters:
        `period` - New default synchronization period

    - #### setDefaultStatusExpression

          void setDefaultStatusExpression(java.lang.String expression)

      Sets default status expression for the device account. This method is often called from DeviceDriver.setupDeviceContext(). The default status expression will be used only for newly created device accounts. This method will have no effect if default status expression has already been changed for an account.
      Parameters:
        `expression` - New default status expression

    - #### setDefaultColorExpression

          void setDefaultColorExpression(java.lang.String expression)

      Sets default color expression for the device account. This method is often called from DeviceDriver.setupDeviceContext(). The default color expression will be used only for newly created device accounts. This method will have no effect if default color expression has already been changed for an account.
      Parameters:
        `expression` - New default color expression

    - #### setDefaultLatitudeExpression

          void setDefaultLatitudeExpression(java.lang.String expression)

      Sets default latitude expression for the device account. This method is often called from DeviceDriver.setupDeviceContext(). The default latitude expression will be used only for newly created device accounts. This method will have no effect if default latitude expression has already been changed for an account.
      Parameters:
        `expression` - New default latitude expression

    - #### setDefaultLongitudeExpression

          void setDefaultLongitudeExpression(java.lang.String expression)

      Sets default longitude expression for the device account. This method is often called from DeviceDriver.setupDeviceContext(). The default longitude expression will be used only for newly created device accounts. This method will have no effect if default longitude expression has already been changed for an account.
      Parameters:
        `expression` - New default longitude expression

    - #### setDefaultCacheMode

          void setDefaultCacheMode(int mode)

      Sets default device setting cache mode. This method is often called from DeviceDriver.setupDeviceContext(). The default mode will be used only for newly created device accounts. This method will have no effect if default mode has already been changed for an account.
      Parameters:
        `mode` - Cache mode (`GenericPropertiesConstants.CACHE_DATABASE` = Database, `GenericPropertiesConstants.CACHE_MEMORY` = Memory)

    - #### setDefaultEventStoragePeriod

          void setDefaultEventStoragePeriod(long defaultEventStoragePeriod)

      Sets default event storage period for the device account. This method is often called from DeviceDriver.setupDeviceContext(). The default period will be used only for newly created device accounts. This method will have no effect if default event storage period has already been changed for an account.
      Parameters:
        `defaultEventStoragePeriod` - New default event storage period

    - #### setDefaultSynchronizationOptions

          void setDefaultSynchronizationOptions(java.lang.String variable,
                                                SettingSynchronizationOptions options)

      Sets default synchronization options for a device setting variable. This call will modify system-wide list of default synchronization options that may be accessed via server global settings. The default synchronization options will be used only for newly created device accounts. This method will have no effect if default setting synchronization options have already been changed for an account.
      Parameters:
        `variable` - Name of variable
        `options` - Default synchronization options

    - #### setDefaultSynchronizationOptions

          void setDefaultSynchronizationOptions(java.lang.String variable,
                                                boolean local,
                                                SettingSynchronizationOptions options)

      Sets default synchronization options for a device setting variable. This call can modify system-wide or local (account-wide) list of default synchronization options.
      Parameters:
        `variable` - Name of variable
        `local` - Whether to modify system-wide or local default synchronization options list
        `options` - Default synchronization options

    - #### setCustomSynchronizationHandler

          void setCustomSynchronizationHandler(java.lang.String variable,
                                               SynchronizationHandler handler,
                                               boolean forceCustomSyncMode)

      Sets custom synchronization handler for a device setting variable.
      Parameters:
        `variable` - Name of variable
        `handler` - Synchronization handler
        `forceCustomSyncMode` - Switch setting to a custom synchronization mode if true

    - #### removeCustomSynchronizationHandler

          void removeCustomSynchronizationHandler(java.lang.String variable)

      Removes custom synchronization handler of a device setting variable. If variable was in custom synchronization mode, the mode is changed to normal.
      Parameters:
        `variable` - Name of variable

    - #### setDeviceType

          void setDeviceType(java.lang.String deviceType)
                      throws ContextException

      Sets the "secondary" type of device context. Full type will be device.deviceType, where "device" is the base type. This method should be called from `DeviceDriver.setupDeviceContext(DeviceContext)`.
      Parameters:
        `deviceType` - Device type string
      Throws:
        `ContextException` - If device type change fails since device controller of a new device type cannot be applied to current device context

    - #### setAccessSettingReinitializer

          void setAccessSettingReinitializer(java.lang.String variable,
                                             AccessSettingReinizializer reinitializer)

      Sets an access setting reinitializer in the device context. The reinitializer is supposed to react to a changed device access setting change. However, in most cases the system just reconnects to the device and resynchronizes it after access setting change, so no custom reinitializers are necessary.
      Parameters:
        `variable` - Name of access setting variable those changes should be tracked
        `reinitializer` - The reinitializer

    - #### requestReconnection

          void requestReconnection()

      Should be called by device driver to request reconnection to the hardware in the beginning of the next synchronization cycle.

    - #### requestSynchronization

          void requestSynchronization()

      Should be called by the device driver to request full synchronization. The synchronization will be started right after the ongoing synchronization completes if it's currently running.

    - #### requestSynchronization

          void requestSynchronization(boolean useExtendedStatus)

      Same as `requestSynchronization()`, but allows to temporarily enable extended connection status.

    - #### requestSynchronization

          void requestSynchronization(SynchronizationParameters parameters)

      Same as `requestSynchronization()`, but allows to specify custom synchronization options.

    - #### requestAssetsUpdate

          void requestAssetsUpdate()

      Should be called by the driver to force re-reading of device assets during next synchronization.

    - #### asyncVariableUpdate

          void asyncVariableUpdate(java.lang.String variable,
                                   DataTable value)
                            throws DisconnectionException,
                                   ContextException,
                                   DeviceException

      Should be called by the device driver once new setting's value was asynchronously received from the hardware. This method updates settings cache.
      Throws:
        `DisconnectionException`
        `ContextException`
        `DeviceException`

    - #### processHistoricalValue

          void processHistoricalValue(java.lang.String variable,
                                      java.util.Date timestamp,
                                      DataTable value)
                               throws ContextException

      Should be called by the device driver once a new historical value of a device setting was received from hardware. This method stores value in the server database and updates associated statistical channels.
      Throws:
        `ContextException`

    - #### getSynchronizationLock

          java.util.concurrent.locks.ReentrantLock getSynchronizationLock()

      Returns synchronization lock.

    - #### executeSynchronization

          SynchronizationResult executeSynchronization(SynchronizationParameters parameters)

      Executes a synchronous synchronization using provided parameters. Warning: the synchronization lock must be obtained before the call to this method and released later on.

    - #### setOnline

          void setOnline(boolean online)

      Sets new synchronization status for the device. This method must be called by the driver in the end of synchronization only for devices those `DeviceDriver.isUsesConnections()` method returns false. The method is normally called from `DeviceDriver.finishSynchronization()`.
      Parameters:
        `online` - New connection status of the device

    - #### discoverDeviceVariable

          VariableDefinition discoverDeviceVariable(java.lang.String name,
                                                    int timeout,
                                                    java.lang.Object helper)
                                             throws ContextException

      Forces the device driver to discover a new variable and adds it to context if found.
      Returns:
        Definition of new variable if added or null otherwise
      Throws:
        `ContextException`

    - #### discoverDeviceFunction

          FunctionDefinition discoverDeviceFunction(java.lang.String name,
                                                    int timeout,
                                                    java.lang.Object helper)
                                             throws ContextException

      Forces the device driver to discover a new function and adds it to context if found.
      Returns:
        Definition of new function if added or null otherwise
      Throws:
        `ContextException`

    - #### discoverDeviceEvent

          EventDefinition discoverDeviceEvent(java.lang.String name,
                                              int timeout,
                                              java.lang.Object helper)
                                       throws ContextException

      Forces the device driver to discover a new event and adds it to context if found.
      Returns:
        Definition of new event if added or null otherwise
      Throws:
        `ContextException`

    - #### setUsePredefinedQualityCodes

          void setUsePredefinedQualityCodes(boolean value)

      Allows the server to use predefined quality codes for device settings. Otherwise the driver should set quality codes.