Merge pull request #70 from FlorianLudwig/patch-1

enable code highlighting for JS in readme
This commit is contained in:
Verkehrsrot authored and GitHub committed 2018-06-05 09:17:56 +02:00
commit 405070b5a7
1 file changed
+8 -4
+8 -4
View File
@@ -116,24 +116,28 @@ If you're using [TheThingsNetwork](https://www.thethingsnetwork.org/) you may wa
Decoder: Decoder:
function Decoder(bytes, port) { ```javascript
function Decoder(bytes, port) {
var decoded = {}; var decoded = {};
if (port === 1) { if (port === 1) {
decoded.wifi = (bytes[0] << 8) | bytes[1]; decoded.wifi = (bytes[0] << 8) | bytes[1];
decoded.ble = (bytes[2] << 8) | bytes[3]; decoded.ble = (bytes[2] << 8) | bytes[3];
} }
return decoded; return decoded;
} }
```
Converter: Converter:
function Converter(decoded, port) { ```javascript
function Converter(decoded, port) {
var converted = decoded; var converted = decoded;
if (port === 1) { if (port === 1) {
converted.pax = converted.ble + converted.wifi; converted.pax = converted.ble + converted.wifi;
} }
return converted; return converted;
} }
```
# Remote command set # Remote command set