Skip to content
Draft
2 changes: 2 additions & 0 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Configuration for an MTConnect Agent
| `ignoreTimestamps` | `IgnoreTimestamps` | `bool` | Overwrite timestamps with the agent time. This will correct clock drift but will not give as accurate relative time since it will not take into consideration network latencies. This can be overridden on a per adapter basis. |
| `inputValidationLevel` | `InputValidationLevel` | `InputValidationLevel` | Gets or Sets the default Input (Observation or Asset) validation level. 0 = Ignore, 1 = Warning, 2 = Remove, 3 = Strict |
| `observationBufferSize` | `ObservationBufferSize` | `uint` | The maximum number of Observations the agent can hold in its buffer |
| `sender` | `Sender` | `string` | The value emitted as the <c>Header/@sender</c> attribute on MTConnect response documents (see MTConnect Part 1 §7). When null or empty, <see cref="MTConnect.Agents.MTConnectAgent"/> falls back to <see cref="System.Net.Dns.GetHostName"/>. |
| `timezoneOutput` | `TimeZoneOutput` | `string` | Sets the TimeZone to use when timestamps are output from the Agent |

### `DataSourceConfiguration`
Expand Down Expand Up @@ -206,6 +207,7 @@ Configuration for an MTConnect Agent
| `inputValidationLevel` | `InputValidationLevel` | `InputValidationLevel` | Gets the default Input (Observation or Asset) validation level. 0 = Ignore, 1 = Warning, 2 = Remove, 3 = Strict |
| `observationBufferSize` | `ObservationBufferSize` | `uint` | The maximum number of Observations the agent can hold in its buffer |
| `path` | `Path` | `string` | The file system path the configuration was loaded from, used as the default target when the configuration is saved back to disk. |
| `sender` | `Sender` | `string` | The value emitted as the <c>Header/@sender</c> attribute on MTConnect response documents (see MTConnect Part 1 §7). When null or empty, <see cref="MTConnect.Agents.MTConnectAgent"/> falls back to <see cref="System.Net.Dns.GetHostName"/>. |
| `timeZoneOutput` | `TimeZoneOutput` | `string` | Sets the TimeZone to use when timestamps are output from the Agent |

### `IDataSourceConfiguration`
Expand Down
2 changes: 2 additions & 0 deletions libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ public MTConnectAgent(
_uuid = !string.IsNullOrEmpty(uuid) ? uuid : Guid.NewGuid().ToString();
_instanceId = instanceId > 0 ? instanceId : CreateInstanceId();
_configuration = configuration != null ? configuration : new AgentConfiguration();
if (!string.IsNullOrEmpty(_configuration.Sender))
_sender = _configuration.Sender;
_information = new MTConnectAgentInformation(_uuid, _instanceId, _deviceModelChangeTime);
_deviceModelChangeTime = deviceModelChangeTime;
_mtconnectVersion = _configuration != null && _configuration.DefaultVersion != null ? _configuration.DefaultVersion : MTConnectVersions.Max;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public class AgentConfiguration : IAgentConfiguration
[YamlIgnore]
public string Path { get; set; }

/// <summary>
/// The value emitted as the <c>Header/@sender</c> attribute on MTConnect response documents (see MTConnect Part 1 §7). When null or empty, <see cref="MTConnect.Agents.MTConnectAgent"/> falls back to <see cref="System.Net.Dns.GetHostName"/>.
/// </summary>
[JsonPropertyName("sender")]
public string Sender { get; set; }


/// <summary>
/// The maximum number of Observations the agent can hold in its buffer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public interface IAgentConfiguration
/// </summary>
string Path { get; }

/// <summary>
/// The value emitted as the <c>Header/@sender</c> attribute on MTConnect response documents (see MTConnect Part 1 §7). When null or empty, <see cref="MTConnect.Agents.MTConnectAgent"/> falls back to <see cref="System.Net.Dns.GetHostName"/>.
/// </summary>
string Sender { get; }


/// <summary>
/// The maximum number of Observations the agent can hold in its buffer
Expand Down
Loading