HEADS-project / training

Training material to get started with the HEADS technologies
10 stars 16 forks source link

JS Code generator issue? #74

Closed kehusa closed 9 years ago

kehusa commented 9 years ago

Having problems with receiving messages via Kevoree Channels, I went on to Javascript debugging. I discovered that when changing: SensorServer.prototype.receivereadingOnsensor_service = function(value) { this._receive('{"message":"reading","port":"sensor_service_c", "value":' + value + '}'); } to (changing _c suffix to _s suffix on port name): SensorServer.prototype.receivereadingOnsensor_service = function(value) { this._receive('{"message":"reading","port":"sensor_service_s", "value":' + value + '}'); } messages got through. This seems reasonable since the state was initialized as: var t1 = StateFactory.buildTransition(SensorServer_Server_reading, null, function (s, c) {var json = JSON.parse(c); return json.port === "sensor_service_s" && json.message === "reading"}).

Is this is a bug or is it caused by something in my code?

brice-morin commented 9 years ago

Yes, probably a bug. I think Steffen had the same issue with the ThingML2Kevoree/Java. I will fix that and make sure connectors work in standalone mode (only ThingML) and also in Kevoree.

brice-morin commented 9 years ago

OK, you can update your HEADS IDE and it should be fixed.