OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
ExtendedDeviceIdentificationBuilder.cs
1using System.Collections.Generic;
2
4{
10 {
11 private readonly List<ExtendedIdEntry> _entries = new();
12
19 {
20 return WithEntry(ExtendedIdTag.Manufacturer, manufacturer);
21 }
22
29 {
30 return WithEntry(ExtendedIdTag.ProductName, productName);
31 }
32
39 {
40 return WithEntry(ExtendedIdTag.SerialNumber, serialNumber);
41 }
42
49 {
50 return WithEntry(ExtendedIdTag.FirmwareVersion, firmwareVersion);
51 }
52
59 {
60 return WithEntry(ExtendedIdTag.HardwareDescription, hardwareDescription);
61 }
62
69 {
70 return WithEntry(ExtendedIdTag.Url, url);
71 }
72
79 {
80 return WithEntry(ExtendedIdTag.ConfigurationReference, configurationReference);
81 }
82
90 {
91 _entries.Add(new ExtendedIdEntry(tag, value));
92 return this;
93 }
94
102 public ExtendedDeviceIdentificationBuilder WithCustomEntry(byte tagByte, string value)
103 {
104 _entries.Add(new ExtendedIdEntry(tagByte, value));
105 return this;
106 }
107
114 {
115 _entries.Add(entry);
116 return this;
117 }
118
124 {
125 return new ExtendedDeviceIdentification(_entries);
126 }
127 }
128}
Fluent builder for creating ExtendedDeviceIdentification instances.
ExtendedDeviceIdentificationBuilder WithSerialNumber(string serialNumber)
Sets the serial number.
ExtendedDeviceIdentification Build()
Builds the immutable ExtendedDeviceIdentification instance.
ExtendedDeviceIdentificationBuilder WithUrl(string url)
Sets the URL.
ExtendedDeviceIdentificationBuilder WithFirmwareVersion(string firmwareVersion)
Adds a firmware version.
ExtendedDeviceIdentificationBuilder WithEntry(ExtendedIdTag tag, string value)
Adds a standard entry using a known tag.
ExtendedDeviceIdentificationBuilder WithHardwareDescription(string hardwareDescription)
Sets the hardware description.
ExtendedDeviceIdentificationBuilder WithEntry(ExtendedIdEntry entry)
Adds a pre-constructed ExtendedIdEntry.
ExtendedDeviceIdentificationBuilder WithConfigurationReference(string configurationReference)
Sets the configuration reference.
ExtendedDeviceIdentificationBuilder WithManufacturer(string manufacturer)
Sets the manufacturer name.
ExtendedDeviceIdentificationBuilder WithCustomEntry(byte tagByte, string value)
Adds a custom/vendor-specific entry using a raw tag byte.
ExtendedDeviceIdentificationBuilder WithProductName(string productName)
Sets the product name.
The extended PD identification data sent as a reply to an osdp_ID command with data 0x01.
Represents a single TLV (Tag-Length-Value) entry in the extended device identification response.
ExtendedIdTag
Defines the tag types used in the extended device identification TLV stream.