コード例 #1
0
        public override void disableStream(IModuleBoardBridge bridge)
        {
            if ((source.eventConfig[1] & 0x80) == 0x0)
            {
                if (source.eventConfig[2] == DataTypeBase.NO_ID)
                {
                    if (bridge.numDataHandlers(source.eventConfigAsTuple()) == 1)
                    {
                        bridge.sendCommand(new byte[] { source.eventConfig[0], source.eventConfig[1], 0x0 });
                    }
                }
                else
                {
                    if (bridge.numDataHandlers(source.eventConfigAsTuple()) == 1)
                    {
                        if (source.eventConfig[0] == (byte)DATA_PROCESSOR && source.eventConfig[1] == DataProcessor.NOTIFY)
                        {
                            bridge.sendCommand(new byte[] { source.eventConfig[0], DataProcessor.NOTIFY_ENABLE, source.eventConfig[2], 0x0 });
                        }
                    }
                }
            }
            else
            {
                if (bridge.numDataHandlers(source.eventConfigAsTuple()) == 1)
                {
                    source.markSilent();
                }
            }

            bridge.removeDataHandler(source.eventConfigAsTuple(), dataResponseHandler);
        }
コード例 #2
0
        public override void enableStream(IModuleBoardBridge bridge)
        {
            addDataHandler(bridge);

            if ((source.eventConfig[1] & 0x80) == 0x0)
            {
                if (source.eventConfig[2] == DataTypeBase.NO_ID)
                {
                    if (bridge.numDataHandlers(source.eventConfigAsTuple()) == 1)
                    {
                        bridge.sendCommand(new byte[] { source.eventConfig[0], source.eventConfig[1], 0x1 });
                    }
                }
                else
                {
                    bridge.sendCommand(new byte[] { source.eventConfig[0], source.eventConfig[1], 0x1 });
                    if (bridge.numDataHandlers(source.eventConfigAsTuple()) == 1)
                    {
                        if (source.eventConfig[0] == (byte)DATA_PROCESSOR && source.eventConfig[1] == DataProcessor.NOTIFY)
                        {
                            bridge.sendCommand(new byte[] { source.eventConfig[0], DataProcessor.NOTIFY_ENABLE, source.eventConfig[2], 0x1 });
                        }
                    }
                }
            }
            else
            {
                source.markLive();
            }
        }