Protocols

The following protocols are available globally.

  • A connection of a controller to a switcher. Use it to interact with the switcher: send messages and attach message handlers for incoming Messages.

    Message handlers are functions that will be executed when a certain type of Message is received by the Controller.

    Attach a handler to a certain type of Message by calling

    connection.when { message: <MessageType> in
        // Handle your message here
    }
    

    Replace <MessageType> with a concrete type that conforms to the Message protocol (eg: ProgramBusChanged).

    See more

    Declaration

    Swift

    public protocol ControllerConnection : AnyObject
  • A message that can be constructed from a sequence of bytes (ArraySlice<UInt8>)

    See more

    Declaration

    Swift

    public protocol DeserializableMessage : CustomDebugStringConvertible
  • A Message that is serializable. In other words: that can be transformed into a binary format, ready to be sent to another device. Serializable messages use the Message.title and Serializable.dataBytes properties to compute the serialized message.

    See more

    Declaration

    Swift

    public protocol SerializableMessage : DeserializableMessage
  • Interact with connections to a switcher.

    Used to send messages to all connected controllers and to attach message handlers to incoming Messages.

    Handlers are functions that will be executed when a certain type of Message is received by the Switcher.

    See more

    Declaration

    Swift

    public protocol SwitcherConnections
  • Undocumented

    See more

    Declaration

    Swift

    public protocol SingleValueDescribable