Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
ON THIS PAGE
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Object Creation
Anchor | ||||
---|---|---|---|---|
|
To create an storageinfo object, first load the brightsign/storageinfo
module using
...
the require()
method. Then create an instance of the storageinfo class with a string value specifying the storage path.
Code Block | ||
---|---|---|
| ||
var StorageInfoClass = require("@brightsign/storageinfo");
var storageInfo = new StorageInfoClass("/storage/sd"); |
Use the following string values to specify different storage drives:
"/storage/usb1"
– The drive for USB storage devices connected to the player"/storage/sd"
– The primary SD or microSD drive on the player."/storage/sd2"
– The internal microSD drive on the player (4Kx42, XDx32 models only)"/storage/ssd"
– The internal SSD on the player (XTx44, XTx43, XDx34, and XDx33 models only)
StorageInfo
Use this interface to retrieve information about the storage device.
getDeviceSize()
Code Block | ||
---|---|---|
| ||
Promise <Number> getDeviceSize |
Returns the total size of the storage device (in bytes).
Note |
---|
The size returned by this method uses a different tool from the |
getDeviceInfo()
Code Block | ||
---|---|---|
| ||
Promise <StorageDeviceInfo> getDeviceInfo() |
Returns a
...
StorageDeviceInfo
interface containing manufacturer information about the storage device.
getDeviceHealth()
Code Block | ||
---|---|---|
| ||
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:
[Number] size
[DOMString] productName
[DOMString] oemID
[DOMString] auSize
[DOMString] productRev
[DOMString] mfrDate
[DOMString] serial
[DOMString] signalVoltage
[DOMString] uhsMode
[Number] specVersion
[DOMString] speedClass
[Number] mfrID
[DOMString] sataModel
[DOMString] sataVendor
type
string: Returns a string describing the type of filesystem used on the specified storage.size
Number: The total size of the storage device (in bytes)SDDeviceInfo
sd [type == "SD"]: Returns details about the SD card hardware.SATADeviceInfo
sata[type == "SATA"] : Returns details about the Serial ATA (SATA) interface.
SDDeviceInfo
productName
string: The product name, as assigned by the device manufacturer (5 bytes for SD, 6 bytes for MMC)oemID
string: The two-character card OEM identifier as assigned by the SD Card AssociationauSize
number optional: The size of the SD AU in bytesproductRev
string: The product revision assigned by the device manufacturermfrDate
string optional: The manufacture date reported by the storage deviceserial
string optional: The serial number of the storage devicesignalVoltage
string: The signal voltage reported by the SD carduhsMode
string: The UHS mode (i.e. BUS speed) reported by the SD cardspecVersion
Number: The version of SD spec to which the card conformsspeedClass
string optional: The speed class (if any) declared by the SD cardmfrID
Number: The card manufacturer ID as assigned by the SD Card Association
StorageDeviceHealth
percentageHealthUsed
int: Returns an integer that indicates the "wear percentage" of disk health used, on Micron and SanDisk storage cards that support this feature.
SATADeviceInfo
sataModel
String: The SATA model reported by the devicesataVendor
String: The SATA vendor reported by the device
Example
Code Block | ||
---|---|---|
| ||
var storageClass = require("@brightsign/storageinfo");
var storage = new storageClass("/storage/usb1");
storage.getDeviceSize().then(
function(data) {
console.log(JSON.stringify(data));
})
.catch(
function(data) {
console.log(JSON.stringify(data));
});
storage.getDeviceInfo().then(
function(data) {
console.log(JSON.stringify(data));
})
.catch(
function(data) {
console.log(JSON.stringify(data));
}); |