Skip to content

Commit 31a5c9c

Browse files
authored
Merge pull request #96 from meshtastic/wip
Obsolete method and hex string
2 parents 4955972 + 2148ea7 commit 31a5c9c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Meshtastic.Cli/CommandHandlers/MqttProxyCommandHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private static MqttClientOptions GetMqttClientOptions(DeviceStateContainer conta
9191

9292
if (container.LocalModuleConfig.Mqtt.TlsEnabled)
9393
{
94-
builder = builder.WithTls()
94+
builder = builder.WithTlsOptions(options => { })
9595
.WithTcpServer(host, Int32.Parse(port ?? "8883"));
9696
}
9797
else {

Meshtastic/Extensions/ReflectionExtensions.cs

+8-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ public static IEnumerable<PropertyInfo> GetProperties(this object instance)
4747
.Where(p => !Exclusions.Contains(p.Name));
4848
}
4949

50-
public static string GetSettingValue(this PropertyInfo property, object instance) =>
51-
(property.GetValue(instance)?.ToString() ?? string.Empty).Replace("[", string.Empty).Replace("]", string.Empty);
52-
50+
public static string GetSettingValue(this PropertyInfo property, object instance)
51+
{
52+
if (property.PropertyType == typeof(ByteString)) {
53+
var byteString = (ByteString)property.GetValue(instance)!;
54+
return Convert.ToHexString(byteString.ToByteArray());
55+
}
56+
return (property.GetValue(instance)?.ToString() ?? string.Empty).Replace("[", string.Empty).Replace("]", string.Empty);
57+
}
5358
}

0 commit comments

Comments
 (0)