function copyTextToClipboard(text) {
var textArea = document.createElement("textarea");
//
// *** This styling is an extra step which is likely not required. ***
//
// Why is it here? To ensure:
// 1. the element is able to have focus and selection.
// 2. if element was to flash render it has minimal visual impact.
// 3. less flakyness with selection and copying which **might** occur if
// the textarea element is not visible.
//
// The likelihood is the element won't even render, not even a flash,
// so some of these are just precautions. However in IE the element
// is visible whilst the popup box asking the user for permission for
// the web page to copy to the clipboard.
//
// Place in top-left corner of screen regardless of scroll position.
textArea.style.position = 'fixed';
textArea.style.top = 0;
textArea.style.left = 0;
// Ensure it has a small width and height. Setting to 1px / 1em
// doesn't work as this gives a negative w/h on some browsers.
textArea.style.width = '2em';
textArea.style.height = '2em';
// We don't need padding, reducing the size if it does flash render.
textArea.style.padding = 0;
// Clean up any borders.
textArea.style.border = 'none';
textArea.style.outline = 'none';
textArea.style.boxShadow = 'none';
// Avoid flash of white box if rendered for any reason.
textArea.style.background = 'transparent';
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Copying text command was ' + msg);
} catch (err) {
console.log('Oops, unable to copy');
}
document.body.removeChild(textArea);
}
var types = {
"presentation":[
"S_DOOR",
"S_MOTION",
"S_SMOKE",
"S_BINARY",
"S_DIMMER",
"S_COVER",
"S_TEMP",
"S_HUM",
"S_BARO",
"S_WIND",
"S_RAIN",
"S_UV",
"S_WEIGHT",
"S_POWER",
"S_HEATER",
"S_DISTANCE",
"S_LIGHT_LEVEL",
"S_ARDUINO_NODE",
"S_ARDUINO_REPEATER_NODE",
"S_LOCK",
"S_IR",
"S_WATER",
"S_AIR_QUALITY",
"S_CUSTOM",
"S_DUST",
"S_SCENE_CONTROLLER",
"S_RGB_LIGHT",
"S_RGBW_LIGHT",
"S_COLOR_SENSOR",
"S_HVAC",
"S_MULTIMETER",
"S_SPRINKLER",
"S_WATER_LEAK",
"S_SOUND",
"S_VIBRATION",
"S_MOISTURE",
"S_INFO",
"S_GAS",
"S_GPS",
"S_WATER_QUALITY"
],
"internal": [
"I_BATTERY_LEVEL",
"I_TIME",
"I_VERSION",
"I_ID_REQUEST",
"I_ID_RESPONSE",
"I_INCLUSION_MODE",
"I_CONFIG",
"I_FIND_PARENT_REQUEST",
"I_FIND_PARENT_RESPONSE",
"I_LOG_MESSAGE",
"I_CHILDREN",
"I_SKETCH_NAME",
"I_SKETCH_VERSION",
"I_REBOOT",
"I_GATEWAY_READY",
"I_SIGNING_PRESENTATION",
"I_NONCE_REQUEST",
"I_NONCE_RESPONSE",
"I_HEARTBEAT_REQUEST",
"I_PRESENTATION",
"I_DISCOVER_REQUEST",
"I_DISCOVER_RESPONSE",
"I_HEARTBEAT_RESPONSE",
"I_LOCKED",
"I_PING",
"I_PONG",
"I_REGISTRATION_REQUEST",
"I_REGISTRATION_RESPONSE",
"I_DEBUG",
"I_SIGNAL_REPORT_REQUEST",
"I_SIGNAL_REPORT_REVERSE",
"I_SIGNAL_REPORT_RESPONSE",
"I_PRE_SLEEP_NOTIFICATION",
"I_POST_SLEEP_NOTIFICATION"
],
"subtype":[
"V_TEMP",
"V_HUM",
"V_STATUS",
"V_PERCENTAGE",
"V_PRESSURE",
"V_FORECAST",
"V_RAIN",
"V_RAINRATE",
"V_WIND",
"V_GUST",
"V_DIRECTION",
"V_UV",
"V_WEIGHT",
"V_DISTANCE",
"V_IMPEDANCE",
"V_ARMED",
"V_TRIPPED",
"V_WATT",
"V_KWH",
"V_SCENE_ON",
"V_SCENE_OFF",
"V_HVAC_FLOW_STATE",
"V_HVAC_SPEED",
"V_LIGHT_LEVEL",
"V_VAR1",
"V_VAR2",
"V_VAR3",
"V_VAR4",
"V_VAR5",
"V_UP",
"V_DOWN",
"V_STOP",
"V_IR_SEND",
"V_IR_RECEIVE",
"V_FLOW",
"V_VOLUME",
"V_LOCK_STATUS",
"V_LEVEL",
"V_VOLTAGE",
"V_CURRENT",
"V_RGB",
"V_RGBW",
"V_ID",
"V_UNIT_PREFIX",
"V_HVAC_SETPOINT_COOL",
"V_HVAC_SETPOINT_HEAT",
"V_HVAC_FLOW_MODE",
"V_TEXT",
"V_CUSTOM",
"V_POSITION",
"V_IR_RECORD",
"V_PH",
"V_ORP",
"V_EC",
"V_VAR",
"V_VA",
"V_POWER_FACTOR"
],
"stream":[
"ST_FIRMWARE_CONFIG_REQUEST",
"ST_FIRMWARE_CONFIG_RESPONSE",
"ST_FIRMWARE_REQUEST",
"ST_FIRMWARE_RESPONSE",
"ST_SOUND",
"ST_IMAGE"],
command: [
"PRESENTATION",
"SET",
"REQ",
"INTERNAL",
"STREAM"
],
"payloadtype":[
"P_STRING",
"P_BYTE",
"P_INT16",
"P_UINT16",
"P_LONG32",
"P_ULONG32",
"P_CUSTOM",
"P_FLOAT32"
]};
//mysgw: Client 0: 0;0;3;0;18;PING
var rprefix = "(?:\\d+ )?(?:mysgw: )?(?:Client 0: )?";
var match = [
{ re: "MCO:BGN:INIT CP=([^,]+)", d: "Core initialization with capabilities $1" },
{ re: "MCO:BGN:INIT (\\w+),CP=([^,]+),VER=(.*)", d: "Core initialization of $1, with capabilities $2, library version $3" },
{ re: "MCO:BGN:INIT (\\w+),CP=([^,]+),REL=(.*),VER=(.*)", d: "Core initialization of $1, with capabilities $2, library version $4, release $3" },
{ re: "MCO:BGN:INIT (\\w+),CP=([^,]+),FQ=(\\d+),REL=(.*),VER=(.*)", d: "Core initialization of $1, with capabilities $2, CPU frequency $4 MHz, library version $5, release $4" },
{ re: "MCO:BGN:BFR", d: "Callback before()" },
{ re: "MCO:BGN:STP", d: "Callback setup()" },
{ re: "MCO:BGN:INIT OK,TSP=(.*)", d: "Core initialized, transport status $1, (1=initialized, 0=not initialized, NA=not available)" },
{ re: "MCO:BGN:NODE UNLOCKED", d: "Node successfully unlocked (see signing chapter)" },
{ re: "!MCO:BGN:TSP FAIL", d: "Transport initialization failed" },
{ re: "MCO:REG:REQ", d: "Registration request" },
{ re: "MCO:REG:NOT NEEDED", d: "No registration needed (i.e. GW)" },
{ re: "!MCO:SND:NODE NOT REG", d: "Node is not registered, cannot send message" },
{ re: "MCO:PIM:NODE REG=(\\d+)", d: "Registration response received, registration status $1" },
{ re: "MCO:PIM:ROUTE N=(\\d+),R=(\\d+)", d: "Routing table, messages to node $1 are routed via node $2" },
{ re: "MCO:SLP:MS=(\\d+),SMS=(\\d+),I1=(\\d+),M1=(\\d+),I2=(\\d+),M2=(\\d+)", d: "Sleep node, duration $1 ms, SmartSleep=$2, Int1=$3, Mode1=$4, Int2=$5, Mode2=$6" },
{ re: "MCO:SLP:MS=(\\d+)", d: "Sleep node, duration $1 ms" },
{ re: "MCO:SLP:TPD", d: "Sleep node, powerdown transport" },
{ re: "MCO:SLP:WUP=(-?\\d+)", d: "Node woke-up, reason/IRQ=$1 (-2=not possible, -1=timer, >=0 IRQ)" },
{ re: "!MCO:SLP:FWUPD", d: "Sleeping not possible, FW update ongoing" },
{ re: "!MCO:SLP:REP", d: "Sleeping not possible, repeater feature enabled" },
{ re: "!MCO:SLP:TNR", d: " Transport not ready, attempt to reconnect until timeout" },
{ re: "MCO:NLK:NODE LOCKED. UNLOCK: GND PIN (\\d+) AND RESET", d: "Node locked during booting, see signing documentation for additional information" },
{ re: "MCO:NLK:TPD", d: "Powerdown transport" },
{ re: "TSM:INIT", d: "Transition to Init state" },
{ re: "TSM:INIT:STATID=(\\d+)", d: "Init static node id $1" },
{ re: "TSM:INIT:TSP OK", d: "Transport device configured and fully operational" },
{ re: "TSM:INIT:GW MODE", d: "Node is set up as GW, thus omitting ID and findParent states" },
{ re: "!TSM:INIT:TSP FAIL", d: "Transport device initialization failed" },
{ re: "TSM:FPAR", d: "Transition to Find Parent state" },
{ re: "TSM:FPAR:STATP=(\\d+)", d: "Static parent $1 has been set, skip finding parent" },
{ re: "TSM:FPAR:OK", d: "Parent node identified" },
{ re: "!TSM:FPAR:NO REPLY", d: "No potential parents replied to find parent request" },
{ re: "!TSM:FPAR:FAIL", d: "Finding parent failed" },
{ re: "TSM:ID", d: "Transition to Request Id state" },
{ re: "TSM:ID:OK,ID=(\\d+)", d: "Node id $1 is valid" },
{ re: "TSM:ID:REQ", d: "Request node id from controller" },
{ re: "!TSM:ID:FAIL", d: "Did not receive a node id from controller. Is your controller connected and correctly configured?" },
{ re: "!TSM:ID:FAIL,ID=(\\d+)", d: "Id verification failed, $1 is invalid" },
{ re: "TSM:UPL", d: "Transition to Check Uplink state" },
{ re: "TSM:UPL:OK", d: "Uplink OK, GW returned ping" },
{ re: "!TSM:UPL:FAIL", d: "Uplink check failed, i.e. GW could not be pinged" },
{ re: "TSM:READY:NWD REQ", d: "Send transport network discovery request" },
{ re: "TSM:READY:SRT", d: "Save routing table" },
{ re: "TSM:READY:ID=(\\d+),PAR=(\\d+),DIS=(\\d+)", d: "Transport ready, node id $1, parent node id $2, distance to GW is $3" },
{ re: "!TSM:READY:UPL FAIL,SNP", d: "Too many failed uplink transmissions, search new parent" },
{ re: "!TSM:READY:FAIL,STATP", d: "Too many failed uplink transmissions, static parent enforced" },
{ re: "TSM:READY", d: "Transition to Ready state" },
{ re: "TSM:FAIL:DIS", d: "Disable transport" },
{ re: "TSM:FAIL:CNT=(\\d+)", d: "Transition to Failure state, consecutive failure counter is $1" },
{ re: "TSM:FAIL:PDT", d: "Power-down transport" },
{ re: "TSM:FAIL:RE-INIT", d: "Attempt to re-initialize transport" },
{ re: "TSF:CKU:OK,FCTRL", d: "Uplink OK, flood control prevents pinging GW in too short intervals" },
{ re: "TSF:CKU:OK", d: "Uplink OK" },
{ re: "TSF:CKU:DGWC,O=(\\d+),N=(\\d+)", d: "Uplink check revealed changed network topology, old distance $1, new distance $2" },
{ re: "TSF:CKU:FAIL", d: "No reply received when checking uplink" },
{ re: "TSF:SID:OK,ID=(\\d+)", d: "Node id $1 assigned" },
{ re: "!TSF:SID:FAIL,ID=(\\d+)", d: "Assigned id $1 is invalid" },
{ re: "TSF:PNG:SEND,TO=(\\d+)", d: "Send ping to destination $1" },
{ re: "!TSF:PNG:ACTIVE", d: "Ping active, cannot start new ping" },
{ re: "TSF:WUR:MS=(\\d+)", d: "Wait until transport ready, timeout $1" },
{ re: "TSF:MSG:ECHO REQ", d: "ECHO message requested" },
{ re: "TSF:MSG:ECHO", d: "ECHO message, do not proceed but forward to callback" },
{ re: "TSF:MSG:FPAR RES,ID=(\\d+),D=(\\d+)", d: "Response to find parent request received from node $1 with distance $2 to GW" },
{ re: "TSF:MSG:FPAR PREF FOUND", d: "Preferred parent found, i.e. parent defined via MY_PARENT_NODE_ID" },
{ re: "TSF:MSG:FPAR OK,ID=(\\d+),D=(\\d+)", d: "Find parent response from node $1 is valid, distance $2 to GW" },
{ re: "!TSF:MSG:FPAR INACTIVE", d: "Find parent response received, but no find parent request active, skip response" },
{ re: "TSF:MSG:FPAR REQ,ID=(\\d+)", d: "Find parent request from node $1" },
{ re: "TSF:MSG:PINGED,ID=(\\d+),HP=(\\d+)", d: "Node pinged by node $1 with $2 hops" },
{ re: "TSF:MSG:PONG RECV,HP=(\\d+)", d: "Pinged node replied with $1 hops" },
{ re: "!TSF:MSG:PONG RECV,INACTIVE", d: "Pong received, but !pingActive" },
{ re: "TSF:MSG:BC", d: "Broadcast message received" },
{ re: "TSF:MSG:GWL OK", d: "Link to GW ok" },
{ re: "TSF:MSG:FWD BC MSG", d: "Controlled broadcast message forwarding" },
{ re: "TSF:MSG:REL MSG", d: "Relay message" },
{ re: "TSF:MSG:REL PxNG,HP=(\\d+)", d: "Relay PING/PONG message, increment hop counter to $1" },
{ re: "!TSF:MSG:LEN,(\\d+)!=(\\d+)", d: "Invalid message length, $1 (actual) != $2 (expected)" },
{ re: "!TSF:MSG:PVER,(\\d+)!=(\\d+)", d: "Message protocol version mismatch, $1 (actual) != $2 (expected)" },
{ re: "!TSF:MSG:SIGN VERIFY FAIL", d: "Signing verification failed" },
{ re: "!TSF:MSG:REL MSG,NORP", d: "Node received a message for relaying, but node is not a repeater, message skipped" },
{ re: "!TSF:MSG:SIGN FAIL", d: "Signing message failed" },
{ re: "!TSF:MSG:GWL FAIL", d: "GW uplink failed" },
{ re: "!TSF:MSG:ID TK INVALID", d: "Token for ID request invalid" },
{ re: "TSF:SAN:OK", d: "Sanity check passed" },
{ re: "!TSF:SAN:FAIL", d: "Sanity check failed, attempt to re-initialize radio" },
{ re: "TSF:CRT:OK", d: "Clearing routing table successful" },
{ re: "TSF:LRT:OK", d: "Loading routing table successful" },
{ re: "TSF:SRT:OK", d: "Saving routing table successful" },
{ re: "!TSF:RTE:FPAR ACTIVE", d: "Finding parent active, message not sent" },
{ re: "!TSF:RTE:DST (\\d+) UNKNOWN", d: "Routing for destination $1 unknown, sending message to parent" },
{ re: "!TSF:RTE:N2N FAIL", d: "Direct node-to-node communication failed - handing over to parent" },
{ re: "TSF:RRT:ROUTE N=(\\d+),R=(\\d+)", d: "Routing table, messages to node ($1) are routed via node ($2)"},
{ re: "!TSF:SND:TNR", d: "Transport not ready, message cannot be sent" },
{ re: "TSF:TDI:TSL", d: "Set transport to sleep" },
{ re: "TSF:TDI:TPD", d: "Power down transport" },
{ re: "TSF:TRI:TRI", d: "Reinitialise transport" },
{ re: "TSF:TRI:TSB", d: "Set transport to standby" },
{ re: "TSF:TRI:TPU", d: "Power up transport" },
{ re: "TSF:SIR:CMD=(\\d+),VAL=(\\d+)", d: "Get signal report $1, value: $2" },
{ re: "TSF:MSG:READ,(\\d+)-(\\d+)-(\\d+),s=(\\d+),c=(\\d+),t=(\\d+),pt=(\\d+),l=(\\d+),sg=(\\d+):(.*)", d: "Received Message
Sender: $1
Last Node: $2
Destination: $3
Sensor Id: $4
Command: {command:$5}
Message Type: {type:$5:$6}
Payload Type: {pt:$7}
Payload Length: $8
Signing: $9
Payload: $10" },
{ re: "TSF:MSG:SEND,(\\d+)-(\\d+)-(\\d+)-(\\d+),s=(\\d+),c=(\\d+),t=(\\d+),pt=(\\d+),l=(\\d+),sg=(\\d+),ft=(\\d+),st=(\\w+):(.*)", d: "Sent Message
Sender: $1
Last Node: $2
Next Node: $3
Destination: $4
Sensor Id: $5
Command: {command:$6}
Message Type:{type:$6:$7}
Payload Type: {pt:$8}
Payload Length: $9
Signing: $10
Failed uplink counter: $11
Status: $12 (OK=success, NACK=no radio ACK received)
Payload: $13" },
{ re: "!TSF:MSG:SEND,(\\d+)-(\\d+)-(\\d+)-(\\d+),s=(\\d+),c=(\\d+),t=(\\d+),pt=(\\d+),l=(\\d+),sg=(\\d+),ft=(\\d+),st=(\\w+):(.*)", d: "Sent Message
Sender: $1
Last Node: $2
Next Node: $3
Destination: $4
Sensor Id: $5
Command: {command:$6}
Message Type:{type:$6:$7}
Payload Type: {pt:$8}
Payload Length: $9
Signing: $10
Failed uplink counter: $11
Status: $12 (OK=success, NACK=no radio ACK received)
Payload: $13" },
{ re: "\\?TSF:MSG:SEND,(\\d+)-(\\d+)-(\\d+)-(\\d+),s=(\\d+),c=(\\d+),t=(\\d+),pt=(\\d+),l=(\\d+),sg=(\\d+),ft=(\\d+),st=(\\w+):(.*)", d: "Sent Message without radio ACK
Sender: $1
Last Node: $2
Next Node: $3
Destination: $4
Sensor Id: $5
Command: {command:$6}
Message Type:{type:$6:$7}
Payload Type: {pt:$8}
Payload Length: $9
Signing: $10
Failed uplink counter: $11
Status: $12 (OK=success, NACK=no radio ACK received)
Payload: $13" },
// transport HAL
{ re: "THA:INIT", d: "Initialise transport HAL" },
{ re: "THA:INIT:PSK=(.*)", d: "Initialise transport HAL, PSK=$1" },
{ re: "THA:SAD:ADDR=(\\d+)", d: "Set transport address: $1" },
{ re: "THA:GAD:ADDR=(\\d+)", d: "Get transport address: $1" },
{ re: "THA:DATA:AVAIL", d: "Transport HAL received data" },
{ re: "THA:SAN:RES=(\\d+)", d: "Transport sanity check, result=$1 (0=NOK, 1=OK)" },
{ re: "THA:RCV:MSG=(.*)", d: "Message received: $1" },
{ re: "THA:RCV:DECRYPT", d: "Decrypt message" },
{ re: "THA:RCV:PLAIN=(.*)", d: "Message plaint text: $1" },
{ re: "!THA:RCV:PVER=(\\d+)", d: "Message protocol version mismatch: $1" },
{ re: "!THA:RCV:LEN=(\\d+),EXP=(\\d+)", d: "Invalid message length, actual $1, expected $2" },
{ re: "THA:RCV:MSG LEN=(\\d+)", d: "Length of received message: $1" },
{ re: "THA:SND:MSG=(.*)", d: "Send message: $1" },
{ re: "THA:SND:ENCRYPT", d: "Encrypt message" },
{ re: "THA:SND:CIP=(.*)", d: "Ciphertext of encrypted message: $1" },
{ re: "THA:SND:MSG LEN=(\\d+),RES=(\\d+)", d: "Sending message with length=$1, result=$2 (0=NOK, 1=OK)" },
// Signing backend
{ re: "SGN:INI:BND OK", d: "Backend has initialized ok" },
{ re: "!SGN:INI:BND FAIL", d: "Backend has not initialized ok" },
{ re: "SGN:PER:OK", d: "Personalization data is ok" },
{ re: "!SGN:PER:TAMPERED", d: "Personalization data has been tampered" },
{ re: "SGN:PRE:SGN REQ", d: "Signing required" },
{ re: "SGN:PRE:SGN REQ,TO=(\\d+)", d: "Tell node $1 that we require signing" },
{ re: "SGN:PRE:SGN REQ,FROM=(\\d+)", d: " Node $1 require signing" },
{ re: "SGN:PRE:SGN NREQ", d: "Signing not required" },
{ re: "SGN:PRE:SGN REQ,TO=(\\d+)", d: "Tell node $1 that we do not require signing" },
{ re: "SGN:PRE:SGN NREQ,FROM=(\\d+)", d: "Node $1 does not require signing" },
{ re: "!SGN:PRE:SGN NREQ,FROM=(\\d+) REJ", d: "Node $1 does not require signing but used to (requirement remain unchanged)" },
{ re: "SGN:PRE:WHI REQ", d: "Whitelisting required" },
{ re: "SGN:PRE:WHI REQ;TO=(\\d+)", d: "Tell $1 that we require whitelisting" },
{ re: "SGN:PRE:WHI REQ,FROM=(\\d+)", d: "Node $1 require whitelisting" },
{ re: "SGN:PRE:WHI NREQ", d: " Whitelisting not required" },
{ re: "SGN:PRE:WHI NREQ,TO=(\\d+)", d: "Tell node $1 that we do not require whitelisting" },
{ re: "SGN:PRE:WHI NREQ,FROM=(\\d+)", d: "Node $1 does not require whitelisting" },
{ re: "!SGN:PRE:WHI NREQ,FROM=(\\d+) REJ", d: "Node $1 does not require whitelisting but used to (requirement remain unchanged)" },
{ re: "SGN:PRE:XMT,TO=(\\d+)", d: "Presentation data transmitted to node $1" },
{ re: "!SGN:PRE:XMT,TO=(\\d+) FAIL", d: "Presentation data not properly transmitted to node $1" },
{ re: "SGN:PRE:WAIT GW", d: "Waiting for gateway presentation data" },
{ re: "!SGN:PRE:VER=(\\d+)", d: "Presentation version $1 is not supported" },
{ re: "SGN:PRE:NSUP", d: "Received signing presentation but signing is not supported" },
{ re: "SGN:PRE:NSUP,TO=(\\d+)", d: "Informing node $1 that we do not support signing" },
{ re: "SGN:SGN:NCE REQ,TO=(\\d+)", d: "Nonce request transmitted to node $1" },
{ re: "!SGN:SGN:NCE REQ,TO=(\\d+) FAIL", d: "Nonce request not properly transmitted to node $1" },
{ re: "!SGN:SGN:NCE TMO", d: "Timeout waiting for nonce" },
{ re: "SGN:SGN:SGN", d: "Message signed" },
{ re: "!SGN:SGN:SGN FAIL", d: "Message failed to be signed" },
{ re: "SGN:SGN:NREQ=(\\d+)", d: "Node $1 does not require signed messages" },
{ re: "SGN:SGN:(\\d+)!=(\\d+) NUS", d: "Will not sign because $1 is not $2 (repeater)" },
{ re: "!SGN:SGN:STATE", d: "Security system in a invalid state (personalization data tampered)" },
{ re: "!SGN:VER:NSG", d: "Message was not signed, but it should have been" },
{ re: "!SGN:VER:FAIL", d: "Verification failed" },
{ re: "SGN:VER:OK", d: "Verification succeeded" },
{ re: "SGN:VER:LEFT=(\\d+)", d: "$1 number of failed verifications left in a row before node is locked" },
{ re: "!SGN:VER:STATE", d: "Security system in a invalid state (personalization data tampered)" },
{ re: "SGN:SKP:MSG CMD=(\\d+),TYPE=(\\d+)", d: "Message with command $1 and type $2 does not need to be signed" },
{ re: "SGN:SKP:ECHO CMD=(\\d+),TYPE=(\\d+)", d: "ECHO messages do not need to be signed" },
{ re: "SGN:NCE:LEFT=(\\d+)", d: "$1 number of nonce requests between successful verifications left before node is locked" },
{ re: "SGN:NCE:XMT,TO=(\\d+)", d: "Nonce data transmitted to node $1" },
{ re: "!SGN:NCE:XMT,TO=(\\d+) FAIL", d: "Nonce data not properly transmitted to node $1" },
{ re: "!SGN:NCE:GEN", d: "Failed to generate nonce" },
{ re: "SGN:NCE:NSUP (DROPPED)", d: "Ignored nonce/request for nonce (signing not supported)" },
{ re: "SGN:NCE:FROM=(\\d+)", d: "Received nonce from node $1" },
{ re: "SGN:NCE:(\\d+)!=(\\d+) (DROPPED)", d: "Ignoring nonce as it did not come from the desgination of the message to sign" },
{ re: "!SGN:BND:INIT FAIL", d: "Failed to initialize signing backend" },
{ re: "!SGN:BND:PWD<8", d: "Signing password too short" },
{ re: "!SGN:BND:PER", d: "Backend not personalized" },
{ re: "!SGN:BND:SER", d: "Could not get device unique serial from backend" },
{ re: "!SGN:BND:TMR", d: "Backend timed out" },
{ re: "!SGN:BND:SIG,SIZE,(\\d+)>(\\d+)", d: "Refusing to sign message with length $1 because it is bigger than allowed size $2 " },
{ re: "SGN:BND:SIG WHI,ID=(\\d+)", d: "Salting message with our id $1" },
{ re: "SGN:BND:SIG WHI,SERIAL=(.*)", d: "Salting message with our serial $1" },
{ re: "!SGN:BND:VER ONGOING", d: "Verification failed, no ongoing session" },
{ re: "!SGN:BND:VER,IDENT=(\\d+)", d: "Verification failed, identifier $1 is unknown" },
{ re: "SGN:BND:VER WHI,ID=(\\d+)", d: "Id $1 found in whitelist" },
{ re: "SGN:BND:VER WHI,SERIAL=(.*)", d: "Expecting serial $1 for this sender" },
{ re: "!SGN:BND:VER WHI,ID=(\\d+) MISSING", d: "Id $1 not found in whitelist" },
{ re: "SGN:BND:NONCE=(.*)", d: "Calculating signature using nonce $1" },
{ re: "SGN:BND:HMAC=(.*)", d: "Calculated signature is $1" },
// NodeManager
{ re: "NM:INIT:VER=(.*)", d: "NodeManager version $1" },
{ re: "NM:INIT:INO=(.*)", d: "Sketch $1" },
{ re: "NM:INIT:LIB VER=(.+) CP=(.+)", d: "MySensors Library version $1, capabilities $2" },
{ re: "NM:INIT:RBT p=(\\d+)", d: "Configured reboot pin $1" },
{ re: "NM:BFR:INIT", d: "Connecting to the gateway..." },
{ re: "NM:BFR:OK", d: "Connection to the gateway successful" },
{ re: "NM:BFR:INT p=(\\d+) m=(\\d+)", d: "Setting up interrupt on pin $1 with mode $2" },
{ re: "NM:PRES:(\\w+)\\((\\d+)\\) p=(\\d+) t=(\\d+)", d: "Presented to the gateway child $2 for sensor $1 as {type:0:$3} with type {type:1:$4}" },
{ re: "NM:STP:ID=(\\d+) M=(\\d+)", d: "This node has id $1 and metric is set to $2" },
{ re: "NM:STP:SD T=(\\d+)", d: "Connected SD card reader, type $1" },
{ re: "NM:STP:HW V=(\\d+) F=(\\d+) M=(\\d+)", d: "CPU Vcc is $1 mV, CPU frequency $2 Mhz, free memory $3 bytes" },
{ re: "NM:LOOP:(\\w+)\\((\\d+)\\):SET t=(\\d+) v=(.+)", d: "New value for child $2 of sensor $1 with {type:1:$3} = $4" },
{ re: "NM:LOOP:INT p=(\\d+) v=(\\d+)", d: "Interrupt received on pin $1, value $2" },
{ re: "NM:LOOP:INPUT\\.\\.\\.", d: "Waiting for input from the serial port" },
{ re: "NM:LOOP:INPUT v=(.*)", d: "Received an input from the serial port: $1" },
{ re: "NM:TIME:REQ", d: "Requesting the time to the controller" },
{ re: "NM:TIME:OK ts=(\\d+)", d: "Received the time from the controller: $1" },
{ re: "NM:SLP:WKP", d: "Wakeup requested" },
{ re: "NM:SLP:SLEEP s=(\\d+)", d: "Going to sleep for $1 seconds" },
{ re: "NM:SLP:AWAKE", d: "Waking up from sleep" },
{ re: "NM:SLP:LOAD s=(\\d+)", d: "Loaded configured sleep time: $1 seconds" },
{ re: "NM:MSG:SEND\\((\\d+)\\) t=(\\d+) p=(.+)", d: "Child $1 sent {type:1:$2} = $3" },
{ re: "NM:MSG:RECV\\((\\d+)\\) c=(\\d+) t=(\\d+) p=(.+)", d: "Received a {command:$2} message for child $1 with {type:$2:$3} = $4" },
{ re: "NM:PWR:RBT", d: "Rebooting the node as requested" },
{ re: "NM:PWR:ON p=(\\d+)", d: "Powering on the sensor(s) through pin $1" },
{ re: "NM:PWR:OFF p=(\\d+)", d: "Powering off the sensor(s) through pin $1" },
{ re: "NM:OTA:REQ f=(\\d+) v=(\\d+)", d: "Over-the-air configuration change requested, function $1 value $2" },
{ re: "NM:EEPR:CLR", d: "Clearing the EEPROM as requested" },
{ re: "NM:EEPR:LOAD i=(\\d+) v=(\\d+)", d: "Read from EEPROM at position $1 the value $2" },
{ re: "NM:EEPR:SAVE i=(\\d+) v=(\\d+)", d: "Wrote to EEPROM at position $1 the value $2" },
{ re: "NM:EEPR:(\\w+)\\((\\d+)\\):LOAD", d: "Restoring from EEPROM the value of child $2 of sensor $1" },
{ re: "NM:EEPR:(\\w+)\\((\\d+)\\):SAVE", d: "Saving to EEPROM the value of child $2 of sensor $1$1: $2" },
{ re: "!NM:SENS:([^:]+):(.+)", d: "Error in sensor $1: $2" },
];
// Init regexes
for (var i=0, len=match.length;i