Data Structures

Data structures used for profiles and the Bluetooth LE API

Motion

AttitudeAxis

(enum) The axis to use for turn changes

Name

Value

Roll

0

Roll Inverted

1

Pitch

2

Pitch Inverted

3

Yaw

4

Yaw Inverted

5

AccelerationAxis

(enum) The axis to use for longitudinal acceleration changes (like braking)

Name

Value

X (positive)

0

X (negative)

1

Y (positive)

2

Y (negative)

3

Z (positive)

4

Z (negative)

5

Orientation

(enum) Board orientation to be used for orientation detection

Name

Value

Unknown

0

Top Side Up

1

Bottom Side Up

2

Left Side Up

3

Right Side Up

4

Front Side Up

5

Back Side Up

6

AccelerationState

(enum) Longitudinal acceleration state of the Amp

Name

Value

Neutral

0

Braking

1

Accelerating

2

TurnState

(enum) Lateral acceleration state of the Amp

Name

Value

Center

0

Left

1

Right

2

Hazard

3

OrientationState

(enum) Orientation of the Amp

Name

Value

Unknown

0

Top Side Up

1

Bottom Side Up

2

Left Side Up

3

Right Side Up

3

Front Side Up

4

Back Side Up

5

Lights

Channel

(object) Channel number, led count, and LED type

Key

Description

Type

channel

Which output channel to use (1 - 4)

uint8_t

type

The type of LEDs to use (WS2812B, APA102, etc.)

LEDType

leds

The number of LEDs in each strand

uint16_t

LightRegion

(object) A region of lighting that corresponds to a lighting action.

Key

Description

Type

{region name}

An array of lighting sections that corresponds to the region

LightSection[]

LightSection

(object) Individual lighting sections that correspond to a region. These can be from multiple lighting channels

Key

Description

Type

channel

Output channel (1-4) that these lights are on

uint8_t

start

The starting LED on the channel for the section. Starts at 1 and goes to total number of LEDs on the channel

uint16_t

end

The end LED on the channel for the section. Must be greater than start and less than or equal the total number of LEDs on the channel

uint16_t

LEDType

(enum) The style of addressable LED strip used for this lighting channel. While you can have lights of different types on different channels, Lights cannot be mixed and matched on a single channel.

Name

Value

NeoPixel / WS2812B

0

WS2813

1

SK6812

2

SK6812 RGBW

3

DotStar / APA102

4

Actions

Action

(enum) Commanded state for the lights

Name

String

Value

No Op

N/A

0

Off

brake-off, headlight-off, turn-off

1

Reset

N/A

2

Motion Neutral

motion-neutral

3

Motion Brakes

motion-brakes

4

Motion Acceleration

motion-acceleration

5

Headlight Normal

headlight-normal

6

Headlight Bright

headlight-bright

7

Turn Center

turn-center

8

Turn Left

turn-left

9

Turn Right

turn-right

10

Hazards

turn-hazard

11

Orientation Unknown

orientation-unknown

12

Orientation Top Up

orientation-top

13

Orientation Bottom Up

orientation-bottom

14

Orientation Left Up

orientation-left

15

Orientation Right up

orientation-right

16

Orientation Front Up

orientation-front

17

Orientation Back Up

orientation-back

18

RegionEffect

(object) Associates a light effect with a given region name

This notation (used in an Amp Profile) is different from the CSV of <action>,<region>,<effect> used in the Bluetooth LE API

Key

Description

Type

region

LightRegion name

string

effect

Light Effect CSV

string (csv)

Updates

UpdateStatus

(enum) Status of an OTA update

Name

Value

Start

0

End

1

Write

2

Start Error

3

End Error

4

Write Error

5

Profile

FlowControl

(enum) Flow direction

Name

Value

Receive (Client Send)

1

Transmit (Client End)

2