Module: PWN::SDR::Decoder::DECT
- Defined in:
- lib/pwn/sdr/decoder/dect.rb
Overview
True-air + detector-fallback decoder for DECT. Prefers PWN::FFI I/Q (RTL-SDR / ADALM-Pluto / HackRF / capture file) via Base.run_iq; degrades to Base.run_detector with no hardware.
Defined Under Namespace
Classes: DemodIQ
Class Method Summary collapse
-
.authors ⇒ Object
- Author(s)
0day Inc.
-
.decode(opts = {}) ⇒ Object
- Supported Method Parameters
PWN::SDR::Decoder::DECT.decode( freq_obj: 'required - freq_obj returned from PWN::SDR::GQRX.init_freq' ).
- .help ⇒ Object
- .parse_line(opts = {}) ⇒ Object
Class Method Details
.authors ⇒ Object
- Author(s)
0day Inc. support@0dayinc.com
110 111 112 |
# File 'lib/pwn/sdr/decoder/dect.rb', line 110 public_class_method def self. "AUTHOR(S):\n 0day Inc. <support@0dayinc.com>\n" end |
.decode(opts = {}) ⇒ Object
- Supported Method Parameters
PWN::SDR::Decoder::DECT.decode( freq_obj: 'required - freq_obj returned from PWN::SDR::GQRX.init_freq' )
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/pwn/sdr/decoder/dect.rb', line 74 public_class_method def self.decode(opts = {}) freq_obj = opts[:freq_obj] rate = (opts[:sample_rate] || freq_obj[:iq_rate] || 2_000_000).to_i proto = 'DECT' demod = DemodIQ.new( rate: rate, protocol: proto, modulation: 'GFSK', extra: { threshold: 7.0 } ) PWN::SDR::Decoder::Base.run_iq( freq_obj: freq_obj, protocol: proto, sample_rate: rate, source: opts[:source], file: opts[:file], demod: demod, threshold: 7.0, note: '1.152 Mbit/s GFSK 24-slot TDMA — true-air I/Q path reports slot bursts.', describe: proc { |b| { modulation: 'GFSK', tdma_slots: (b[:duration_ms] / 0.417).round, classification: (b[:duration_ms] / 0.417).round >= 24 ? 'FP-beacon-frame' : 'PP-burst' } } ) end |
.help ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/pwn/sdr/decoder/dect.rb', line 114 public_class_method def self.help puts "USAGE (true-air I/Q via PWN::FFI + detector fallback): #{self}.decode( freq_obj: 'required - freq_obj returned from PWN::SDR::GQRX.init_freq', source: 'optional - :auto|:rtlsdr|:adalm_pluto|:file', file: 'optional - .cu8/.cs16 capture' ) #{self}.authors " end |
.parse_line(opts = {}) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/pwn/sdr/decoder/dect.rb', line 96 public_class_method def self.parse_line(opts = {}) line = opts[:line].to_s out = { protocol: 'DECT' } out[:rfpi] = ::Regexp.last_match(1).delete(' ') if line =~ /RFPI[:=]?\s*((?:[0-9A-Fa-f]{2}\s*){5})/ out[:slot] = ::Regexp.last_match(1) if line =~ /slot\s*(\d+)/i out[:carrier] = ::Regexp.last_match(1) if line =~ /carrier\s*(\d+)/i out[:rssi] = ::Regexp.last_match(1) if line =~ /RSSI[:=]?\s*(-?\d+)/i out[:role] = ::Regexp.last_match(1) if line =~ /\b(FP|PP)\b/ out[:summary] = "DECT RFPI=#{out[:rfpi]} slot=#{out[:slot]} carrier=#{out[:carrier]}" out.compact end |