Important
This tutorial is only for experienced users that are familiar with BrightSign devices and are able to modify BrightScript (.brs) files.
How to add custom brightscript code
If you want to integrate your own BrightScript into SignageOS application, you can do so by following this guide:
- Upload your application to a micro SD card as part of standard Brightsign provisioning
- Open the root folder
- Custom.brs file should be present in root directory
- In this file there are two subroutines
- The first subroutine `OnFirstStartHook()` is invoked only when SignageOS application is first started and that fact is stored in device registry.
- The second subroutine `OnEveryStartHook()` is invoked on every restart of application.
Content of these subroutines and their methods can be modified, however it is not advised to delete them as it may result in a functionality and startup failure
- In this file there are two subroutines
Persistency note
Custom BrightScript in your custom.brs file is persistent through SignageOS Core App upgrades and as such is not overwritten or modified when upgrade takes place on your device
Example usage
Here is a code block of both methods, please note that the names of the methods are not modifiable
Sub OnFirstStartHook()
' Here insert your code that is invoked only when SignageOS application is first
started and that fact is stored in device registry
networkingRegistry = CreateObject("roRegistrySection", "networking")
networkingRegistry.write("bsnce", "false")
networkingRegistry.flush()
End Sub
Sub OnEveryStartHook()
nc = CreateObject("roNetworkConfiguration", 1) nc.SetWiFiSecurityMode("ccmp") nc.SetWiFiESSID("") nc.SetWiFiPassphrase("") nc.Apply()
End Sub
This example disables devices from reaching BrightSign's cloud for communication, more information can be found on the official BrightScript documentation website.