Skip to content

Commit

Permalink
split EchonetPropertyExtentions from EchonetObjectExtentions and make…
Browse files Browse the repository at this point in the history
… them internal
  • Loading branch information
smdn committed Mar 31, 2024
1 parent 113ed39 commit 26a4a26
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using System.Threading.Tasks;

using Smdn.Net.EchonetLite.Protocol;
using Smdn.Net.EchonetLite.Extensions;

namespace Smdn.Net.EchonetLite
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-FileCopyrightText: 2018 HiroyukiSakoh
// SPDX-FileCopyrightText: 2023 smdn <smdn@smdn.jp>
// SPDX-License-Identifier: MIT
namespace Smdn.Net.EchonetLite
{
internal static class EchonetObjectExtentions
{
public static string GetDebugString(this EchonetObject obj)
{
if (obj == null)
{
return "null";
}
if(obj.Spec == null)
{
return "Spec null";
}
return $"0x{obj.Spec.ClassGroup.Code:X2}{obj.Spec.ClassGroup.Name} 0x{obj.Spec.Class.Code:X2}{obj.Spec.Class.Name} {obj.InstanceCode:X2}";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,10 @@
// SPDX-License-Identifier: MIT
using System.Text;

namespace Smdn.Net.EchonetLite.Extensions
namespace Smdn.Net.EchonetLite
{
public static class Extentions
internal static class EchonetPropertyExtentions
{
public static string GetDebugString(this EchonetObject obj)
{
if (obj == null)
{
return "null";
}
if(obj.Spec == null)
{
return "Spec null";
}
return $"0x{obj.Spec.ClassGroup.Code:X2}{obj.Spec.ClassGroup.Name} 0x{obj.Spec.Class.Code:X2}{obj.Spec.Class.Name} {obj.InstanceCode:X2}";
}
public static string GetDebugString(this EchonetProperty property)
{
if (property == null)
Expand Down

0 comments on commit 26a4a26

Please sign in to comment.