Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
ON THIS PAGE
|
BrightSign players use a standardized library of BrightScript objects to expose functionality for public software development. To publish a new API for interacting with BrightSign hardware, we create a new BrightScript object.
Interfaces and Methods
Every BrightScript object consists of one or more "interfaces." An interface consists of one or more "methods." For example, the roVideoPlayer object has several interfaces, including ifMessagePort. The interface ifMessagePort has one method: SetPort()
.
...
Code Block | ||
---|---|---|
| ||
p = CreateObject("roMessagePort") video = CreateObject("roVideoPlayer") gpio = CreateObject("roControlPort", "BrightSign") gpio.SetPort(p) video.SetPort(p) |
The
...
above
...
syntax
...
makes
...
use
...
of
...
a
...
shortcut
...
provided
...
by
...
the
...
language:
...
The
...
interface
...
name
...
is
...
optional,
...
unless
...
it
...
is
...
needed
...
to
...
resolve
...
name
...
conflicts.
...
For
...
example,
...
the
...
following
...
two
...
lines
...
of
...
code
...
carry
...
out
...
the
...
exact
...
same
...
function:
...
Code Block |
---|
gpio.SetPort(p)
gpio.ifMessagePort.SetPort(p) |
BrightScript Objects consist only of interfaces, and interfaces define only methods. There is no concept of a "property" or variable at the object or interface level. These must be implemented as "set" or "get" methods in an interface.
...