====== Tyness ====== TTN === function decodeUplink(input) { return { data: { etatFeux : input.bytes[10]*256+input.bytes[9], compteurCycles : (input.bytes[14]*256+input.bytes[13])*10000+(input.bytes[12]*256+input.bytes[11]), }, warnings: [], errors: [] }; } allthingstalk ============= function converter(code) { function hexToBytes(hex) { for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16)); return bytes; } function DecodeTynessTwidoFeux(data) { var obj = new Object(); var etatFeux=data[10]*256+data[9]; obj.etatFeux={value: etatFeux}; var compteurCycles=(data[14]*256+data[13])*10000+data[12]*256+data[11]; obj.compteurCycles={value: compteurCycles}; return obj; } return JSON.stringify(DecodeTynessTwidoFeux(hexToBytes(code))); } === NKE === TTN === function decodeUplink(input) { return { data: { etatFeux : input.bytes[11]*256+input.bytes[12], compteurCycles : (input.bytes[15]*256+input.bytes[16])*10000+(input.bytes[13]*256+input.bytes[14]), }, warnings: [], errors: [] }; } allthingstalk ============= function converter(code) { function hexToBytes(hex) { for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16)); return bytes; } function DecodeTynessTwidoFeux(data) { var obj = new Object(); var etatFeux=data[11]*256+data[12]; obj.etatFeux={value: etatFeux}; var compteurCycles=(data[15]*256+data[16])*10000+data[13]*256+data[14]; obj.compteurCycles={value: compteurCycles}; return obj; } return JSON.stringify(DecodeTynessTwidoFeux(hexToBytes(code))); }