Skip to content

Instantly share code, notes, and snippets.


ThomasPe/app.js Secret

Created September 8, 2020 08:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
IdentityTranslationModule message pipe
// Act on input messages to the module.
moduleClient.on('inputMessage', function (inputName, msg) {
console.log("new message received", msg);
if (simulatedTemperatureClient) {
// Identity Translation configured, wrap message fro IoT device
const message = msg.getBytes().toString('utf8');
const sensorMsg = new Message(message);
} else {
// No Identity Translation configured, send message through module
pipeMessage(moduleClient, inputName, msg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment