mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
check noise at the antenna
This commit is contained in:
parent
4df92e2655
commit
22f1e8e209
1 changed files with 15 additions and 1 deletions
|
@ -38,6 +38,17 @@ inline uint32_t GetGraphBuffer(uint32_t indx) {
|
||||||
return g_GraphBuffer[indx] + 128;
|
return g_GraphBuffer[indx] + 128;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32_t TexkomAVGField(void) {
|
||||||
|
if (g_GraphTraceLen == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
uint64_t vsum = 0;
|
||||||
|
for (uint32_t i = 0; i < g_GraphTraceLen; i++)
|
||||||
|
vsum += GetGraphBuffer(i);
|
||||||
|
|
||||||
|
return vsum / g_GraphTraceLen;
|
||||||
|
}
|
||||||
|
|
||||||
static uint32_t TexkomSearchStart(uint32_t indx, uint32_t threshold) {
|
static uint32_t TexkomSearchStart(uint32_t indx, uint32_t threshold) {
|
||||||
// one bit length = 27, minimal noise = 60
|
// one bit length = 27, minimal noise = 60
|
||||||
uint32_t lownoisectr = 0;
|
uint32_t lownoisectr = 0;
|
||||||
|
@ -398,8 +409,11 @@ static int CmdHFTexkomReader(const char *Cmd) {
|
||||||
uint32_t sindx = 0;
|
uint32_t sindx = 0;
|
||||||
while (sindx < samplesCount - 5) {
|
while (sindx < samplesCount - 5) {
|
||||||
sindx = TexkomSearchStart(sindx, TEXKOM_NOISE_THRESHOLD);
|
sindx = TexkomSearchStart(sindx, TEXKOM_NOISE_THRESHOLD);
|
||||||
if (sindx == 0 || sindx > samplesCount - 5)
|
if (sindx == 0 || sindx > samplesCount - 5) {
|
||||||
|
if (TexkomAVGField() > 30)
|
||||||
|
PrintAndLogEx(WARNING, "Too noisy environment. Try to move the tag from the antenna a bit.");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t slen = TexkomSearchLength(sindx, TEXKOM_NOISE_THRESHOLD);
|
uint32_t slen = TexkomSearchLength(sindx, TEXKOM_NOISE_THRESHOLD);
|
||||||
if (slen == 0)
|
if (slen == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue