Skip to content

Commit 65344f2

Browse files
committed
Fix getDefine return null if there are multiple defines
Fix Parameterdescription is not part of SupportedParameters some times
1 parent 7b1df65 commit 65344f2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

RDMSharp/Metadata/MetadataFactory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ private static MetadataJSONObjectDefine getDefine(ParameterBag parameter)
295295
if (parameter.DeviceModelID != null)
296296
{
297297
possibleDefines = possibleDefines.Where(d => d.DeviceModelID == parameter.DeviceModelID).ToList();
298+
if (possibleDefines.Count == 0)
299+
return define;
298300
if (possibleDefines.Count == 1)
299301
define = possibleDefines[0];
300302
else if (possibleDefines.Count > 1)

RDMSharp/RDM/Device/RDMDeviceModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ private async Task requestSupportedParameters()
220220
if (DeviceInfo.Dmx512CurrentPersonality.HasValue) // Remote Device not send DMX_PERSONALITY Parameter but uses it!
221221
supportedParameters.TryAdd(ERDM_Parameter.DMX_PERSONALITY, true);
222222

223+
if (!this.supportedParameters.ContainsKey(ERDM_Parameter.PARAMETER_DESCRIPTION) && this.supportedParameters.Any(p=> ((ushort)p.Key) >= 0x8000 && ((ushort)p.Key) >= 0xFFDF)) // Remote Device not send PARAMETER_DESCRIPTION Parameter but has Manufacture speific Parameters it!
224+
this.supportedParameters.TryAdd(ERDM_Parameter.PARAMETER_DESCRIPTION, true);
225+
223226
if (!this.supportedParameters.ContainsKey(ERDM_Parameter.IDENTIFY_DEVICE)) //Test it if the device supports Identify Device Parameter, if not it will be labled as not supported later on
224227
this.supportedParameters.TryAdd(ERDM_Parameter.IDENTIFY_DEVICE, true);
225228

0 commit comments

Comments
 (0)