Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The usbfilesystem object allows supported BrightSign players to expose a local file as a USB mass storage device when connected to a USB host port on another device (for example, a PC or television.) The host acts as if it is talking to a USB thumb drive or USB hard drive, but the reads and writes go to the specified local file on the BrightSign. Normally the local file would be prepared beforehand with a filesystem offline or using @brightsign/filesysteminfile on the player itself.

BrightSign players with USB-C (except for LS3 and LS4) can use this object.

usbfilesystem IDL

Code Block
languagejs
interface UsbFilesystem {                                                                                                                                                                                                                                               
    constructor();                                                                                                                                                                                                                                                      
    Promise<void> enable(String filename);                                                                                                                                                                                                                              
    Promise<void> disable();                                                                                                                                                                                                                                            
};  
Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
indent20px



Object Creation

To create a usbfilesystem object, load the @brightsign/usbfilesystem module using the require() method. 

Code Block
languagejs
var FilesystemClass = require('@brightsign/usbfilesystem');
var usbfilesystem = new FilesystemClass();

UsbFilesystem

enable()
Code Block
languagejs
Promise<void> enable(String filename)

Exposes an existing filesystem image as a USB mass storage device.

  • [String] filenamefilename string: The name of the file to expose as a USB mass storage device.

disable()
Code Block
languagejs
Promise<void> disable()

Removes an existing filesystem image as a USB mass storage device.

Example

Code Block
languagejs
var FilesystemClass = require('@brightsign/usbfilesystem');
var usbfilesystem = new FilesystemClass();

// Additional Description: Using filesysteminfile will help build a .img file

// Mount an already built filesystem image
usbfilesystem.enable("/storage/sd/usbstore.img")
.then(function (result) {
  console.log("Successfully mounted!");
})
.catch(function(err) {
  console.log(JSON.stringify(err));
});

// Unmount a filesystem image
usbfilesystem.disable()
.then(function() {
  console.log("Successfully unmounted");
})
.catch(function(err) {
  console.log( JSON.stringify(err) );
});