Pase this code in codec section of device profile
Credit: https://www.thethingsnetwork.org/forum/t/laird-rs1xx-payload-format/19313/10
Now that you have created hero file with hero function inside it, let me tell you the main goal of all this:
- Its for you to understand how arguments work.
- Its for you to understand how to make the help command you were talking about.
- Its for you to understand how importing and exporting in JS work and the meaning of it.
What we are trying to achieve here is:
- Set an argument to trigger your
hero
function/file (I believe you know the meaning of argument by now). - Use the
hero
function/file to send a message in discord.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def convert_to_caesar(): | |
sentence = input('Enter your sentence to be encrypted:').upper().replace('.', 'X').replace(' ', '') | |
shift = int(input('Enter the shift value (integers only):')) | |
encrypt = "" | |
# basic algorithm | |
# c = (x + n) % 26 | |
# Where c is the encoded character, x is the actual character, and n is the number of positions we want to shift the character x by. We’re taking mod with 26 because there are 26 letters in the English alphabet. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Decoder(request) { | |
var payload = JSON.parse(request.body); | |
var sensor_data; | |
//refer page 3 for Lightricity data types and assigned numbers | |
var Lightricity_data = [ | |
'Vendor ID', //0 | |
'Sensor ID', | |
'Beacon Counter', | |
'MAC Address', | |
'TX Power', |