public Diagnostic(AppManager apm, BACnetManager bnm, myTreeNode deviceTreeNode)
 {
     this.devicTreeNode = deviceTreeNode;
     this.device        = deviceTreeNode.device;
     _apm = apm;
     _bnm = bnm;
 }
示例#2
0
        public static List <Diagnostic> BuildDiagnosticListStandard(AppManager apm, BACnetManager bnm, myTreeNode deviceNode)
        {
            List <Diagnostic> diagList = new List <Diagnostic>();

            // Adding diagnostics
            diagList.Add(new DiagnosticBIT00000Example(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00004ThreeRapidWhoIs(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00006RemoteBroadcast(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00008ReadPropertyProtocolServices(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00010ForceRouteDiscovery(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00011ReadWildcardDevice(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00012deviceIDrange(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00013whoIsRange1(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00014whoIsRangeTargeted(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00015whoIsBadMessage1(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00016whoIsBadMessage3(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00017Tag(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00019Missing(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00020TooManyProps(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00021RPwithInvalidIndex(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00022requiredDeviceProperties(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00023objectTypesCheck(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00024WhoIsNoSADR(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00026whoIsBadMessage2(apm, bnm, deviceNode));
            diagList.Add(new DiagnosticBIT00025LocalBroadcast(apm, bnm, deviceNode));

            // BACnet Router only tests
            if (deviceNode.type == myTreeNode.TREENODE_OBJ_TYPE.Router)
            {
                diagList.Add(new DiagnosticBIT00001DuplicateRoutingEntry(apm, bnm, deviceNode));
                diagList.Add(new DiagnosticBIT00018CheckPortID(apm, bnm, deviceNode));
            }

            return(diagList);
        }
示例#3
0
        public static List <Diagnostic> BuildDiagnosticListPrivate(AppManager apm, BACnetManager bnm, myTreeNode deviceNode)
        {
            List <Diagnostic> diagList = new List <Diagnostic>();

            // Adding diagnostics
            diagList.Add(new PDiag00000example(apm, bnm, deviceNode));
            // and add more here...

            return(diagList);
        }
示例#4
0
        private void radioButtonBAC1_Click(object sender, EventArgs e)
        {
            // switch to BAC1

            _bnm.BACnetManagerClose();

            inside_socket = new OurSocket(_apm, 0xBAC1);

            IPEPDestination = new myIPEndPoint(IPAddress.Broadcast, 0xBAC1);

            _bnm = new BACnetManager(_apm, inside_socket, BACnetEnums.SERVER_DEVICE_ID, IPEPDestination);

            BACnetInteropApp.Properties.Settings.Default.BACnetPort = 0xBAC1;
            BACnetInteropApp.Properties.Settings.Default.Save();
        }
示例#5
0
        public MainForm()
        {
            InitializeComponent();

            IPEPDestination = new myIPEndPoint(IPAddress.Broadcast, defaultPort);

            // Change the radio buttons to match the default

            switch (defaultPort)
            {
            case 0xBAC0:
                inside_socket = new OurSocket(_apm, defaultPort);
                // todo, we cannot update the radiobuttons yet because they will close and reopen bnm, and that is not defined yet....
                this.radioButtonBAC0.Checked = true;
                this.radioButtonBAC1.Checked = false;
                break;

            case 0xBAC1:
                inside_socket = new OurSocket(_apm, defaultPort);
                this.radioButtonBAC1.Checked = true;
                this.radioButtonBAC0.Checked = false;
                break;

            default:
                // todo-panic here
                break;
            }

            _bnm = new BACnetManager(_apm, inside_socket, BACnetEnums.SERVER_DEVICE_ID, IPEPDestination);

            TreeViewDevices.ShowNodeToolTips = true;
            _apm.treeViewUpdater             = new DeviceTreeView(_apm, TreeViewDevices);
            _apm.bnm = _bnm;

            // backgroundWorkerApplication.RunWorkerAsync();
        }
示例#6
0
 public DiagnosticBIT00008ReadPropertyProtocolServices(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
示例#7
0
 public Diagnostic0007IAmRouterIsLocalBroadcast(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
示例#8
0
 public DiagnosticBIT00001DuplicateRoutingEntry(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
示例#9
0
 public DiagnosticBIT00004ThreeRapidWhoIs(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
示例#10
0
 public DiagnosticBIT00006RemoteBroadcast(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
        // If this page does not exist, please create, using: http://www.bac-test.com/wiki/index.php?title=BIT00000_-_Template
        //


        public DiagnosticBIT00022requiredDeviceProperties(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
        {
        }
示例#12
0
 public DiagnosticBIT00024WhoIsNoSADR(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
示例#13
0
        // Notes
        // When done writing a new diagnostic, don't forget to include it in AddDiagnosticListAll()

        public DiagnosticBIT00016whoIsBadMessage3(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
        {
        }
示例#14
0
        public static void TreeViewUpdate(BACnetManager bnm, TreeView treeViewMessageLog)
        {
            if (bnm.BACnetMessageLog.Count > 0)
            {
                while (bnm.BACnetMessageLog.Count > 0)
                {
                    // remove the first treenode

                    _count++;

                    PacketLog pktlog = bnm.BACnetMessageLog.Dequeue();

                    if (bnm.logPings == false &&
                        pktlog.CRPpacket != null &&
                        (pktlog.CRPpacket.function == CRPpacket.CR_PACKET_FUNC.CRP_PING || pktlog.CRPpacket.function == CRPpacket.CR_PACKET_FUNC.CRP_PONG))
                    {
                        // dont want to see noisy pings and pongs
                        continue;
                    }

                    TreeNode ntn = new TreeNode();

                    if (pktlog.sending == true)
                    {
                        ntn.Text      = _count.ToString() + " Sent";
                        ntn.BackColor = Color.LightPink;
                    }
                    else
                    {
                        ntn.Text      = _count.ToString() + " Recd";
                        ntn.BackColor = Color.LightGreen;
                    }

                    if (pktlog.CRPpacket != null)
                    {
                        switch (pktlog.CRPpacket.function)
                        {
                        case CRPpacket.CR_PACKET_FUNC.CRP_PING:
                            ntn.Text += " Ping";
                            ntn.Nodes.Add("Site ID:     " + pktlog.CRPpacket.siteID.ToString());
                            ntn.Nodes.Add("Network:     " + pktlog.CRPpacket.networkNumber.ToString());
                            ntn.Nodes.Add("BACnet Port: " + pktlog.CRPpacket.BACnetPort.ToString());
                            break;

                        case CRPpacket.CR_PACKET_FUNC.CRP_PONG:
                            ntn.Text += " Pong";
                            ntn.Nodes.Add("Site ID:     " + pktlog.CRPpacket.siteID.ToString());
                            ntn.Nodes.Add("Network:     " + pktlog.CRPpacket.networkNumber.ToString());
                            ntn.Nodes.Add("BACnet Port: " + pktlog.CRPpacket.BACnetPort.ToString());
                            break;

                        case CRPpacket.CR_PACKET_FUNC.CRP_SEND_BACNET_PACKET_TO_RELAY:
                            ntn.Text += " Send to CloudRelay";
                            break;

                        case CRPpacket.CR_PACKET_FUNC.CRP_SENDTOCLOUDROUTER:
                            ntn.Text += " Send to CloudRouter";
                            break;

                        case CRPpacket.CR_PACKET_FUNC.CRP_SEND_BACNET_VIA_PROXY:
                            ntn.Text += " Send to CloudRouter as Proxy";
                            break;

                        default:
                            ntn.Text += " Unknown CRP message";
                            break;
                        }

                        if (pktlog.ipep != null)
                        {
                            if (pktlog.sending == true)
                            {
                                ntn.Nodes.Add("To:   " + pktlog.ipep.ToString());
                            }
                            else
                            {
                                ntn.Nodes.Add("From: " + pktlog.ipep.ToString());
                            }
                        }
                    }

                    if (pktlog.BACnetPacket != null)
                    {
                        // display some NPDU parameters

                        if (pktlog.BACnetPacket.npdu.isBroadcast)
                        {
                            ntn.Nodes.Add("Broadcast");
                        }
                        else
                        {
                            if (pktlog.BACnetPacket.dadr != null)
                            {
                                ntn.Nodes.Add(pktlog.BACnetPacket.dadr.ToString());
                            }
                        }

                        if (pktlog.BACnetPacket.npdu.expectingReply)
                        {
                            ntn.Nodes.Add("Expecting Reply");
                        }

                        if (pktlog.BACnetPacket.apdu_present == false)
                        {
                            // todo, clean up this flag one day
                            ntn.Nodes.Add("NPDU Function: " + pktlog.BACnetPacket.npdu.function.ToString());
                        }


                        if (pktlog.BACnetPacket.APDUunconfirmedServiceDecoded)
                        {
                            switch (pktlog.BACnetPacket.serviceType)
                            {
                            case BACnetEnums.BACNET_UNCONFIRMED_SERVICE.SERVICE_UNCONFIRMED_I_AM:
                                ntn.Text += " I-Am";
                                break;

                            case BACnetEnums.BACNET_UNCONFIRMED_SERVICE.SERVICE_UNCONFIRMED_WHO_IS:
                                ntn.Text += " Who-Is";
                                break;

                            default:
                                ntn.Text += " Unknown BACnet unconfirmed service type - fix line 142 PacketLog.cs";
                                break;
                            }
                        }

                        if (pktlog.BACnetPacket.APDUconfirmedServiceTypeDecoded)
                        {
                            switch (pktlog.BACnetPacket.confirmedServiceType)
                            {
                            case BACnetEnums.BACNET_CONFIRMED_SERVICE.SERVICE_CONFIRMED_READ_PROPERTY:
                                ntn.Text += " Read Property";
                                break;

                            case BACnetEnums.BACNET_CONFIRMED_SERVICE.SERVICE_CONFIRMED_READ_PROP_MULTIPLE:
                                ntn.Text += " Read Property Multiple";
                                break;

                            default:
                                ntn.Text += " Unknown BACnet confirmed service type - fix line 156 PacketLog.cs";
                                break;
                            }
                        }
                    }



                    treeViewMessageLog.Nodes.Add(ntn);
                    treeViewMessageLog.ExpandAll();

                    // remove all the earlier nodes...
                    while (treeViewMessageLog.Nodes.Count > 150)
                    {
                        treeViewMessageLog.Nodes.RemoveAt(0);
                    }
                }
            }
        }
示例#15
0
        // Notes
        //
        // This tests the following ASHRAE conformance test from "ASHRAE-D-86446-20071031 - Conformance" :
        //
        // 135.1-2007 - 13.4.4 - pg 455 - Missing Required Parameter
        //
        //  Further information could be found here: http://www.bac-test.com/wiki/index.php?title=BIT00021
        //
        // If this page does not exist, please create, using: http://www.bac-test.com/wiki/index.php?title=BIT00000_-_Template
        //


        public DiagnosticBIT00021RPwithInvalidIndex(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
        {
        }
示例#16
0
        // Notes
        // When done writing a new diagnostic, don't forget to include it in AddDiagnosticListAll()

        public DiagnosticBIT00012deviceIDrange(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
        {
        }
示例#17
0
 public OurApplication(AppManager apm, BACnetManager bnm)
 {
     _apm = apm;
     _bnm = bnm;
 }
        // Notes
        // When done writing a new diagnostic, don't forget to include it in AddDiagnosticListAll()

        // This tests the following ASHRAE conformance test from "ASHRAE-D-86446-20071031 - Conformance" :
        //
        // 135.1-2007 - Section XX.X.X - pg xxx - Aaaaa
        //
        //  Further information could be found here: http://www.bac-test.com/wiki/index.php?title=BIT00000
        //
        // If this page does not exist, please create, using: http://www.bac-test.com/wiki/index.php?title=BIT00000_-_Template
        //

        public DiagnosticBIT00000Example(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device) { }
示例#19
0
 public Diagnostic(AppManager apm, BACnetManager bnm)
 {
     _apm = apm;
     _bnm = bnm;
 }
示例#20
0
 public DiagnosticBIT00010ForceRouteDiscovery(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
示例#21
0
 public DiagnosticBIT00018CheckPortID(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
示例#22
0
 public DiagnosticBIT00011ReadWildcardDevice(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
 {
 }
        // Notes
        //
        // This tests the following ASHRAE conformance test from "ASHRAE-D-86446-20071031 - Conformance" :
        //
        // 135.1-2007 - 13.4.5 - pg 456 - Too Many Properties
        //
        //  Further information could be found here: http://www.bac-test.com/wiki/index.php?title=BIT00020
        //
        // If this page does not exist, please create, using: http://www.bac-test.com/wiki/index.php?title=BIT00000_-_Template
        //


        public DiagnosticBIT00020TooManyProps(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
        {
        }
示例#24
0
        // Notes
        // When done writing a new diagnostic, don't forget to include it in AddDiagnosticListAll()

        public DiagnosticBIT00014whoIsRangeTargeted(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
        {
        }
示例#25
0
        static public void AddDiagnosticsTomyTreeNodeDiagnosticListAll(AppManager apm, BACnetManager bnm, myTreeNode deviceTreeNode, myTreeNode mtnDiagnosticList)
        {
            List <Diagnostic> diagList;

            // Adding 'standard' diagnostics
            diagList = Diagnostics.DiagSetup.BuildDiagnosticListStandard(apm, bnm, deviceTreeNode);
            Diagnostic.AddUniqueDiagnostics(mtnDiagnosticList, diagList);

            // Adding 'private' or 'user' diagnostics
            diagList = DiagnosticPrivate.PDiagSetup.BuildDiagnosticListPrivate(apm, bnm, deviceTreeNode);
            Diagnostic.AddUniqueDiagnostics(mtnDiagnosticList, diagList);
        }
示例#26
0
        // If this page does not exist, please create, using: http://www.bac-test.com/wiki/index.php?title=BIT00000_-_Template
        //


        public DiagnosticBIT00023objectTypesCheck(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
        {
        }
示例#27
0
        // Notes
        // When done writing a new diagnostic, don't forget to include it in AddDiagnosticListAll()

        // This tests the following ASHRAE conformance test from "ASHRAE-D-86446-20071031 - Conformance" :
        //
        // 135.1-2007 - Section XX.X.X - pg xxx - Aaaaa
        //
        //  Further information could be found here: http://www.bac-test.com/wiki/index.php?title=BIT00000
        //
        // If this page does not exist, please create, using: http://www.bac-test.com/wiki/index.php?title=BIT00000_-_Template
        //

        public PDiag00000example(AppManager apm, BACnetManager bnm, myTreeNode device) : base(apm, bnm, device)
        {
        }