Add options to 'lf sniff' for repeated acquisitions

This commit is contained in:
Philippe Teuwen
2020-09-20 11:12:38 +02:00
parent 1d1bb3fa1f
commit 35e276f8ed
6 changed files with 91 additions and 15 deletions

View File

@@ -786,8 +786,13 @@ static void PacketReceived(PacketCommandNG *packet) {
break;
}
case CMD_LF_SNIFF_RAW_ADC: {
uint32_t bits = SniffLF();
reply_mix(CMD_ACK, bits, 0, 0, 0, 0);
struct p {
uint32_t samples : 31;
bool verbose : 1;
} PACKED;
struct p *payload = (struct p *)packet->data.asBytes;
uint32_t bits = SniffLF(payload->verbose, payload->samples);
reply_ng(CMD_LF_SNIFF_RAW_ADC, PM3_SUCCESS, (uint8_t *)&bits, sizeof(bits));
break;
}
case CMD_LF_HID_WATCH: {

View File

@@ -397,9 +397,9 @@ uint32_t SampleLF(bool verbose, uint32_t sample_size) {
* Initializes the FPGA for sniffer-mode (field off), and acquires the samples.
* @return number of bits sampled
**/
uint32_t SniffLF(void) {
uint32_t SniffLF(bool verbose, uint32_t sample_size) {
BigBuf_Clear_ext(false);
return ReadLF(false, true, 0);
return ReadLF(false, verbose, sample_size);
}
/**

View File

@@ -40,7 +40,7 @@ uint32_t SampleLF(bool verbose, uint32_t sample_size);
* Initializes the FPGA for sniff-mode (field off), and acquires the samples.
* @return number of bits sampled
**/
uint32_t SniffLF(void);
uint32_t SniffLF(bool verbose, uint32_t sample_size);
uint32_t DoAcquisition(uint8_t decimation, uint8_t bits_per_sample, bool avg, int16_t trigger_threshold,
bool verbose, uint32_t sample_size, uint32_t cancel_after, int32_t samples_to_skip);