com.webos.service.pdm

Note
This API has been available since API level 11.

API Summary

Manages USB devices that are connected to the webOS system.

Main Functions:

  • Mount/unmount of Mass Storage Class (MSC) USB devices
  • Format, Fdisk, File system check (FSCK)
  • Detect USB device

    Supported USB Devices

    • MSC USB device
      • Supported file system: Windows compatible file system (FAT, NTFS)
      • Supported device type: HDD, Memory Stick, SSD, Memory card
    • Still image device (Picture Transfer Protocol (PTP) Camera)
    • Camera
    • HID & XPAD
    • USB to Serial

    Important Terms

    • Device - A device that is directly connected to a USB port or hub.
    • Drive - A device can have multiple drives, where each drive is a partition of a physical storage device.

    Overview of the API

    NA

      Methods

      eject

      ACG: physicaldevice.management
      • Added: API level 11

      Description

      Unmounts all drives of the storage device for safe removal.

      Prerequisite: The storage device must be connected.

      Parameters

      Name

      Required

      Type

      Description

      deviceNum RequiredNumber

      Indicates the unique identifier of the device. It is auto-assigned when the device is connected.

      Note: Use the getAttachedDeviceStatus() method to get a list of devices and their device numbers.

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of the operation.

      Possible values are:

      • true: Indicates that the operation was successful.
      • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      Example

      Example code

      # luna-send -n 1 -f luna://com.webos.service.pdm/eject '{"deviceNum":2}'

      Response:

      {
          "returnValue": true
      }

      format

      ACG: physicaldevice.management
      • Added: API level 11

      Description

      Formats the connected drive.

      Parameters

      Name

      Required

      Type

      Description

      driveName RequiredString

      Indicates the information that can identify the drive.

      Example: sda1

      fsType OptionalString

      Indicates the file system type.

      Possible values are:

      • fat
      • ntfs

      Default: fat

      volumeLabelOptionalString

      Indicates the volume label for the drive.

      Default: volumeLabel not set

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of the operation.

      Possible values are:

      • true: Indicates that the operation was successful.
      • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      Example

      Example: Formatting specific file system type and volume label

      # luna-send -n 1 -f luna://com.webos.service.pdm/format '{
         "driveName":"sda",
         "fsType":"fat",
         "volumeLabel":"test"
      }'

      Response:

      {
          "returnValue": true
      }

      Example: Formatting using the default values of file system type and volume label

      # luna-send -n 1 -f luna://com.webos.service.pdm/format '{"driveName":"sda1"}'

      Response:

      {
          "returnValue": true
      }

      fsck

      ACG: physicaldevice.management
      • Added: API level 11

      Description

      Checks the file system by performing fsck (File System Check) of the corresponding connected drive.

      Note: On connecting a USB device with a large number of files, the PDM service prompts for “Check & Repair” and “Open Now”. The fsck() API will do the file system checking when “Check & Repair” is selected.

      Parameters

      Name

      Required

      Type

      Description

      driveName RequiredString

      Indicates the information that can identify the drive.

      Example: sda1

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of the operation.

      Possible values are:

      • true: Indicates that the operation was successful.
      • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      Example

      Example code

      # luna-send -n 1 -f luna://com.webos.service.pdm/fsck '{"driveName":"sda"}'

      Response:

      {
         "returnValue":true
      }

      getAttachedDeviceStatus

      ACG: physicaldevice.query
      • Added: API level 11

      Description

      Gets the status information of connected device(s).

      Parameters

      Name

      Required

      Type

      Description

      subscribeRequiredBoolean

      Subscribe to get notified when the device status information changes. Possible values are:

      • true - Subscribe for changes.
      • false - Not subscribed.

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      deviceStatusList OptionalObject array: deviceStatusList

      An array containing the status information of the device.

      Subscription Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      deviceStatusList OptionalObject array: deviceStatusList

      An array containing the status information of the device.

      Example

      Example code

      # luna-send -n 1 -f luna://com.webos.service.pdm/getAttachedDeviceStatus '{ "subscribe" : true}'

      Response:

      {
          "deviceStatusList": [
              {
                  "productName": "USB Optical Mouse",
                  "deviceType": "HID",
                  "deviceNum": 3,
                  "deviceStatus": "NOTHING",
                  "vendorName": "PixArt",
                  "usbInfoString": "3-1.2.4",
                  "usbPortNum": 3
              },
              {
                  "productName": "USB Audio",
                  "deviceType": "HID",
                  "deviceNum": 4,
                  "deviceStatus": "NOTHING",
                  "vendorName": "Generic",
                  "usbInfoString": "3-1.3",
                  "usbPortNum": 48
              },
              {
                  "driveStatusList": [
                      {
                          "driveName": "apps",
                          "driveStatus": "MOUNT_OK "
                      }
                  ],
                  "deviceType": "INTERNAL",
                  "deviceNum": 0,
                  "deviceStatus": "NOTHING"
              },
              {
                  "productName": "USB Audio",
                  "deviceType": "SOUND",
                  "deviceNum": 4,
                  "deviceStatus": "NOTHING",
                  "vendorName": "Realtek Semiconductor Corp.",
                  "usbInfoString": "3-1.3",
                  "usbPortNum": 48
              },
              {
                  "deviceStatus": "NOTHING",
                  "productName": "Mass Storage Device",
                  "driveStatusList": [
                      {
                          "driveName": "sda1",
                          "driveStatus": "MOUNT_OK "
                      }
                  ],
                  "deviceType": "USB_STORAGE",
                  "deviceNum": 2,
                  "usbPortNum": 1,
                  "usbInfoString": "5-1",
                  "vendorName": "Transcend Information, Inc."
              }
          ],
          "returnValue": true
      }

      getAttachedNonStorageDeviceList

      ACG: physicaldevice.query
      • Added: API level 11

      Description

      Gets the status information of connected non-storage device(s).

      Parameters

      Name

      Required

      Type

      Description

      subscribeRequiredBoolean

      Subscribe to get notified when a device is connected and the list of non-storage device changes. Possible values are:

      • true - Subscribe for changes.
      • false - Not subscribed.
      categoryOptionalString

      Category of non-storage device. Possible values are:

      • Audio
      • Video
      • Net
      groupSubDevicesOptionalBoolean

      Indicates grouping of sub devices. Possible values are:

      • true - Groups sub-devices into subDeviceList which is part of videoDeviceList or audioDeviceList.
      • false (default) - Gives audioDeviceList without subDeviceList and videoDeviceList (backward compatible).

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      powerStatusOptionalString

      Power-on status of the device.

      Note: This value always defaults to "normal".

      nonStorageDeviceListOptionalObject array: nonStorageDeviceList

      An array containing the information about the non-storage device that is currently connected.

      Note: Returned only when "category" is NOT provided.

      videoDeviceListOptionalObject array: videoDeviceList

      An array of video device lists connected.

      Note: Returned only when "category" is "Video".

      audioDeviceListOptionalObject array: audioDeviceList

      An array of audio device list connected.

      Note: Returned only when "category" is "Audio".

      netDeviceListOptionalObject array: netDeviceList

      An array of net device list connected.

      Note: Returned only when "category" is "Net".

      Subscription Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      powerStatusOptionalString

      Power-on status of the device.

      Note: This value always defaults to "normal".

      nonStorageDeviceListOptionalObject array: nonStorageDeviceList

      An array containing the information about the non-storage device that is currently connected.

      Note: Returned only when "category" is NOT provided.

      videoDeviceListOptionalObject array: videoDeviceList

      An array of video devices connected.

      Note: Returned only when "category" is "Video".

      audioDeviceListOptionalObject array: audioDeviceList

      An array of audio devices connected.

      Note: Returned only when "category" is "Audio".

      netDeviceListOptionalObject array: netDeviceList

      An array of net devices connected.

      Note: Returned only when "category" is "Net".

      Example

      Example: To view all non-storage devices attached

      # luna-send -n 1 -f luna://com.webos.service.pdm/getAttachedNonStorageDeviceList '{ "subscribe" : true }'

      Response:

      {
          "powerStatus": "normal",
          "nonStorageDeviceList": [
              {
                  "usbPortNum": 255,
                  "serialNumber": "",
                  "isPowerOnConnect": false,
                  "deviceNum": 52,
                  "deviceSubtype": "usbhid",
                  "vendorName": "DELL",
                  "deviceType": "HID",
                  "productName": "Dell USB Entry Keyboard",
                  "devSpeed": "LOW"
              },
              {
                  "usbPortNum": 2,
                  "serialNumber": "",
                  "isPowerOnConnect": false,
                  "deviceNum": 62,
                  "deviceSubtype": "usbhid",
                  "vendorName": "17ef",
                  "deviceType": "HID",
                  "productName": "Lenovo Optical USB Mouse",
                  "devSpeed": "LOW"
              }
          ],
          "returnValue": true
      }

      Example: To view all non-storage (audio) devices attached

      # luna-send -n 1 -f luna://com.webos.service.pdm/getAttachedNonStorageDeviceList '{ "subscribe" : true, "category" : "Audio" }'

      Response:

      {
          "powerStatus": "normal",
          "audioDeviceList": [
              {
                  "cardNumber": 2,
                  "cardName": "USB PnP Sound Device",
                  "cardId": "Device",
                  "builtin": false,
                  "usbPortNum": 3,
                  "devSpeed": "HIGH"
              }
          ],
          "returnValue": true
      }

      Example: To view all non-storage (net) devices attached

      # luna-send -n 1 -f luna://com.webos.service.pdm/getAttachedNonStorageDeviceList '{ "subscribe" : true, "category" : "Net" }'

      Response:

      {
          "netDeviceList": [
              {
                  "duplex": "",
                  "ifindex": "4",
                  "linkmode": "0",
                  "address": "50:3e:aa:6d:65:e5",
                  "vendorName": "TP-LINK",
                  "productName": "USB 10 100 1000 LAN",
                  "devSpeed": "HIGH",
                  "operstate": "down"
              }
          ],
          "powerStatus": "normal",
          "returnValue": true
      }

      Example : To view information about connected video device(s)

      # luna-send -n 1 -f luna://com.webos.service.pdm/getAttachedNonStorageDeviceList '{
          "subscribe" : true,
          "category" : "Video",
          "groupSubDevices" : true 
      }'

      Response:

      {
          "returnValue": true,
          "videoDeviceList": [
              {
                  "subDeviceList": [
                      {
                          "productName": "C270 HD WEBCAM",
                          "capabilities": ":capture:",
                          "version": "2",
                          "devPath": "/dev/video0"
                      },
                      {
                          "productName": "C270 HD WEBCAM",
                          "capabilities": ":",
                          "version": "2",
                          "devPath": "/dev/video1"
                      }
                  ],
                  "productName": "C270 HD WEBCAM",
                  "devSpeed": "HIGH",
                  "deviceType": "CAM",
                  "vendorName": "Logitech, Inc."
              }
          ],
          "powerStatus": "normal"
      }

      Example : To view information about connected audio device(s)

      # luna-send -i -f luna://com.webos.service.pdm/getAttachedNonStorageDeviceList '{
          "subscribe" : true,
          "category" : "Audio",
          "groupSubDevices" : true
      }'

      Response:

      {
          "audioDeviceList": [
              {
                  "subDeviceList": [
                      {
                          "deviceType": "playback",
                          "devPath": "/dev/snd/pcmC0D0p"
                      },
                      {
                          "deviceType": "control",
                          "devPath": "/dev/snd/controlC0"
                      }
                  ],
                  "devSpeed": "",
                  "cardNumber": 0,
                  "cardId": "b1",
                  "built-in": true,
                  "cardName": "bcm2835 HDMI 1",
                  "usbPortNum": 0
              },
              {
                  "subDeviceList": [
                      {
                          "deviceType": "playback",
                          "devPath": "/dev/snd/pcmC1D0p"
                      },
                      {
                          "deviceType": "control",
                          "devPath": "/dev/snd/controlC1"
                      }
                  ],
                  "devSpeed": "",
                  "cardNumber": 1,
                  "cardId": "Headphones",
                  "built-in": true,
                  "cardName": "bcm2835 Headphones",
                  "usbPortNum": 0
              },
              {
                  "subDeviceList": [
                      {
                          "deviceType": "control",
                          "devPath": "/dev/snd/controlC2"
                      },
                      {
                          "deviceType": "capture",
                          "devPath": "/dev/snd/pcmC2D0c"
                      },
                      {
                          "deviceType": "playback",
                          "devPath": "/dev/snd/pcmC2D0p"
                      }
                  ],
                  "devSpeed": "FULL",
                  "cardNumber": 2,
                  "cardId": "Device",
                  "built-in": false,
                  "cardName": "USB PnP Sound Device",
                  "usbPortNum": 0
              }
          ],
          "returnValue": true,
          "powerStatus": "normal"
      }

      getAttachedStorageDeviceList

      ACG: physicaldevice.query
      • Added: API level 11

      Description

      Gets status information of connected storage device(s).

      Parameters

      Name

      Required

      Type

      Description

      subscribeRequiredBoolean

      Indicates if subscribed to get the notifications.

      Possible values are:

      • true: Subscribe for notifications.
      • false: Not subscribed.

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of the operation.

      Possible values are:

      • true: Indicates that the operation was successful.
      • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      powerStatusOptionalString

      Indicates the power-on status of the device.

      Note: This value always defaults to "normal".

      storageDeviceListOptionalObject array: storageDeviceList

      Indicates an array containing information about the currently connected storage device(s).

      Subscription Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      powerStatusOptionalString

      Power-on status of the device.

      Note: This value always defaults to "normal".

      storageDeviceListOptionalObject array: storageDeviceList

      An array containing information about the currently connected storage device(s).

      Example

      Example code

      # luna-send -n 1 -f luna://com.webos.service.pdm/getAttachedStorageDeviceList '{ "subscribe" : true }'

      Response: 

      {
         "powerStatus":"normal",
         "returnValue":true,
         "storageDeviceList":[
            {
               "usbPortNum":2,
               "rootPath":"/tmp/usb/sdb",
               "storageDriveList":[
                  {
                     "isMounted":true,
                     "volumeLabel":"MX-ES",
                     "uuid":"1209-3C50",
                     "driveName":"sdb1",
                     "driveSize":31190064,
                     "fsType":"fat",
                     "mountName":"/tmp/usb/sdb/sdb1"
                  }
               ],
               "serialNumber":"000000000000000236",
               "isPowerOnConnect":false,
               "deviceNum":2,
               "vendorName":"MX",
               "storageType":"FLASH",
               "deviceType":"USB_STORAGE",
               "productName":"Mass Storage Device",
               "devSpeed":"HIGH",
               "errorReason":"NOTHING"
            }
         ]
      }

      getExample

      ACG: physicaldevice.query
      • Added: API level 27

      Description

      Provides debug logs with detailed information of all connected storage and non-storage device list.

      Parameters

      None

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of the operation. Possible values are:

      • true: Operation is successful.
      • false: Operation has failed. Check the 'errorCode' and 'errorText' fields.

      Example

      Example scenario

      # luna-send -n 1 -f luna://com.webos.service.pdm/getExample '{ }'

      Response:

      {
          "returnValue": true
      }

      getSpaceInfo

      ACG: physicaldevice.query
      • Added: API level 11

      Description

      Gets the space information of the connected drive.

      Note: The drive must be mounted.

      Parameters

      Name

      Required

      Type

      Description

      driveName RequiredString

      Information that can identify the drive (e.g. sda1)

      directCheckOptionalBoolean

      Indicates if PDM needs to newly measure the drive space information at the time of API call. Possible values are:

      • true - Newly measures the information
      • false - Returns periodically measured information

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      spaceInfoOptionalObject: spaceInfo

      Information about the drive space.

      Example

      Example code

      # luna-send -n 1 -f luna://com.webos.service.pdm/getSpaceInfo '{ "driveName" : "sda" , "directCheck" : true }'

      Response:

      {
         "spaceInfo":{
            "usedRate":0,
            "freeSize":31116080.000000,
            "totalSize":31190064.000000,
            "usedSize":73984.000000
         },
         "returnValue":true
      }

      isWritableDrive

      ACG: physicaldevice.query
      • Added: API level 11

      Description

      Checks the file system attribute of the drive and returns whether it is writable. 

      Parameters

      Name

      Required

      Type

      Description

      driveNameRequiredString

      Information that can identify the drive (e.g. sda1)

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      isWritableOptionalBoolean

      Indicates if data can be written on the drive. Possible values are: 

      • true - Writable drive
      • false - Cannot be written

      Example

      Example code

      # luna-send -n 1 -f luna://com.webos.service.pdm/isWritableDrive '{ "driveName" : "sda" }'

      Response:

      {
         "returnValue":true,
         "isWritable":true
      }

      mountandFullFsck

      ACG: physicaldevice.management
      • Added: API level 23

      Description

      Mounts the device without performing Fsck.

      Alternatively, it can be configured to perform Fsck and then mount  the device.

      Parameters

      Name

      Required

      Type

      Description

      mountNameRequiredString

      USB device name (If the device detected by /dev/sda, the device name is sda).

      needFsckOptionalBoolean

      Indicates whether Fsck is needed. Possible values are:

      • true - Perform Fsck and then mount the device
      • false (default) - Mount the device directly without performing Fsck.

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details

      Example

      Example scenario

      # luna-send -n 1 -f luna://com.webos.service.pdm/mountandFullFsck'{ "mountName" : "sda"}'

      Response:

      {
         "returnValue":true
      }

      Example : With needFsck parameter

      # luna-send -n 1 -f luna://com.webos.service.pdm/mountandFullFsck '{"mountName" : "sda", "needFsck" : false }'

      Response:

      {
          "returnValue": true
      }

      setVolumeLabel

      ACG: physicaldevice.management
      • Added: API level 11

      Description

      Sets the volume label of the drive. It is supported only when file system type is FAT.

      Parameters

      Name

      Required

      Type

      Description

      driveName RequiredString

      Information that can identify the drive (e.g. sda1)

      volumeLabelRequiredString

      Volume label for the drive.

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      Example

      Example code

      # luna-send -n 1 -f luna://com.webos.service.pdm/setVolumeLabel '{ "driveName" : "sda", "volumeLabel" : "webos" }'

       

      Response:

      {  
         "returnValue":true
      }

      umountAllDrive

      ACG: physicaldevice.management
      • Added: API level 11

      Description

      Unmounts all drives. 

      Parameters

      None

      Call Returns

      Name

      Required

      Type

      Description

      returnValueRequiredBoolean

      Indicates the status of operation. Possible values are:

      • true - Indicates that the operation was successful.
      • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
      errorCodeOptionalNumber

      The error code for the failed operation.

      errorTextOptionalString

      Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

      Example

      Example code

      # luna-send -n 1 -f luna://com.webos.service.pdm/umountAllDrive '{}'

       

      Response:

      {  
         "returnValue":true
      }

      Objects

      audioDeviceList

      List of audio device(s) connected.

      Name

      Required

      Type

      Description

      cardNumberRequiredNumber

      Card number of the audio device

      cardNameRequiredString

      Name of the audio device card

      cardIdRequiredString

      Type of the audio device. e.g. Headphone, Wireless.

      usbPortNumRequiredNumber

      Port number where the sound device is connected, it gives -1 for internal devices.

      devSpeedRequiredString

      Speed of the sound device. Possible values are:

      • LOW
      • FULL
      • HIGH
      • SUPER

      Note : It will be LOW for built-in devices

      builtinRequiredBoolean

      Indicates the status of device. Possible values are:

      • true - Indicates internal device
      • false - Indicates device is connected externally
      subDeviceListOptionalObject array: subDeviceList

      Contains info of sub-devices

      Note: Sub-devices are multiple sound devices inside single device. e.g. one sound card may have control, playback and capture sub devices.

      deviceListInfo

      An array containing information about the currently connected device(s).

      Name

      Required

      Type

      Description

      storageDeviceListOptionalObject array: storageDeviceList

      List of information about the storage devices that are currently connected.

      nonStorageDeviceListOptionalObject array: nonStorageDeviceList

      List of information about the non-storage devices that are currently connected.

      deviceStatusList

      List of the storage and non-storage devices connected and their statuses.

      Name

      Required

      Type

      Description

      deviceNumRequiredNumber

      Device number

      deviceStatusRequiredString

      Status of the device

      driveStatusListOptionalObject array: driveStatusList

      List of statuses of the drives in the device

      productNameOptionalString

      Name of the device product.

      usbPortNumOptionalNumber

      Port number where the sound device is connected, it gives -1 for internal devices.

      vendorNameOptionalString

      Name of the device vendor.

      driveStatusList

      List of the drives in the connected storage devices and their statuses.

      Name

      Required

      Type

      Description

      driveNameRequiredString

      Name of the drive

      driveStatusRequiredString

      Mount status of the drive

      netDeviceList

      List of Communication Device Class (CDC) device(s) connected.

      Name

      Required

      Type

      Description

      operstateRequiredString

      State of the device operation

      ifindexRequiredString

      Network interface index

      linkmodeRequiredString

      Tells whether specified interface is managed and configured by systemd network manager. Possible values are:

      • 0 - LINK_AUTO
      • 1 - LINK_MANUAL
      • 2 - LINK_MODE_UNKNOWN
      duplexRequiredString

      Bandwidth of the device. Possible values are:

      • uni-directional
      • bi-directional
      addressRequiredString

      Ethernet address of the device connected

      vendorNameRequiredString

      Name of the vendor

      productNameRequiredString

      Name of the product

      devSpeedRequiredString

      Speed of the device. Possible values are:

      • LOW
      • HIGH
      • SUPER

      nonStorageDeviceList

      List of information about the non-storage devices that are currently connected.

      Name

      Required

      Type

      Description

      usbPortNumRequiredNumber

      Port number where the sound device is connected, it gives -1 for internal devices.

      serialNumberRequiredString

      Serial number of the device product

      isPowerOnConnectRequiredBoolean

      Indicates whether the device was connected during power on. Possible values are:

      • true - Connected during power on
      • false - Connected after powering on
      deviceNumRequiredNumber

      Number assigned to the connected device

      deviceSubtypeRequiredString

      Sub-type of the device connected.

      For example: If deviceType is "usb", then deviceSubtype can be "usbhid" etc.

      vendorNameRequiredString

      Name of the device vendor

      deviceTypeRequiredString

      Type of the device. e.g : USB, HID, CAM etc

      productNameRequiredString

      Name of the device product

      devSpeedRequiredString

      Speed of the device. Possible values are:

      • LOW
      • FULL
      • HIGH
      • SUPER

      Note : It will be LOW for built-in devices..

      spaceInfo

      Information about the drive space. 

      Name

      Required

      Type

      Description

      totalSizeRequiredNumber (double)

      Total Drive Size (KB)

      usedSizeRequiredNumber (double)

      Drive size currently in use (KB)

      freeSizeRequiredNumber (double)

      Currently Available Drive Size (KB)

      usedRateRequiredNumber (int32_t)

      Current Drive Utilization (%)

      storageDeviceList

      List of information about the storage devices that are currently connected.

      Name

      Required

      Type

      Description

      usbPortNumRequiredNumber

      Port number to which the device is connected.

      rootPathRequiredString

      Root directory path of the device.

      storageDriveListRequiredObject array: storageDriveList

      List of storage drives in the connected storage device.

      serialNumberRequiredString

      Serial number of the device.

      isPowerOnConnectRequiredBoolean

      Indicates whether the device was connected during power on. Possible values are:

      • true - Connected during power on.
      • false - Connected after powering on.
      deviceNumRequiredNumber

      Number assigned to the device.

      vendorNameRequiredString

      Name of the vendor.

      storageTypeRequiredString

      Type of the storage device.

      deviceTypeRequiredString

      Type of the USB device.

      productNameRequiredString

      Name of the product.

      devSpeedRequiredString

      Speed of the device.

      errorReasonRequiredString

      Describes the status of device mounting. Possible values are:

      • NOTHING - Mount successful
      • NOMOUNTED - Mount unsuccessful
      • UNSUPPORT_FILESYSTEM - File system of the device is unsupported
      • EJECTED - Device ejected
      • NEED_FSCK -Device needs file system checking

      storageDriveList

      List of the drives in storage devices connected.

      Name

      Required

      Type

      Description

      isMountedRequiredBoolean

      Indicates whether the device is mounted or not. Possible values are:

      • true - Device is mounted
      • false - Device is not mounted
      volumeLabelRequiredString

      Label set for the drive in the device

      uuidRequiredString

      Unique SCSI device ID

      driveNameRequiredString

      Name of the drive where mounted

      driveSizeRequiredNumber

      Size of the drive

      fsTypeRequiredString

      Type of the file system in the drive

      mountNameRequiredString

      Absolute path of the drive in the device where mounted

      subDeviceList

      Contains info of sub-devices

      Note: Sub-devices are multiple camera or sound devices inside single camera or sound device.

      Name

      Required

      Type

      Description

      productNameOptionalString

      Name of the product.

      Note: Applicable only for Video category.

      capabilitiesOptionalString

      Device capability attribute.

      Note:

      • A separator (:) is used between multiple capability values.
      • Applicable only for Video category.
      versionOptionalString

      Version of the product.

      Note: Applicable only for Video category.

      devPathRequiredString

      Path of the device.

      Note: Applicable for Video and Audio category.

      deviceTypeOptionalString

      Audio sub device type based on sub-device functionality. For example, playback, capture, control, misc.

      Note: Applicable only for Audio category.

      videoDeviceList

      List of video device(s) connected.

      Name

      Required

      Type

      Description

      productNameRequiredString

      Name of the product

      devSpeedRequiredString

      Speed of the sound device. Possible values are:

      • LOW
      • FULL
      • HIGH
      • SUPER

      Note : It will be LOW for built-in devices.

      deviceTypeRequiredString

      Type of the USB device. Possible values : CAM

      vendorNameRequiredString

      Name of the vendor

      subDeviceListOptionalObject array: subDeviceList

      Contains info of sub-devices

      Note: Sub-devices are multiple camera devices inside single camera.

      SUBSYSTEMOptionalString

      Indicates SUBSYSTEM of device.

      KERNELOptionalString

      Indicates KERNEL of the device.

      API Error Codes Reference

      Error Code

      Error Text

      Error Description

      1Parameter error

      Parameter error

      2Interface function error

      Interface function error

      3Subscribe Error

      Subscribe Error

      4SubscriptionAdd Fail

      SubscriptionAdd Fail

      5LSSubscriptionAcquire Fail

      LSSubscriptionAcquire Fail

      6Json message parse error

      Json parse error

      Contents