Skip to content

Commit

Permalink
Allow Devices file to override Http Client Probe in MQTT Gateway Agents
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRitchie committed Nov 2, 2023
1 parent b2cf403 commit e6238a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ protected override void OnStartAgentBeforeLoad(IEnumerable<DeviceConfiguration>
agentClient.OnClientStopped += (s, e) => AgentClientStopped(agentClient);
agentClient.OnStreamStarted += (s, query) => AgentClientStreamStarted(agentClient, query);
agentClient.OnStreamStopped += (s, e) => AgentClientStreamStopped(agentClient);
agentClient.OnProbeReceived += (s, doc) => DevicesDocumentReceived(agentClient, doc);
agentClient.OnCurrentReceived += (s, doc) => StreamsDocumentReceived(agentClient, doc);
agentClient.OnSampleReceived += (s, doc) => StreamsDocumentReceived(agentClient, doc);
agentClient.OnAssetsReceived += (s, doc) => AssetsDocumentReceived(agentClient, doc);

if (Agent.GetDevice(agentClient.Device) == null)
{
agentClient.OnProbeReceived += (s, doc) => DevicesDocumentReceived(agentClient, doc);
}

_clients.Add(agentClient);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ protected override void OnStartAgentBeforeLoad(IEnumerable<DeviceConfiguration>
agentClient.OnClientStopped += (s, e) => AgentClientStopped(agentClient);
agentClient.OnStreamStarted += (s, query) => AgentClientStreamStarted(agentClient, query);
agentClient.OnStreamStopped += (s, e) => AgentClientStreamStopped(agentClient);
agentClient.OnProbeReceived += (s, doc) => DevicesDocumentReceived(agentClient, doc);
agentClient.OnCurrentReceived += (s, doc) => StreamsDocumentReceived(agentClient, doc);
agentClient.OnSampleReceived += (s, doc) => StreamsDocumentReceived(agentClient, doc);
agentClient.OnAssetsReceived += (s, doc) => AssetsDocumentReceived(agentClient, doc);

if (Agent.GetDevice(agentClient.Device) == null)
{
agentClient.OnProbeReceived += (s, doc) => DevicesDocumentReceived(agentClient, doc);
}

_clients.Add(agentClient);
}
}
Expand Down

0 comments on commit e6238a6

Please sign in to comment.