yell

Core SSDP service and message types; functions to encode and decode datagrams

Types

An SSDP message received from the network. Can be a discovery request, a discovery reply, or a notification.

pub type Message {
  Discovery(
    addr: option.Option(glip.IpAddress),
    service_type: uri.Uri,
    max_wait: option.Option(Int),
    other_headers: dict.Dict(String, String),
  )
  Reply(
    addr: option.Option(glip.IpAddress),
    service_type: uri.Uri,
    usn: uri.Uri,
    max_age: option.Option(duration.Duration),
    location: option.Option(String),
    other_headers: dict.Dict(String, String),
  )
  Announcement(
    addr: option.Option(glip.IpAddress),
    service_type: uri.Uri,
    usn: uri.Uri,
    max_age: option.Option(duration.Duration),
    location: option.Option(String),
    other_headers: dict.Dict(String, String),
  )
  ByeBye(
    addr: option.Option(glip.IpAddress),
    service_type: uri.Uri,
    usn: uri.Uri,
  )
}

Constructors

Values

pub fn decode_message(content: BitArray) -> Result(Message, Nil)

Parse a received SSDP datagram as a Message

pub fn decode_message_from(
  content: BitArray,
  host: Result(glip.IpAddress, Nil),
) -> Result(Message, Nil)

Parse a received SSDP datagram from a host as a Message

pub fn from_address(
  msg: Message,
  addr: glip.IpAddress,
) -> Message

Set the source IP of a message

pub fn to_string(msg: Message) -> String

Generate a string with the main content of a message

Search Document