Have more questions? Submit a request

Integration of custom BrightScript


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:

  1. Upload your application to a micro SD card as part of standard Brightsign provisioning
  2. Open the root folder
  3. Custom.brs file should be present in root directory
    1. In this file there are two subroutines
      1. The first subroutine `OnFirstStartHook()` is invoked only when SignageOS application is first started and that fact is stored in device registry.
      2. 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

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")
  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

Was this article helpful?
0 out of 0 found this helpful