Beispiel #1
0
    // when the button Set ID/"ASSIGN" is pressed
    public void OnSetDeviceId(InputField input_deviceId)
    {
        string newDeviceId = (input_deviceId.text == "") ? input_deviceId.placeholder.GetComponent <Text>().text : input_deviceId.text;

        // print(mqttAddress + "   |   " + newDeviceId);
        MQTTBehaviour.Publish("hat/setId", "i" + newDeviceId);
        // print("hat/setId: "+ newDeviceId);
    }
Beispiel #2
0
    void PublishMsg()
    {
        string message   = "222";
        string subTopic1 = "janfiess/anim";

        MQTTBehaviour.Publish(subTopic1, message);
        print("Message published: " + message);
    }
Beispiel #3
0
    void PublishMsg()
    {
        string message   = "huhu";
        string subTopic1 = "mySubtopic1";

        MQTTBehaviour.Publish(subTopic1, message);
        print("Message published: " + message);
    }
Beispiel #4
0
    // when the button Set ID/"Set SSID, PW, Broker IP" is pressed
    public void OnSetupBroker()
    {
        string ssid           = (input_ssid.text == "") ?           input_ssid.placeholder.GetComponent <Text>().text :           input_ssid.text;
        string pw             = (input_pw.text == "") ?             input_pw.placeholder.GetComponent <Text>().text :             input_pw.text;
        string brokerSettings = (input_brokerSettings.text == "") ? input_brokerSettings.placeholder.GetComponent <Text>().text : input_brokerSettings.text;

        MQTTBehaviour.Publish("hat/ssid", ssid);
        MQTTBehaviour.Publish("hat/pw", pw);
        MQTTBehaviour.Publish("hat/broker", brokerSettings);
        // print(mqttAddress + "   |   " + ssid + "   |   " + pw + "   |   " + brokerSettings);
    }
 public static void Publish(string p_topic, string p_txt)
 {
     MQTTBehaviour.Publish(p_topic, p_txt, MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE, false);
 }
Beispiel #6
0
 /*
  * When the anim button "ALL HATS" is pressed
  */
 public void OnAnim_AllHats(string msg)
 {
     MQTTBehaviour.Publish("hat/all", msg);
 }
Beispiel #7
0
    // ORANGE constant solid (called via buttons)
    public void OnAnim_1Hat_orange(InputField input_deviceId)
    {
        string deviceId = (input_deviceId.text == "") ? input_deviceId.placeholder.GetComponent <Text>().text : input_deviceId.text;

        MQTTBehaviour.Publish("hat/" + deviceId, "a5", MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE, true);
    }