Skip to content

Commit

Permalink
Merge branch 'master' into advantech
Browse files Browse the repository at this point in the history
  • Loading branch information
julienblitte committed Jun 14, 2021
2 parents ecaed55 + dd434af commit a4829e6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
7 changes: 5 additions & 2 deletions UniversalScanner/Bosch.cs
Expand Up @@ -40,6 +40,10 @@ public struct MacAddress
[FieldOffset(0x03)] public byte byte03;
[FieldOffset(0x04)] public byte byte04;
[FieldOffset(0x05)] public byte byte05;
public override string ToString()
{
return String.Format("{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}", byte00, byte01, byte02, byte03, byte04, byte05);
}
};

[StructLayout(LayoutKind.Explicit, Size = 0x20, CharSet = CharSet.Ansi)]
Expand Down Expand Up @@ -93,8 +97,7 @@ public override void reciever(IPEndPoint from, byte[] data)

ip = NetworkUtils.littleEndian32(binary.ipv4);

deviceSerial = String.Format("{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}", binary.mac.byte00, binary.mac.byte01, binary.mac.byte02,
binary.mac.byte03, binary.mac.byte04, binary.mac.byte05);
deviceSerial = binary.mac.ToString();

deviceModel = name;

Expand Down
8 changes: 5 additions & 3 deletions UniversalScanner/GigEVision.cs
Expand Up @@ -45,6 +45,10 @@ public struct MacAddress
[FieldOffset(0x03)] public byte byte03;
[FieldOffset(0x04)] public byte byte04;
[FieldOffset(0x05)] public byte byte05;
public override string ToString()
{
return String.Format("{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}", byte00, byte01, byte02, byte03, byte04, byte05);
}
}

[StructLayout(LayoutKind.Explicit, Size = 0x10, CharSet = CharSet.Ansi)]
Expand Down Expand Up @@ -307,9 +311,7 @@ public override void reciever(IPEndPoint from, byte[] data)
ipv4 = from.Address;
}

macAddress = String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}",
answer.plMacAddress.byte00, answer.plMacAddress.byte01, answer.plMacAddress.byte02,
answer.plMacAddress.byte03, answer.plMacAddress.byte04, answer.plMacAddress.byte05);
macAddress = answer.plMacAddress.ToString();
serial = Encoding.UTF8.GetString(answer.plSerialNumber);
if (serial == "")
{
Expand Down
12 changes: 10 additions & 2 deletions UniversalScanner/NiceVision.cs
Expand Up @@ -45,6 +45,10 @@ public struct MacAddress
[FieldOffset(0x03)] public byte byte03;
[FieldOffset(0x04)] public byte byte04;
[FieldOffset(0x05)] public byte byte05;
public override string ToString()
{
return String.Format("{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}", byte00, byte01, byte02, byte03, byte04, byte05);
}
};

[StructLayout(LayoutKind.Explicit, Size = 0x16, CharSet = CharSet.Ansi)]
Expand All @@ -66,6 +70,11 @@ public struct String16Bytes
[FieldOffset(0x0D)] public byte byte0D;
[FieldOffset(0x0E)] public byte byte0E;
[FieldOffset(0x0F)] public byte byte0F;

public override string ToString()
{
return String.Format("{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}", byte00, byte01, byte02, byte03, byte04, byte05);
}
};

[StructLayout(LayoutKind.Explicit, Size = 0x5A, CharSet = CharSet.Ansi)]
Expand Down Expand Up @@ -147,8 +156,7 @@ public override void reciever(IPEndPoint from, byte[] data)

answer = data.GetStruct<NiceVisionAnswer>();

deviceSerial = String.Format("{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}", answer.mac.byte00, answer.mac.byte01, answer.mac.byte02,
answer.mac.byte03, answer.mac.byte04, answer.mac.byte05);
deviceSerial = answer.mac.ToString();

deviceModel = Encoding.UTF8.GetString(answer.name);
ip = new IPAddress(answer.ipv4);
Expand Down

0 comments on commit a4829e6

Please sign in to comment.