M yooper/src/ssdp/message/codec.rs => yooper/src/ssdp/message/codec.rs +9 -3
@@ 44,7 44,10 @@ impl Decoder for Codec {
#[cfg(test)]
mod tests {
- use super::super::{types::Ext, SearchResponse};
+ use super::super::{
+ types::{Ext, SearchTarget, UniqueServiceName},
+ SearchResponse,
+ };
use super::*;
use crate::ssdp::tests::constants::*;
@@ 58,8 61,11 @@ mod tests {
location: "http://192.168.7.1:1900/igd.xml".into(),
secure_location: None,
server: "eeroOS/latest UPnP/1.0 eero/latest".into(),
- target: "uuid:fcdb9233-a63f-41da-b42c-7cfeb99c8adf".into(),
- unique_service_name: "uuid:fcdb9233-a63f-41da-b42c-7cfeb99c8adf".into(),
+ target: SearchTarget::UUID("fcdb9233-a63f-41da-b42c-7cfeb99c8adf".parse().unwrap()),
+ unique_service_name: UniqueServiceName {
+ uuid: "fcdb9233-a63f-41da-b42c-7cfeb99c8adf".into(),
+ search_target: None,
+ },
ext: Ext {},
boot_id: None,
M yooper/src/ssdp/message/tests.rs => yooper/src/ssdp/message/tests.rs +10 -4
@@ 17,14 17,20 @@ fn available_packet() -> Packet {
}
fn available() -> Message {
+ let st = SearchTarget::Device {
+ device_type: "MediaServer".to_string(),
+ version: "1".to_string(),
+ };
+
Message::Available(Available {
max_age: "max-age=3600".into(),
location: "http://192.168.7.238:54216/RootDevice.xml".into(),
- notification_type: "urn:schemas-upnp-org:device:MediaServer:1".into(),
+ notification_type: st.clone(),
server: "Windows 10/10.0 UPnP/1.0 Azureus/5.7.6.0".into(),
- unique_service_name:
- "uuid:07853410-ccef-9e3c-de6a-410b371182eb::urn:schemas-upnp-org:device:MediaServer:1"
- .into(),
+ unique_service_name: UniqueServiceName {
+ uuid: "07853410-ccef-9e3c-de6a-410b371182eb".to_string(),
+ search_target: Some(st),
+ },
host: "239.255.255.250:1900".into(),
secure_location: None,