usbfilesystem
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
interface UsbFilesystem {
constructor();
Promise<void> enable(String filename);
Promise<void> disable();
};
Object Creation
To create a usbfilesystem object, load the @brightsign/usbfilesystem module using the require() method.
var FilesystemClass = require('@brightsign/usbfilesystem');
var usbfilesystem = new FilesystemClass();
UsbFilesystem
enable()
Promise<void> enable(String filename)
Exposes an existing filesystem image as a USB mass storage device.
filename
string: The name of the file to expose as a USB mass storage device.
disable()
Promise<void> disable()
Removes an existing filesystem image as a USB mass storage device.
Example
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) );
});