Exemple #1
0
        public void Start()
        {
            _owner = Topic.root.Get("/$YS/MQTT-SN");
            var verboseT = _owner.Get("verbose");

            if (verboseT.GetState().ValueType != JSC.JSValueType.Boolean)
            {
                verboseT.SetAttribute(Topic.Attribute.Required | Topic.Attribute.Config);
#if DEBUG
                verboseT.SetState(true);
#else
                verboseT.SetState(false);
#endif
            }
            _verboserSR = verboseT.Subscribe(SubRec.SubMask.Once | SubRec.SubMask.Value, (p, s) => verbose = (_verboserSR.setTopic != null && _verboserSR.setTopic.GetState().As <bool>()));
            _stat       = _owner.Get("statistic");
            if (_stat.GetState().ValueType != JSC.JSValueType.Boolean)
            {
                _stat.SetAttribute(Topic.Attribute.Required | Topic.Attribute.Config);
                _stat.SetState(false);
            }
            _gates.Add(new MsGUdp(this));
            MsGSerial.Init(this);
        }
Exemple #2
0
 private void RefreshPortsRpc(JSC.JSValue[] obj)
 {
     MsGSerial.StartScan();
 }