[Bacsharp-developers] MAC address fix for 'DADR' (?)
Brought to you by:
anders-agren,
skarg
From: Dennis V M. <d.m...@d2...> - 2018-10-24 17:00:33
|
Similar (1 of the 2 'SADR') MAC Address fixes (- code to be added), but this time for the 'DADR', in the 'NPDU.Parse()' method: //PEP Other DLEN values ... // DVM: MAC Address if (DLEN == 6) { DADR = new byte[6]; DADR[5] = bytes[len++]; DADR[4] = bytes[len++]; DADR[3] = bytes[len++]; DADR[2] = bytes[len++]; DADR[1] = bytes[len++]; DADR[0] = bytes[len++]; DAddress = BitConverter.ToUInt32(SADR, 0); } (Also, I would have thought that 'SAddress' & 'DAddress' / all MAC-Addresses should be of type 'ulong' rather than 'uint' - just in case they need to accommodate a full 6-byte MAC address - also including the 3 leading "manufacturer" bytes, in addition to the 3 trailing "serial number" bytes; although you'd have to ignore the 2 high-order bytes as 'ulong' is 8 octets/bytes long.) [http://dev.d2i.co/d2i-email-signature/wlogo.png] Dennis McEnaney Technical Lead DDI 020 3102 4100<tel:02031024100> [http://dev.d2i.co/d2i-email-signature/wdot.png] TEL 020 3817 7839<tel:02038177839> [http://dev.d2i.co/d2i-email-signature/wdot.png] WEB d2i.co<http://d2i.co/> Portsoken House, 155-157 Minories, London, EC3N 1LJ [http://dev.d2i.co/d2i-email-signature/wico-linkedin.png]<https://www.linkedin.com/company/d2-interactive-uk>[http://dev.d2i.co/d2i-email-signature/wico-facebook.png]<https://www.facebook.com/d2iglobal>[http://dev.d2i.co/d2i-email-signature/wico-twitter.png]<https://twitter.com/d2interactive>[http://dev.d2i.co/d2i-email-signature/wico-instagram.png]<https://www.instagram.com/d2interactive/>[http://dev.d2i.co/d2i-email-signature/wico-google.png]<https://plus.google.com/116460778442548453069/posts> D2 Interactive Limited, Company Reg No. 7116878, VAT No. 984-4271-88, Registered Office: Portsoken House, 155-157 Minories, London, EC3N 1LJ. This email may be private and confidential, and contain legally privileged information. If you are not the addressee you should not disclose, copy, circulate or in any other way use the information contained in this transmission. Such unauthorised use is prohibited and may be unlawful. If you are not the intended recipient, please contact us immediately. P Save a tree - we only print the emails we really need. |