Kitt.Message.SPAT (kitt v0.4.0) View Source

Defines the structure and instantiation function for creating a J2735-compliant SignalPhaseandTiming message

A SPAT defines the messages generated by the roadside infrastructure regarding current and pending signal status and expected timing of signal status changes.

Link to this section Summary

Types

t()

Defines the structure of a SignalPhaseandTiming message and the data elements comprising its fields

Functions

Produces a SPAT message struct from an equivalent map or keyword input

Returns the SPAT identifying atom recognized by the ASN1 spec

Returns the SPAT identifying integer

Link to this section Types

Specs

advisory_speed() :: %{
  type: :none | :greenwave | :ecoDrive | :transit,
  speed: non_neg_integer(),
  confidence:
    :unavailable
    | :prec100ms
    | :prec10ms
    | :prec5ms
    | :prec1ms
    | :"prec0-1ms"
    | :"prec0-05ms"
    | :"prec0-01ms",
  distance: non_neg_integer(),
  class: non_neg_integer(),
  regional: [Kitt.Types.regional_extension()]
}
Link to this type

connection_maneuver_assist()

View Source

Specs

connection_maneuver_assist() :: %{
  connectionID: non_neg_integer(),
  queueLength: non_neg_integer(),
  availableStorageLength: non_neg_integer(),
  waitOnStop: boolean(),
  pedBicycleDetect: boolean(),
  regional: [Kitt.Types.regional_extension()]
}

Specs

intersection_state() :: %{
  name: String.t(),
  id: Kitt.Types.intersection_reference_id(),
  revision: non_neg_integer(),
  status: status(),
  moy: Kitt.Types.minute_of_year(),
  timeStamp: non_neg_integer(),
  enabledLanes: [non_neg_integer()],
  states: [movement_state()],
  maneuverAssistList: [connection_maneuver_assist()],
  regional: [Kitt.Types.regional_extension()]
}

Specs

movement_event() :: %{
  eventState:
    :unavailable
    | :dark
    | :"stop-Then-Proceed"
    | :"stop-And-Remain"
    | :"pre-Movement"
    | :"permissive-Movement-Allowed"
    | :"protected-Movement-Allowed"
    | :"permissive-clearance"
    | :"protected-clearance"
    | :"caution-Conflicting-Traffic",
  timing: time_change_details(),
  speeds: [advisory_speed()],
  regional: [Kitt.Types.regional_extension()]
}

Specs

movement_state() :: %{
  movementName: String.t(),
  signalGroup: non_neg_integer(),
  "state-time-speed": [movement_event()],
  maneuverAssistList: [connection_maneuver_assist()],
  regional: [Kitt.Types.regional_extension()]
}

Specs

status() ::
  :manualControlIsEnabled
  | :stopTimeIsActivated
  | :failureFlash
  | :preemptIsActive
  | :signalPriorityIsActive
  | :fixedTimeOperation
  | :trafficDependentOperation
  | :standbyOperation
  | :failureMode
  | :off
  | :recentMAPmessageUpdate
  | :recentChangeInMAPassignedLanesIDsUsed
  | :noValidMAPisAvailableAtThisTime
  | :noValidSPATisAvailableAtThisTime

Specs

t() :: %Kitt.Message.SPAT{
  intersections: [intersection_state()],
  name: String.t(),
  regional: [Kitt.Types.regional_extension()],
  timeStamp: Kitt.Types.minute_of_year()
}

Defines the structure of a SignalPhaseandTiming message and the data elements comprising its fields

Specs

time_change_details() :: %{
  startTime: non_neg_integer(),
  minEndTime: non_neg_integer(),
  maxEndTime: non_neg_integer(),
  likelyTime: non_neg_integer(),
  confidence: non_neg_integer(),
  nextTime: non_neg_integer()
}

Link to this section Functions

Specs

new(map() | keyword()) :: t()

Produces a SPAT message struct from an equivalent map or keyword input

Specs

type() :: atom()

Returns the SPAT identifying atom recognized by the ASN1 spec

Specs

type_id() :: non_neg_integer()

Returns the SPAT identifying integer