-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
I have a generic key fob with a HS1527 chip
Messages are sent with a preamble, 20bit unique ID and then 4bit value representing which buttons are pressed.
the preamble looks exactly like a binary '0', Thus when using the Ook to Sub tool with a binary input, the leading 0 gets truncated.
For example, here is the result for the input 0 1010 1010 1010 1010 0100
and (and transpose (1 -> 1110
and 0 0> 1000
, with a width 333 for on and off)
A work around is to invert the binary message and use the transpose fields to flip them back, preserving the initial binary 0 required for preamble.
I believe the culprit is the following line:
flippermaker.github.io/subghz_tool_OokToSub.js
Lines 140 to 162 in 86677db
getFormBinHexOok(getValue = false){ | |
if(getValue){ | |
var raw = this.getForm().elements["binHexOokToSub"].value.toString().trim(); | |
raw = cleanString(raw).toString(); | |
var isHex = allHex(raw); | |
var isBin = allBinary(raw); | |
var isNumber = allNumeric(raw); | |
var cleanValue = 0; | |
if (isBin){ | |
cleanValue = BigInt("0b"+raw); | |
//console.log("base2~"+cleanValue.toString()); | |
} else if (isHex){ | |
cleanValue = BigInt("0x"+raw); | |
//console.log("base16~"+cleanValue.toString()); | |
} else if (isNumber){ //should never reach this because all ints are also hex | |
cleanValue = parseInt(raw, 10); | |
//console.log("base10~"+cleanValue.toString()); | |
} | |
return cleanValue.toString(10); | |
}else{ | |
return this.getForm().elements["binHexOokToSub"]; | |
} | |
} |
Metadata
Metadata
Assignees
Labels
No labels