Warning Unreleased Docs! - You may be viewing documentation that reflects an upcoming release and the functionality described may not be in the current version you are using. Change the version above to the most recent version.

SmartCradle

The SmartCradle API is used to set and retrieve attributes of the MC18 Cradle

Methods

flashLed
(HASH propertyMap)

The LED can be flashed to identify device location without unlocking the cradle.

Parameters

  • propertyMap : HASH

    The properties associated with reading card data.

    • ledOnDuration : INTEGER

      During unlock the LEDs will flash, this is the on duration of that flash specified in milliseconds. Set to 0 to prevent flashing and keep the LED off. In Android, this is in mSecs and the range is from 0 mSec(minimum) to 65535 mSec(maximum).

    • ledOffDuration : INTEGER

      During unlock the LEDs will flash, this is the off duration of that flash specified in milliseconds. Set to 0 to prevent flashing. If the on duration is non-zero and this parameter is zero then the LED will remain on when unlocked. In Android, this is in mSecs and the range is from 0 mSec(minimum) to 65535 mSec(maximum).

    • smoothingEffect : BOOLEAN

      Enables or Disables the smoothing effect of LED blinking.

    • ledFlashCount : INTEGER

      ledFlashCount is the no of count it will be flashed. This will take affect for valid values of ledOnDuration and ledOffDuration.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.SmartCradle.flashLed(HASH propertyMap)
    • Ruby: Rho::SmartCradle.flashLed(HASH propertyMap)
getAllProperties
(CallBackHandler callback)

This method will return all of object/value pairs for the propertyNames of the API class.

Parameters

  • callback : CallBackHandler Optional

Async Callback Returning Parameters: HASH

    • : STRING

Synchronous Return:

  • HASH :

    Map of all available properties

    : this method also supports async callbacks - check the Callback tab for callback return parameters.
    • : STRING

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.SmartCradle.getAllProperties(CallBackHandler callback)
    • Ruby: Rho::SmartCradle.getAllProperties(CallBackHandler callback)
getProperties
(ARRAY arrayofNames, CallBackHandler callback)

This method will return a set of object/value pairs for the list of the propertyName that is passed in. The propertyNames must be a valid property of the API class.

Parameters

  • arrayofNames : ARRAY

    List of properties I want to know about

    • Object : STRING

  • callback : CallBackHandler Optional

Async Callback Returning Parameters: HASH

    • : STRING

Synchronous Return:

  • HASH :

    Map of properties I want to know about

    : this method also supports async callbacks - check the Callback tab for callback return parameters.
    • : STRING

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.SmartCradle.getProperties(ARRAY arrayofNames, CallBackHandler callback)
    • Ruby: Rho::SmartCradle.getProperties(ARRAY arrayofNames, CallBackHandler callback)
getProperty
(STRING propertyName, CallBackHandler callback)

This method will return the value of the propertyName that is passed in. The propertyName must be a valid property of the API class.

Parameters

  • propertyName : STRING

    The property to return info about.

  • callback : CallBackHandler Optional

Async Callback Returning Parameters: STRING

    Synchronous Return:

    • STRING :

      The property to return info about.

      : this method also supports async callbacks - check the Callback tab for callback return parameters.

    Method Access:

    • Class Method: This method can only be accessed via the API class object.
      • JavaScript: Rho.SmartCradle.getProperty(STRING propertyName, CallBackHandler callback)
      • Ruby: Rho::SmartCradle.getProperty(STRING propertyName, CallBackHandler callback)
    setProperties
    (HASH propertyMap)

    This method will set the values of a list of properties for the API class. The propertyName must be a valid property for the class and must also not be read only.

    Parameters

    • propertyMap : HASH

      Map of properties I want to set

      • Object : STRING

    Synchronous Return:

    • Void

    Method Access:

    • Class Method: This method can only be accessed via the API class object.
      • JavaScript: Rho.SmartCradle.setProperties(HASH propertyMap)
      • Ruby: Rho::SmartCradle.setProperties(HASH propertyMap)
    setProperty
    (STRING propertyName, STRING propertyValue)

    This method will set the value of a property for the API class. The propertyName must be a valid property for the class and must also not be read only.

    Parameters

    • propertyName : STRING

      The one property name that I want to set

    • propertyValue : STRING

      The one property value that I want to set

    Synchronous Return:

    • Void

    Method Access:

    • Class Method: This method can only be accessed via the API class object.
      • JavaScript: Rho.SmartCradle.setProperty(STRING propertyName, STRING propertyValue)
      • Ruby: Rho::SmartCradle.setProperty(STRING propertyName, STRING propertyValue)
    unlock
    (INTEGER ledOnDuration, INTEGER ledOffDuration, INTEGER timeout)

    Unlocks the terminal from the cradle for the specified period. For Android, the smoothing effect by default is false.

    Parameters

    • ledOnDuration : INTEGER

      During unlock the LEDs will flash, this is the on duration of that flash specified in milliseconds. Set to 0 to prevent flashing and keep the LED off. In Android, this is in mSecs and the range is from 0 mSec(minimum) to 65535 mSec(maximum).

    • ledOffDuration : INTEGER

      During unlock the LEDs will flash, this is the off duration of that flash specified in milliseconds. Set to 0 to prevent flashing. If the on duration is non-zero and this parameter is zero then the LED will remain on when unlocked. In Android, this is in mSecs and the range is from 0 mSec(minimum) to 65535 mSec(maximum).

    • timeout : INTEGER

      The cradle will remain unlocked for the length of time in seconds specified by this value. Specified in seconds. Range 10 to 30 inclusive.

    Synchronous Return:

    • Void

    Method Access:

    • Class Method: This method can only be accessed via the API class object.
      • JavaScript: Rho.SmartCradle.unlock(INTEGER ledOnDuration, INTEGER ledOffDuration, INTEGER timeout)
      • Ruby: Rho::SmartCradle.unlock(INTEGER ledOnDuration, INTEGER ledOffDuration, INTEGER timeout)
    unlockEx
    (HASH propertyMap)

    Unlocks the terminal from the cradle for the specified period. For Android, the smoothing effect by default is false.

    Parameters

    • propertyMap : HASH

      The properties associated with reading card data.

      • ledOnDuration : INTEGER

        During unlock the LEDs will flash, this is the on duration of that flash specified in milliseconds. Set to 0 to prevent flashing and keep the LED off. In Android, this is in mSecs and the range is from 0 mSec(minimum) to 65535 mSec(maximum).

      • ledOffDuration : INTEGER

        During unlock the LEDs will flash, this is the off duration of that flash specified in milliseconds. Set to 0 to prevent flashing. If the on duration is non-zero and this parameter is zero then the LED will remain on when unlocked. In Android, this is in mSecs and the range is from 0 mSec(minimum) to 65535 mSec(maximum).

      • timeout : INTEGER

        The cradle will remain unlocked for the length of time in seconds specified by this value. Specified in seconds. Range 10 to 30 inclusive.

      • smoothingEffect : BOOLEAN

        Enables or Disables the smoothing effect of LED blinking.

    Synchronous Return:

    • Void

    Method Access:

    • Class Method: This method can only be accessed via the API class object.
      • JavaScript: Rho.SmartCradle.unlockEx(HASH propertyMap)
      • Ruby: Rho::SmartCradle.unlockEx(HASH propertyMap)

    Properties

    cApiVersion
    : STRING Read Only

    CAPI version of the cradle. Not Applicable for Android.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.cApiVersion
    chargeState
    : STRING

    Sets the charge state of the cradle. Values can be either ‘Fast’ or ‘Slow’.

    Possible Values (STRING):

    Constant: Rho.SmartCradle.SMART_CRADLE_FAST (For Ruby use "::" for all "." when referencing constants)
    String: fast

    The cradle will charge devices quickly.

    Constant: Rho.SmartCradle.SMART_CRADLE_SLOW (For Ruby use "::" for all "." when referencing constants)
    String: slow

    The cradle will charge devices slowly.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.chargeState
    columnId
    : INTEGER

    The current Column ID of the cradle in the matrix. In Android, the range of columnId is 0 to 255.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.columnId
    driverVersion
    : STRING Read Only

    Driver version of the cradle. Not Applicable for Android.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.driverVersion
    firmwareVersion
    : STRING Read Only

    Firmware version of the cradle.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.firmwareVersion
    hardwareId
    : INTEGER Read Only

    Hardware ID of the cradle

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.hardwareId
    mfgDate
    : STRING Read Only

    Manufacture date of the cradle in DD-MM-YY format. Not Applicable for Android.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.mfgDate
    partNumber
    : STRING Read Only

    Part number of the cradle.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.partNumber
    rowId
    : INTEGER

    The current Row ID of the cradle in the matrix. In Android, the range of rowId is 0 to 255.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.rowId
    serialNumber
    : STRING Read Only

    Serial number of the cradle.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.serialNumber
    wallId
    : INTEGER

    The current Wall ID of the cradle in the matrix. In Android, the range of wallId is 0 to 255.

    Property Access:

    • Instance: This property can be accessed via an instance object of this class:
      • myObject.wallId

    Remarks

    Flashing the Cradle LEDs

    There is a hardware imposed limit to how quickly the cradle LEDs can be flashed for a quickly flashing LED it is recommended to set the on / off duration to 500ms.