pub fn device_update(device: &mut Device, options: Options) -> Result<(), Error> {
    if options.spec_version == SpecVersion::V10 {
        return Err(Error::Unsupported);
    }
    let next_boot_id = device.boot_id + 1;
    let mut message_builder = RequestBuilder::new(protocol::METHOD_NOTIFY);
    message_builder
        .add_header(protocol::HEAD_HOST, protocol::MULTICAST_ADDRESS)
        .add_header(protocol::HEAD_LOCATION, &device.location.to_string())
        .add_header(protocol::HEAD_NT, &device.notification_type.to_string())
        .add_header(protocol::HEAD_NTS, protocol::NTS_UPDATE)
        .add_header(protocol::HEAD_USN, &device.service_name.to_string())
        .add_header(protocol::HEAD_BOOTID, &device.boot_id.to_string())
        .add_header(protocol::HEAD_NEXT_BOOTID, &next_boot_id.to_string())
        .add_header(protocol::HEAD_CONFIGID, &device.config_id.to_string());

    if let Some(search_port) = &device.search_port {
        message_builder.add_header(protocol::HEAD_SEARCH_PORT, &search_port.to_string());
    }

    if options.spec_version >= SpecVersion::V20 {
        if let Some(secure_location) = &device.secure_location {
            message_builder
                .add_header(protocol::HEAD_SECURE_LOCATION, &secure_location.to_string());
        }
    }

    multicast_once(
        &message_builder.into(),
        &protocol::MULTICAST_ADDRESS.parse().unwrap(),
        &options.into(),
    )?;
    device.boot_id = next_boot_id;
    Ok(())
}
/**
Provides an implementation of the `ssdp:upate` notification.

# Specification

When a new UPnP-enabled interface is added to a multi-homed device, the device MUST increase its
`BOOTID.UPNP.ORG` field value, multicast an `ssdp:update` message for each of the root devices,
embedded devices and embedded services to all of the existing UPnP-enabled interfaces to announce
a change in the `BOOTID.UPNP.ORG` field value, and re-advertise itself on all (existing and new)
UPnP-enabled interfaces with the new `BOOTID.UPNP.ORG` field value. Similarly, if a multi-homed
device loses connectivity on a UPnP-enabled interface and regains connectivity, or if the IP
address on one of the UPnP-enabled interfaces changes, the device MUST increase the
`BOOTID.UPNP.ORG` field value, multicast an `ssdp:update` message for each of the root devices,
embedded devices and embedded services to all the unaffected UPnP-enabled interfaces to announce a
change in the `BOOTID.UPNP.ORG` field value, and re-advertise itself on all (affected and
unaffected) UPnP-enabled interfaces with the new `BOOTID.UPNP.ORG` field value. In all cases, the
`ssdp:update` message for the root devices MUST be sent as soon as possible. Other `ssdp:update`
messages SHOULD be spread over time. However, all ssdp:update messages MUST be sent before any
announcement messages with the new `BOOTID.UPNP.ORG` field value can be sent.


When `ssdp:update` messages are sent on multiple UPnP-enabled interfaces, the messages MUST contain
identical field values except for the `HOST` and `LOCATION` field values. The `HOST` field value
of an advertisement MUST be the standard multicast address specified for the protocol (IPv4 or IPv6)
used on the interface. The URL specified in the `LOCATION` field value MUST be reachable on the
interface on which the advertisement is sent.

# Parameters

* `device` - details of the device to publish as a part of the notification message. Not all device
     fields may be used in all notifications.
* `options` - protocol options such as the specification version to use and any network
     configuration values.

*/
Provides an implementation of the `ssdp:upate` notification.
Specification





Parameters

`device` - details of the device to publish as a part of the notification message. Not all device
fields may be used in all notifications.
`options` - protocol options such as the specification version to use and any network
configuration values.
Provides an implementation of the ` ssdp : upate ` notification . Specification Parameters ` device ` - details of the device to publish as a part of the notification message . Not all device fields may be used in all notifications . ` options ` - protocol options such as the specification version to use and any network configuration values .
pub fn device_update(device: &mut Device, options: Options) -> Result<(), Error> {
    if options.spec_version == SpecVersion::V10 {
        return Err(Error::Unsupported);
    }
    let next_boot_id = device.boot_id + 1;
    let mut message_builder = RequestBuilder::new(protocol::METHOD_NOTIFY);
    message_builder
        .add_header(protocol::HEAD_HOST, protocol::MULTICAST_ADDRESS)
        .add_header(protocol::HEAD_LOCATION, &device.location.to_string())
        .add_header(protocol::HEAD_NT, &device.notification_type.to_string())
        .add_header(protocol::HEAD_NTS, protocol::NTS_UPDATE)
        .add_header(protocol::HEAD_USN, &device.service_name.to_string())
        .add_header(protocol::HEAD_BOOTID, &device.boot_id.to_string())
        .add_header(protocol::HEAD_NEXT_BOOTID, &next_boot_id.to_string())
        .add_header(protocol::HEAD_CONFIGID, &device.config_id.to_string());
    if let Some(search_port) = &device.search_port {
        message_builder.add_header(protocol::HEAD_SEARCH_PORT, &search_port.to_string());
    }
    if options.spec_version >= SpecVersion::V20 {
        if let Some(secure_location) = &device.secure_location {
            message_builder
                .add_header(protocol::HEAD_SECURE_LOCATION, &secure_location.to_string());
        }
    }
    multicast_once(
        &message_builder.into(),
        &protocol::MULTICAST_ADDRESS.parse().unwrap(),
        &options.into(),
    )?;
    device.boot_id = next_boot_id;
    Ok(())
}
pub fn device_update ( device : & mut Device , options : Options ) -> Result < ( ) , Error > { if options . spec_version == SpecVersion :: V10 { return Err ( Error :: Unsupported ) ; } let next_boot_id = device . boot_id + 1 ; let mut message_builder = RequestBuilder :: new ( protocol :: METHOD_NOTIFY ) ; message_builder . add_header ( protocol :: HEAD_HOST , protocol :: MULTICAST_ADDRESS ) . add_header ( protocol :: HEAD_LOCATION , & device . location . to_string ( ) ) . add_header ( protocol :: HEAD_NT , & device . notification_type . to_string ( ) ) . add_header ( protocol :: HEAD_NTS , protocol :: NTS_UPDATE ) . add_header ( protocol :: HEAD_USN , & device . service_name . to_string ( ) ) . add_header ( protocol :: HEAD_BOOTID , & device . boot_id . to_string ( ) ) . add_header ( protocol :: HEAD_NEXT_BOOTID , & next_boot_id . to_string ( ) ) . add_header ( protocol :: HEAD_CONFIGID , & device . config_id . to_string ( ) ) ; if let Some ( search_port ) = & device . search_port { message_builder . add_header ( protocol :: HEAD_SEARCH_PORT , & search_port . to_string ( ) ) ; } if options . spec_version >= SpecVersion :: V20 { if let Some ( secure_location ) = & device . secure_location { message_builder . add_header ( protocol :: HEAD_SECURE_LOCATION , & secure_location . to_string ( ) ) ; } } multicast_once ( & message_builder . into ( ) , & protocol :: MULTICAST_ADDRESS . parse ( ) . unwrap ( ) , & options . into ( ) , ) ? ; device . boot_id = next_boot_id ; Ok ( ( ) ) }
Provides an implementation of the `ssdp:upate` notification.
Provides an implementation of the ` ssdp : upate ` notification .
device
&mut Device
options
Options
device
&mut Device
options
Options