Profiles

Profiles are text files stored on Aurora's SD card that provide a simple and persistent way to configure Aurora's behavior after startup. A profile is capable of executing any Aurora Command in response to any Aurora Event that is emitted while the profile is running. Profiles are stored in a top-level folder named "profiles" and a special profile, default.prof, gets automatically loaded when Aurora detects a signal for a continuous minute (while not connected to any apps or plugged in over USB). Running profiles are automatically unloaded whenever the Aurora powers down for any reason.

Anatomy of a Profile

It's important to remember that all commands within a profile are executed in response to an event. Event "blocks" are specified using square brackets, which include the event name and an optional comparison operator and flags match value to further filter the event emission. When an event fires Aurora scans the running profile for any matching blocks and will execute those commands listed beneath the block whenever a match is found.

When a profile initially loads (and later unloads) it's often useful to run certain commands that initialize and later reset certain configuration parameters. To faciliate this, the prof-monitor event can be used to execute commands when the profile is loading and unloading.

# Example profile that turns the LEDs white when the profile
# loads and turns them off when unloaded.
################################################################################

[prof-monitor=0]                         # profile loading event
led-set 3 0xFFFFFF 0xFF -1               # turn LEDs white
# more commands to run could go here

[prof-monitor=2]                         # profile unloading event
led-set 3 0x000000 0x00 -1               # turn LEDs off

# empty lines are ignored, as is anything after a "#"

Advanced Event Matching

Whenever an event is emitted, it also carries with it extra information about the particular event occurence in the form of a 32-bit integer payload, or flags. This is what allows, for instance, the prof-monitor event to capture both profile loading and unloading in a single event. In the previous example, the = sign is used in the two event block definitions to respond to when the event flags are strictly equal to the match values 0 and 2 respectively. There are, however, other operators besides = that can be more useful to capture certain types of events. One such example is the button-monitor event which uses a "mask" to distinguish between one or more states the button can be in simultaneously. Because of this, using the @ operator is more convenient since it provides a simple way to check whether one or more bits are set within the event payload.

Available Comparison Operators

Operator Match Condition
None Always matches, regardless of flags.
= flags == value
! flags != value
@ flags & (1 << value)
| flags & value
& (flags & value) == value
~ (~flags & value) == value
< flags < value
> flags > value

Multiple Profiles

In general only one profile, default.prof, is necessary for Aurora to operate. When configuring a profile within Aurora Desktop or Aurora Mobile, this default.prof file is modified directly, which is how the Aurora is able to persist settings between nights of use. If this profile isn't present in the "profiles" folder when Aurora boots up, the folder and/or file are automatically created. This is why reformatting the Aurora's SD card effectively restores default profile behavior. To distinguish between a user-modified default.prof and the original Aurora default, a special file _profiles.list (also within the "profiles" directory) keeps a list of all active profile files and a unique ID assigned to them. This unique ID is used by Aurora apps to lookup extra information associated with the profile and track its use. Aurora's default profile has an ID of F367G2. Only profiles that appear within _profiles.list are available for loading.

_profiles.list (default)

default.prof:F367G2

results matching ""

    No results matching ""