send "sdr_id" to be able to detect changes

This commit is contained in:
Jakob Ketterl 2021-01-30 16:04:13 +01:00
parent 8372f198db
commit ad8ff1c2f7
2 changed files with 7 additions and 1 deletions

View File

@ -116,6 +116,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
"start_freq",
"center_freq",
"initial_squelch_level",
"sdr_id",
"profile_id",
"squelch_auto_margin",
]

View File

@ -52,7 +52,12 @@ class SdrSource(ABC):
self.props = PropertyStack()
# layer 0 reserved for profile properties
self.props.addLayer(1, props)
self.props.addLayer(2, Config.get())
# the sdr_id is constant, so we put it in a separate layer
# this is used to detect device changes, that are then sent to the client
sdrIdLayer = PropertyLayer()
sdrIdLayer["sdr_id"] = id
self.props.addLayer(2, sdrIdLayer.readonly())
self.props.addLayer(3, Config.get())
self.sdrProps = self.props.filter(*self.getEventNames())
self.profile_id = None