[Bacsharp-developers] Candidate 'BVLL.Create()' method (/BVLL class)
Brought to you by:
anders-agren,
skarg
From: Dennis V M. <d.m...@d2...> - 2018-10-24 12:33:34
|
Inspired by the intention of the following comment: //PEP Use NPDU.Create and APDU.Create (when written) A candidate method for 'BVLL.Create()': using System; //----------------------------------------------------------------------------------------------- // BVLL Routines public static class BVLL { public static int /*BVLL*/ Create(byte[] bytes, ushort bvlcLen = 0, int offset = 0) { // BVLL // BLVC Type bytes[offset++] = BACnetEnums.BACNET_BVLC_TYPE_BIP; // BLVC Function bytes[offset++] = BACnetEnums.BACNET_UNICAST_NPDU; // BLVC Length var blvcBytes = BitConverter.GetBytes(bvlcLen); bytes[offset++] = blvcBytes[1]; bytes[offset++] = blvcBytes[0]; return offset; } } E.g. Used like so: // BVLL var offset = BVLL.Create(sendBytes, 12); // 'offset' (/"len") == BVLL is always 4 bytes //sendBytes[0] = BACnetEnums.BACNET_BVLC_TYPE_BIP; //sendBytes[1] = BACnetEnums.BACNET_UNICAST_NPDU; //sendBytes[2] = 0; //sendBytes[3] = 12; [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. |