summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Eefting <edwin@datux.nl>2011-08-12 23:15:06 (GMT)
committer Edwin Eefting <edwin@datux.nl>2011-08-12 23:15:06 (GMT)
commit731739e06725edd0d3f56506a1727b210d9f4a62 (patch)
tree88def8084d06889c0481c6dc8070fb2aca463cda
parentd307f57ea6e8311c8e143bd3342dac55b022cffd (diff)
it works w00t
-rw-r--r--modules/dmx.module/module.cpp18
-rw-r--r--wwwdir/dmx.html18
2 files changed, 31 insertions, 5 deletions
diff --git a/modules/dmx.module/module.cpp b/modules/dmx.module/module.cpp
index 056b26d..cb80ac9 100644
--- a/modules/dmx.module/module.cpp
+++ b/modules/dmx.module/module.cpp
@@ -57,8 +57,9 @@ SYNAPSE_REGISTER(module_Init)
out.clear();
out.event="dmx_Connect";
out["id"]=1;
- out["host"]="localhost";
- out["port"]=7777;
+ out["host"]="192.168.14.77";
+// out["host"]="localhost";
+ out["port"]=777;
out.send();
@@ -79,6 +80,10 @@ class CnetDmx : public synapse::Cnet
out.dst=id;
out.event="dmx_Connected";
out.send();
+
+ //password
+ string s("777\n\r");
+ doWrite(s);
}
void received(int id, asio::streambuf &readBuffer, std::size_t bytesTransferred)
@@ -132,6 +137,15 @@ class CnetDmx : public synapse::Cnet
out.send();
}
+// void startAsyncRead()
+// {
+// asio::async_read_until(
+// tcpSocket,
+// readBuffer,
+// boost::regex("a"),
+// bind(&Cnet::readHandler, this, _1, _2)
+// );
+// }
};
diff --git a/wwwdir/dmx.html b/wwwdir/dmx.html
index 6448f04..87f1824 100644
--- a/wwwdir/dmx.html
+++ b/wwwdir/dmx.html
@@ -42,27 +42,39 @@
ui.value
send(0,"dmx_Set",{
id:1,
- channel:5,
+ channel:$(this).attr('_channel'),
value:ui.value
});
}
});
+
+ synapse_register("dmx_Set",function(msg_src, msg_dst, msg_event, msg)
+ {
+ $("[_channel="+msg["channel"]+"]").slider("option", "value", msg["value"]);
+ });
+
});
</script>
<style>
-
+ .slider{
+ float:left;
+ margin:2em;
+ }
</style>
</head>
<body>
-<div class='slider'></div>
+<div class='slider' _channel='5'>red</div>
+<div class='slider' _channel='7'>green</div>
+<div class='slider' _channel='6'>white</div>
+<div class='slider' _channel='8'>blue</div>
</body>
</html>