Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated as per DOCS-798

...

Code Block
languagejs
titlestorageinfo IDL
collapsetrue
[
    GarbageCollected,
    constructor(DOMStringString path, String type)
] interface StorageInfo {
    Promise <number>Promise<Number> getDeviceSize();
    Promise<StorageDeviceInfo> getDeviceInfo();
   Promise <StorageDeviceInfo>Promise<StorageDeviceHealth> getDeviceInfogetDeviceHealth();
};
 
interface StorageDeviceInfo {
    attribute String type;
    attribute number size;
Number size;
    [type == "SD"] attribute SDDeviceInfo sd;
    [type == "SATA"] attribute SATADeviceInfo sata;
};
 
interface SDDeviceInfo {
    attribute DOMStringString productName; //@Optional
    attribute DOMStringString oemID; //@Optional
    attribute numberString auSize;             //@Optional
    attribute DOMStringString productRev; //@Optional
    attribute DOMStringString mfrDate; //@Optional
	attribute number mfrID;            //@Optional
    attribute DOMStringString serial;             //@Optional
    attribute DOMStringString signalVoltage;
    attribute String uhsMode; //@Optional
    attribute Number specVersion;
    attribute DOMStringString uhsMode;speedClass;         //@Optional
    attribute Number numbermfrID;
specVersion; //@Optional};
 
interface StorageDeviceHealth {
    attribute int DOMStringpercentageHealthUsed;
speedClass}; //@Optional

 
interface SATADeviceInfo {
    attribute DOMStringString sataModel;
//@Optional
    attribute DOMStringString sataVendor; //@Optional
};

Object Creation 
Anchor
object_creation
object_creation

...

Returns a StorageDeviceInfo  interface containing manufacturer information about the storage device.

getDeviceHealth()
Code Block
languagejs
Promise<StorageDeviceHealth> getDeviceHealth()

Returns a "card wear" indication in the form of a percentage. This value is approximate and is provided to assist in scheduling proactive replacements to avoid in-field failures. Once this value reaches 100, the card is life expired and further attempts to write to the card may fail. This feature is only supported on certain industrial-type cards such as the Micron and Sandisk cards supplied by BrightSign.

StorageDeviceInfo

This interface contains manufacturer information about the storage device. Any of the below parameters may be absent from the interface depending on the device type and the information returned by the device:

  • [String] type: Returns a string describing the type of filesystem used on the specified storage.
  • [Number] size: The total size of the storage device (in bytes)
  • [type == "SD"] SDDeviceInfo sd: Returns details about the SD card hardware.
  • [type == "SATA"] SATADeviceInfo sata: Returns details about the Serial ATA (SATA) interface.

SDDeviceInfo

  • [DOMStringString] productName: The product name, as assigned by the device manufacturer (5 bytes for SD, 6 bytes for MMC)
  • [DOMStringString] oemID: The two-character card OEM identifier as assigned by the SD Card Association
  • [number] [optional] auSize: The size of the SD AU in bytes
  • [DOMStringString] productRev: The product revision assigned by the device manufacturer
  • [String] [DOMStringoptional] mfrDate: The manufacture date reported by the storage device
  • [Number] mfrID: The card manufacturer ID as assigned by the SD Card Association[DOMStringString] [optional] serial: The serial number of the storage device
  • [DOMStringString] signalVoltage: The signal voltage reported by the SD card
  • [DOMStringString] uhsMode: The UHS mode (i.e. BUS speed) reported by the SD card
  • [Number] specVersion: The version of SD spec to which the card conforms
  • [String] [DOMStringoptional] speedClass: The speed class (if any) declared by the SD card
  • [Number] mfrID: The card [DOMStringmanufacturer ID as assigned by the SD Card Association

StorageDeviceHealth

  • [int] percentageHealthUsed: Returns an integer that indicates the "wear percentage" of disk health used, on Micron and SanDisk storage cards that support this feature.

SATADeviceInfo

  • [String] sataModel: The SATA model reported by the device
  • [DOMStringString] sataVendor: The SATA vendor reported by the device

...