示例#1
0
        private void SendSubscribe(string publishToken, TesiraAttributeCode attributeCode)
        {
            var message = Tesira.FormatBaseMessage(InstanceTag, TesiraCommand.Subscribe, attributeCode) + " \"" +
                          publishToken + "\" " + 200;

            Device.Send(message);
        }
示例#2
0
        protected void Unsubscribe(string publishToken)
        {
            if (Subscriptions.ContainsKey(publishToken))
            {
                if (Device.DeviceCommunicating)
                {
                    var message =
                        Tesira.FormatBaseMessage(InstanceTag, TesiraCommand.Unsubscribe, Subscriptions[publishToken]) +
                        " \"" + publishToken + "\"";
                    Device.Send(message);
                }

                Subscriptions.Remove(publishToken);
            }
        }