Example #1
0
 // Use this for initialization
 void Start()
 {
     if (brokerHostname != null && userName != null && password != null)
     {
         Connect();
         client.Subscribe(topic);
     }
 }
Example #2
0
 // Use this for initialization
 void Awake()
 {
     if (brokerHostname != null && userName != null && password != null)
     {
         Connect();
         client.Subscribe(topic);
     }
     client.Publish(topic, System.Text.Encoding.ASCII.GetBytes("0/OFF/0"));
 }
Example #3
0
 // Use this for initialization
 void Start()
 {
     colorSplineObject = GetComponent <ColorSplineObject>();
     colorSplineObject.UpdateSplineEvent += new ColorSplineObject.UpdateSplineEventHandler(OnSplineUpdate);
     client = new MqttClient4Unity(host, port, false, null);
     client.Connect(clientName);
     client.MqttMsgPublished += new MqttClient.MqttMsgPublishedEventHandler(OnMessage);
     client.Subscribe(SPLINE_TOPIC);         //TODO This isn't working
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     // Connect to the MQTT broker
     if (brokerHostname != null && usrNm != null && psw != null)
     {
         Connect();
         // Register topic in the client
         client.Subscribe(topic);
     }
 }
Example #5
0
    void Start()
    {
        Live2D.init();

        load();

        if (brokerHostname != null && userName != null && password != null)
        {
            Connect();
            client.Subscribe(topic);
        }

        var j = (IDictionary)MiniJSON.Json.Deserialize("{\"AcX\": -15200, \"AcY\": -1416, \"AcZ\": 4292, \"Tmp\": -4528, \"GyX\": -203, \"GyY\": 72, \"GyZ\": -48}");

        Debug.Log(j.GetType());
    }
Example #6
0
    private void Start()
    {
        if (brokerHostname != null)
        {
            Connect();
            client.Subscribe(topic);
        }

        if (GameObject.Find("Scenetransfer").GetComponent <SceneTransfer>().mode == "Send")
        {
            send = true;
            positiondisplay.SetActive(false);
        }
        else
        {
            send = false;
            positiondisplay.SetActive(true);
            //sendaudrino.SetActive(true);
        }
    }
Example #7
0
    void Start()
    {
        if (!string.IsNullOrEmpty(brokerHostname))
        {
            Connect();
            innerTempTopic     = "SmartWindow/MCUINT/Clima/Temperatura";
            innerHumidityTopic = "SmartWindow/MCUINT/Clima/Humedad";
            shadeStateTopic    = "SmartWindow/MCUEXT/Toldo/Estado";
            windowStateTopic   = "SmartWindow/MCUEXT/Ventana/Estado";
            outerTempTopic     = "SmartWindow/MCUEXT/Clima/Temperatura";
            outerWindTopic     = "SmartWindow/MCUEXT/Clima/VelViento";
            outerLightTopic    = "SmartWindow/MCUEXT/Clima/Iluminacion";

            client.Subscribe(innerTempTopic);
            client.Subscribe(innerHumidityTopic);
            client.Subscribe(shadeStateTopic);
            client.Subscribe(windowStateTopic);
            client.Subscribe(outerTempTopic);
            client.Subscribe(outerWindTopic);
            client.Subscribe(outerLightTopic);
        }
    }