Commit bff497f3 authored by Pablo Viñals's avatar Pablo Viñals
Browse files

Correccions MQTT

parent 67cc3d8b
...@@ -124,3 +124,23 @@ class AppSession(ApplicationSession): ...@@ -124,3 +124,23 @@ class AppSession(ApplicationSession):
self.log.info("Subscribed to topic 'com.channel.event'") self.log.info("Subscribed to topic 'com.channel.event'")
@inlineCallbacks
def onJoin(self, details):
self.log.info("Connection details: {details}", details=details)
def printParams(topic, args, kwargs):
self.log.info("Args and kwargs for {topic}:", topic = topic)
self.log.info("args received: {msg}", msg=args)
self.log.info("kwargs received: {msg}", msg=kwargs)
## Resgistration to topic onEvent
##
def onEvent(*args, **kwargs):
printParams("com.channel.event", args, kwargs)
sub = yield self.subscribe(onEvent, u'com.mqtt.event')
self.log.info("Subscribed to topic 'com.mqtt.event'")
-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEA5fOjZbCoTfapQ+QsHq1JgB6noin9R1J8NcsCCEf+0IMA48+2
DqYQD1Dxnq6exn/qAYS3Vd2sM5LZ3R29O0svJmmG48MKgAZvcBg0FxMLQaj6esfF
tTwsTxFGwTyE4r1HDCSVPqUY7vTJ/lz+z20HPghtXTIEYQ9gPfNx7SdU/J6ryJOJ
OyfLaO7dpzmJiXnA1pxGwon3H0Eq8o1jWApy3cvGDnFAgQVOw6wC4x9qJLOkXjPg
anmr0osHeGy/eomStAzngjMcgrV2TS3EASMhCw+wJECG6gSSlO/bRryZLYrLvgJN
rqwO/2D51Vfy6j9XWOkbTtZoQ7+8Pka9kHVBQ1QZuoK6Ia8981TP+4WbfBcnYN1T
jUTYCAhTGttVA3MUEF8r8bvymO3KlOkBFvQmXAcu4zV+nSQ4xxzj3cDvXtzsxodq
+9dhNOo7ZkaTV+0EbKYahN95qQHJzVcW0kUfotBw6pI1I8aVdDFcAVSeFrxMc+tr
3n/2GadcxA+koFet96IYOe4BAYBmb8GPykZ64oUpo2i9EBvssVYQAt06mSnYuX8A
fXBqpsuhPHxMBEi4K+NwmkkA7GJzLSXM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tniZmasSPKhilE/6gKoTPELxnF8q2QoyfNsm+YgF6VKzHKGo3wIdQBww== pvinals94@gmail.com
...@@ -24,9 +24,9 @@ var request = require('request'); ...@@ -24,9 +24,9 @@ var request = require('request');
//); //);
request.post( request.post(
'http://127.0.0.1:8082/call', { '"http://ewecrossbar.cluster.gsi.dit.upm.es/call"', {
json: { json: {
procedure: 'com.channel.telegram', procedure: 'com.channel.event',
args: ["Hello", "args"], args: ["Hello", "args"],
kwargs: {"text":"hello text", kwargs: {"text":"hello text",
"user": "pablo", "user": "pablo",
...@@ -34,8 +34,6 @@ request.post( ...@@ -34,8 +34,6 @@ request.post(
} }
}, },
function (error, response, body) { function (error, response, body) {
console.log("Testing http://127.0.0.1:8082/call")
console.log("This is tester for bluetooth")
console.log(JSON.stringify(body.args[0], null, 2)); console.log(JSON.stringify(body.args[0], null, 2));
//console.log(response); //console.log(response);
if (!error && response.statusCode == 200) { if (!error && response.statusCode == 200) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment