瀏覽代碼

Updated DataBroker

Marcel Zickler 3 年之前
父節點
當前提交
fd54e674d3

+ 0 - 1
.idea/.idea.VR Cycling/.idea/indexLayout.xml

@@ -42,7 +42,6 @@
       <Path>Integrations</Path>
       <Path>Library</Path>
       <Path>Logs</Path>
-      <Path>Temp</Path>
       <Path>UserSettings</Path>
       <Path>obj</Path>
     </explicitExcludes>

+ 6 - 5
Assets/Scripts/SicknessReduction/Haptic/DataBroker.cs

@@ -16,18 +16,18 @@ namespace SicknessReduction.Haptic
         {
             server = new MqttFactory().CreateMqttServer();
             var service = new ServiceProfile("blabla", "_mqtt._tcp", 1883,
-                new[] {new IPAddress(new[] {(byte) 192, (byte) 168, (byte) 1, (byte) 4})});
+                new[] {new IPAddress(new[] {(byte) 192, (byte) 168, (byte) 1, (byte) 7})});
             var sd = new ServiceDiscovery();
             sd.Advertise(service);
             await server.StartAsync(new MqttServerOptions());
             Debug.Log("Mqtt Server started");
-            await PublishBla();
+            //await PublishBla();
         }
 
         public async Task PublishBla()
         {
-            await server.PublishAsync(new MqttApplicationMessageBuilder().WithTopic("Test/Bla")
-                .WithPayload("Hallihallo").Build());
+            await server.PublishAsync(new MqttApplicationMessageBuilder().WithTopic("Fan/0/Control")
+                .WithPayload("Hallihallo\0").Build());
         }
 
         private async void Update()
@@ -36,7 +36,8 @@ namespace SicknessReduction.Haptic
             if (dif > 4f)
             {
                 lastTime = Time.time;
-                await PublishBla();
+                //TODO: publish proper data
+                //await PublishBla();
             }
         }