This file contains hidden or 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
<!doctype html> | |
<html lang='en'> | |
<head> | |
<title></title> | |
<link href='https://cdn.jsdelivr.net/npm/mapbox-gl@1/dist/mapbox-gl.css' rel='stylesheet'> | |
<script src='https://cdn.jsdelivr.net/npm/mapbox-gl@1'></script> | |
</head> | |
<body> | |
<div id='map' style='width: 2304px; height: 1728px;'></div> | |
<script> |
This file contains hidden or 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 processUSB(type, details) { | |
// Function called in response to a USB bus event | |
switch (type) { | |
case USB_DEVICE_CONNECTED: | |
local descriptors = details.descriptors; | |
server.log("USB device " + descriptors.product + " connected at speed " + details.speed + "Mbps"); | |
server.log(format("USB = 0x%04x", descriptors.usb)); | |
server.log(format("class = 0x%02x", descriptors["class"])); | |
server.log(format("subclass = 0x%02x", descriptors.subclass)); | |
server.log(format("protocol = 0x%02x", descriptors.protocol)); |
This file contains hidden or 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
//Two Different methods of calculating Modbus's CRC16 | |
//You can use http://www.lammertbies.nl/comm/info/crc-calculation.html to verify the calculation. Change Input Mode to Hex and input the string "0103" This is for Modbus CRC's. | |
imp.configure ("CRC Calculation", [], []); | |
server.log("============ PROGRAM START =============") | |
/******************************************************************************* | |
HELPER FUNCTIONS | |
*******************************************************************************/ | |
function byteArrayString(arr){ | |
local str = "" |