bacnet_client/client/
builder_bip6.rs1use super::*;
4
5#[cfg(feature = "ipv6")]
6impl BACnetClient<Bip6Transport> {
7 #[cfg_attr(docsrs, doc(cfg(feature = "ipv6")))]
9 pub fn bip6_builder() -> Bip6ClientBuilder {
10 Bip6ClientBuilder {
11 config: ClientConfig::default(),
12 options: ClientOptions::default(),
13 interface: Ipv6Addr::UNSPECIFIED,
14 device_instance: None,
15 foreign_device: None,
16 }
17 }
18}
19
20#[cfg(feature = "ipv6")]
22#[cfg_attr(docsrs, doc(cfg(feature = "ipv6")))]
23pub struct Bip6ClientBuilder {
24 pub(super) config: ClientConfig,
25 pub(super) options: ClientOptions,
26 pub(super) interface: Ipv6Addr,
27 pub(super) device_instance: Option<u32>,
28 pub(super) foreign_device: Option<Bip6ForeignDeviceConfig>,
29}
30
31#[cfg(feature = "ipv6")]
32impl Bip6ClientBuilder {
33 pub fn interface(mut self, ip: Ipv6Addr) -> Self {
35 self.interface = ip;
36 self
37 }
38
39 pub fn port(mut self, port: u16) -> Self {
41 self.config.port = port;
42 self
43 }
44
45 pub fn device_instance(mut self, instance: u32) -> Self {
47 self.device_instance = Some(instance);
48 self
49 }
50
51 pub fn apdu_timeout_ms(mut self, ms: u64) -> Self {
53 self.config.apdu_timeout_ms = ms;
54 self
55 }
56
57 pub fn max_apdu_length(mut self, len: u16) -> Self {
59 self.config.max_apdu_length = len;
60 self
61 }
62
63 pub fn cov_channel_capacity(mut self, capacity: usize) -> Self {
65 self.options.cov_channel_capacity = capacity;
66 self
67 }
68}