Add urh
This commit is contained in:
54
Software/Universal Radio Hacker/tests/PlotTests.py
Normal file
54
Software/Universal Radio Hacker/tests/PlotTests.py
Normal file
@ -0,0 +1,54 @@
|
||||
import copy
|
||||
import unittest
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
from urh.signalprocessing.Modulator import Modulator
|
||||
from urh.cythonext import signal_functions
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
from tests.utils_testing import get_path_for_data_file
|
||||
|
||||
|
||||
class PlotTests(unittest.TestCase):
|
||||
def test_plot(self):
|
||||
modulator = Modulator("gfsk")
|
||||
modulator.modulation_type = "GFSK"
|
||||
modulator.samples_per_symbol = 100
|
||||
modulator.sample_rate = 1e6
|
||||
modulator.parameters[1] = 20e3
|
||||
modulator.parameters[0] = 10e3
|
||||
modulator.carrier_freq_hz = 15e3
|
||||
modulator.carrier_phase_deg = 90
|
||||
|
||||
modulated_samples = modulator.modulate([True, False, True, False, False], 77)
|
||||
data = copy.deepcopy(modulated_samples)
|
||||
modulated_samples = modulator.modulate([False, True, True, True, True, False, True], 100, start=len(data))
|
||||
data = np.concatenate((data, modulated_samples))
|
||||
|
||||
plt.subplot(2, 1, 1)
|
||||
axes = plt.gca()
|
||||
axes.set_ylim([-2,2])
|
||||
plt.plot(data.real)
|
||||
plt.title("Modulated Wave")
|
||||
|
||||
plt.subplot(2, 1, 2)
|
||||
qad = signal_functions.afp_demod(np.ascontiguousarray(data), 0, "FSK", 2)
|
||||
plt.plot(qad)
|
||||
plt.title("Quad Demod")
|
||||
|
||||
plt.show()
|
||||
|
||||
def test_carrier_auto_detect(self):
|
||||
signal = Signal(get_path_for_data_file("wsp.complex"), "test")
|
||||
signal.modulation_type = "ASK"
|
||||
signal.noise_threshold = 0.035
|
||||
signal.center = 0.0245
|
||||
signal.samples_per_symbol = 25
|
||||
pa = ProtocolAnalyzer(signal)
|
||||
pa.get_protocol_from_signal()
|
||||
start, num_samples = pa.get_samplepos_of_bitseq(0, 0, 0, 999999, include_pause=False)
|
||||
|
||||
print("-----------")
|
||||
print(signal.estimate_frequency(start, end=start+num_samples, sample_rate=2e6))
|
82
Software/Universal Radio Hacker/tests/QtTestCase.py
Normal file
82
Software/Universal Radio Hacker/tests/QtTestCase.py
Normal file
@ -0,0 +1,82 @@
|
||||
import faulthandler
|
||||
import gc
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QDropEvent
|
||||
from PyQt5.QtTest import QTest
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
|
||||
from tests.utils_testing import write_settings, get_path_for_data_file
|
||||
from urh.controller.MainController import MainController
|
||||
from urh.signalprocessing.ProtocolSniffer import ProtocolSniffer
|
||||
|
||||
faulthandler.enable()
|
||||
|
||||
|
||||
class QtTestCase(unittest.TestCase):
|
||||
SHOW = os.path.exists(os.path.join(os.path.dirname(os.path.realpath(__file__)), "show_gui"))
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
import multiprocessing as mp
|
||||
try:
|
||||
mp.set_start_method("spawn")
|
||||
except RuntimeError:
|
||||
pass
|
||||
assert mp.get_start_method() == "spawn"
|
||||
|
||||
write_settings()
|
||||
cls.app = QApplication([cls.__name__])
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
cls.app.quit()
|
||||
del cls.app
|
||||
|
||||
def setUp(self):
|
||||
ProtocolSniffer.BUFFER_SIZE_MB = 0.5
|
||||
self.form = MainController()
|
||||
self.form.ui.actionAuto_detect_new_signals.setChecked(False)
|
||||
if self.SHOW:
|
||||
self.form.show()
|
||||
|
||||
def tearDown(self):
|
||||
if hasattr(self, "dialog"):
|
||||
self.dialog.close()
|
||||
del self.dialog
|
||||
|
||||
if hasattr(self, "form"):
|
||||
self.form.close_all_files()
|
||||
self.form.close()
|
||||
del self.form
|
||||
|
||||
gc.collect()
|
||||
|
||||
def add_signal_to_form(self, filename: str):
|
||||
self.form.add_signalfile(get_path_for_data_file(filename))
|
||||
|
||||
def get_path_for_filename(self, filename) -> str:
|
||||
return get_path_for_data_file(filename)
|
||||
|
||||
def add_signal_to_generator(self, signal_index: int):
|
||||
gframe = self.form.generator_tab_controller
|
||||
item = gframe.tree_model.rootItem.children[0].children[signal_index]
|
||||
index = gframe.tree_model.createIndex(signal_index, 0, item)
|
||||
rect = gframe.ui.treeProtocols.visualRect(index)
|
||||
QTest.mousePress(gframe.ui.treeProtocols.viewport(), Qt.LeftButton, pos=rect.center())
|
||||
self.assertEqual(gframe.ui.treeProtocols.selectedIndexes()[0], index)
|
||||
mimedata = gframe.tree_model.mimeData(gframe.ui.treeProtocols.selectedIndexes())
|
||||
gframe.table_model.dropMimeData(mimedata, 1, -1, -1, gframe.table_model.createIndex(0, 0))
|
||||
|
||||
def add_all_signals_to_simulator(self):
|
||||
assert isinstance(self.form, MainController)
|
||||
sim_frame = self.form.simulator_tab_controller
|
||||
sim_frame.ui.treeProtocols.selectAll()
|
||||
self.assertGreater(len(sim_frame.ui.treeProtocols.selectedIndexes()), 0)
|
||||
mimedata = sim_frame.tree_model.mimeData(sim_frame.ui.treeProtocols.selectedIndexes())
|
||||
drop_event = QDropEvent(sim_frame.ui.gvSimulator.rect().center(), Qt.CopyAction | Qt.MoveAction,
|
||||
mimedata, Qt.LeftButton, Qt.NoModifier)
|
||||
drop_event.acceptProposedAction()
|
||||
sim_frame.ui.gvSimulator.dropEvent(drop_event)
|
218
Software/Universal Radio Hacker/tests/SpectrogramTest.py
Normal file
218
Software/Universal Radio Hacker/tests/SpectrogramTest.py
Normal file
@ -0,0 +1,218 @@
|
||||
import unittest
|
||||
import numpy as np
|
||||
from tests.utils_testing import get_path_for_data_file
|
||||
from urh.signalprocessing.Filter import Filter
|
||||
from urh.signalprocessing.Modulator import Modulator
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
import array
|
||||
|
||||
from matplotlib import pyplot as plt
|
||||
from urh.cythonext import signal_functions
|
||||
from urh.signalprocessing.Spectrogram import Spectrogram
|
||||
|
||||
|
||||
class SpectrogramTest(unittest.TestCase):
|
||||
""" short time fourier transform of audio signal """
|
||||
|
||||
def stft(self, samples, window_size, overlap_factor=0.5, window_function=np.hanning):
|
||||
"""
|
||||
Perform Short-time Fourier transform to get the spectrogram for the given samples
|
||||
|
||||
:param samples: Complex samples
|
||||
:param window_size: Size of DFT window
|
||||
:param overlap_factor: Value between 0 (= No Overlapping) and 1 (= Full overlapping) of windows
|
||||
:param window_function: Function for DFT window
|
||||
:return: short-time Fourier transform of the given signal
|
||||
"""
|
||||
window = window_function(window_size)
|
||||
|
||||
# hop size determines by how many samples the window is advanced
|
||||
hop_size = window_size - int(overlap_factor * window_size)
|
||||
|
||||
# pad with zeros to ensure last window fits signal
|
||||
padded_samples = np.append(samples, np.zeros((len(samples) - window_size) % hop_size))
|
||||
num_frames = ((len(padded_samples) - window_size) // hop_size) + 1
|
||||
frames = [padded_samples[i*hop_size:i*hop_size+window_size] * window for i in range(num_frames)]
|
||||
return np.fft.fft(frames)
|
||||
|
||||
def setUp(self):
|
||||
self.signal = Signal(get_path_for_data_file("two_participants.complex16s"), "test")
|
||||
|
||||
def test_numpy_impl(self):
|
||||
sample_rate = 1e6
|
||||
spectrogram = np.fft.fftshift(self.stft(self.signal.iq_array.data, 2**10, overlap_factor=0.5)) / 1024
|
||||
|
||||
ims = 10 * np.log10(spectrogram.real ** 2 + spectrogram.imag ** 2) # convert amplitudes to decibel
|
||||
num_time_bins, num_freq_bins = np.shape(ims)
|
||||
|
||||
plt.imshow(np.transpose(ims), aspect="auto", cmap="magma")
|
||||
plt.colorbar()
|
||||
|
||||
plt.xlabel("time in seconds")
|
||||
plt.ylabel("frequency in Hz")
|
||||
plt.ylim(ymin=0, ymax=num_freq_bins)
|
||||
|
||||
x_tick_pos = np.linspace(0, num_time_bins - 1, 5, dtype=np.float32)
|
||||
plt.xticks(x_tick_pos, ["%.02f" % l for l in (x_tick_pos * len(self.signal.iq_array.data) / num_time_bins) / sample_rate])
|
||||
y_tick_pos = np.linspace(0, num_freq_bins - 1, 10, dtype=np.int16)
|
||||
frequencies = np.fft.fftshift(np.fft.fftfreq(num_freq_bins, 1/sample_rate))
|
||||
plt.yticks(y_tick_pos, ["%.02f" % frequencies[i] for i in y_tick_pos])
|
||||
|
||||
plt.show()
|
||||
|
||||
def narrowband_iir(self, fc, bw, fs):
|
||||
fc /= fs
|
||||
bw /= fs
|
||||
|
||||
R = 1 - 3 * bw
|
||||
K = (1 - 2 * R * np.cos(2 * np.pi * fc) + R ** 2) / (2 - 2*np.cos(2 * np.pi * fc))
|
||||
|
||||
a = np.array([K, -2*K*np.cos(2 * np.pi * fc), K], dtype=np.float64)
|
||||
b = np.array([2 * R * np.cos(2 * np.pi * fc), -R**2], dtype=np.float64)
|
||||
|
||||
return a, b
|
||||
|
||||
def test_bandpass(self):
|
||||
# Generate a noisy signal
|
||||
fs = 2000
|
||||
T = 0.1
|
||||
nsamples = T * fs
|
||||
t = np.linspace(0, T, nsamples, endpoint=False)
|
||||
a = 0.02
|
||||
f0 = 600
|
||||
x = 0.25 * np.sin(2 * np.pi * 0.25*f0 * t)
|
||||
x += 0.25 * np.sin(2 * np.pi * f0 * t)
|
||||
x += 0.25 * np.sin(2 * np.pi * 2*f0 * t)
|
||||
x += 0.25 * np.sin(2 * np.pi * 3*f0 * t)
|
||||
|
||||
import time
|
||||
|
||||
lowcut = f0 - 200
|
||||
highcut = f0 + 200
|
||||
|
||||
# Define the parameters
|
||||
fc = f0 / fs
|
||||
b = 0.05
|
||||
data = x
|
||||
|
||||
y = Filter.apply_bandpass_filter(data, lowcut / fs, highcut / fs, filter_bw=b)
|
||||
|
||||
plt.plot(y, label='Filtered signal (%g Hz)' % f0)
|
||||
plt.plot(data, label='Noisy signal')
|
||||
plt.legend(loc='upper left')
|
||||
plt.show()
|
||||
|
||||
def test_iir_bandpass(self):
|
||||
# Generate a noisy signal
|
||||
fs = 2400
|
||||
T = 6
|
||||
nsamples = T * fs
|
||||
t = np.linspace(0, T, nsamples, endpoint=False)
|
||||
a = 0.02
|
||||
f0 = 300
|
||||
x = 0.5 * np.sin(2 * np.pi * f0 * t)
|
||||
x += 0.25 * np.sin(2 * np.pi * 2 * f0 * t)
|
||||
x += 0.25 * np.sin(2 * np.pi * 3 * f0 * t)
|
||||
|
||||
#data = x.astype(np.complex64)
|
||||
data = np.sin(2 * np.pi * f0 * t).astype(np.complex64)
|
||||
|
||||
print("Len data", len(data))
|
||||
a, b = self.narrowband_iir(f0, 100, fs)
|
||||
s = a.sum() + b.sum()
|
||||
#a /= s
|
||||
#b /= s
|
||||
print(a, b)
|
||||
|
||||
filtered_data = signal_functions.iir_filter(a, b, data)
|
||||
|
||||
#plt.plot(data, label='Noisy signal')
|
||||
plt.plot(np.fft.fft(filtered_data), label='Filtered signal (%g Hz)' % f0)
|
||||
|
||||
|
||||
|
||||
plt.legend(loc='upper left')
|
||||
plt.show()
|
||||
|
||||
def test_channels(self):
|
||||
sample_rate = 10 ** 6
|
||||
|
||||
channel1_freq = 40 * 10 ** 3
|
||||
channel2_freq = 240 * 10 ** 3
|
||||
|
||||
channel1_data = array.array("B", [1, 0, 1, 0, 1, 0, 0, 1])
|
||||
channel2_data = array.array("B", [1, 1, 0, 0, 1, 1, 0, 1])
|
||||
channel3_data = array.array("B", [1, 0, 0, 1, 0, 1, 1, 1])
|
||||
|
||||
filter_bw = 0.1
|
||||
|
||||
filter_freq1_high = 1.5 * channel1_freq
|
||||
filter_freq1_low = 0.5 * channel1_freq
|
||||
filter_freq2_high = 1.5*channel2_freq
|
||||
filter_freq2_low = 0.5 * channel2_freq
|
||||
|
||||
modulator1, modulator2, modulator3 = Modulator("test"), Modulator("test2"), Modulator("test3")
|
||||
modulator1.carrier_freq_hz = channel1_freq
|
||||
modulator2.carrier_freq_hz = channel2_freq
|
||||
modulator3.carrier_freq_hz = -channel2_freq
|
||||
modulator1.sample_rate = modulator2.sample_rate = modulator3.sample_rate = sample_rate
|
||||
data1 = modulator1.modulate(channel1_data)
|
||||
data2 = modulator2.modulate(channel2_data)
|
||||
data3 = modulator3.modulate(channel3_data)
|
||||
|
||||
mixed_signal = data1 + data2 + data3
|
||||
|
||||
mixed_signal.tofile("/tmp/three_channels.complex")
|
||||
|
||||
plt.subplot("221")
|
||||
plt.title("Signal")
|
||||
plt.plot(mixed_signal)
|
||||
|
||||
spectrogram = Spectrogram(mixed_signal)
|
||||
plt.subplot("222")
|
||||
plt.title("Spectrogram")
|
||||
plt.imshow(np.transpose(spectrogram.data), aspect="auto", cmap="magma")
|
||||
plt.ylim(0, spectrogram.freq_bins)
|
||||
|
||||
chann1_filtered = Filter.apply_bandpass_filter(mixed_signal, filter_freq1_low / sample_rate, filter_freq1_high / sample_rate, filter_bw)
|
||||
plt.subplot("223")
|
||||
plt.title("Channel 1 Filtered ({})".format("".join(map(str, channel1_data))))
|
||||
plt.plot(chann1_filtered)
|
||||
|
||||
chann2_filtered = Filter.apply_bandpass_filter(mixed_signal, filter_freq2_low / sample_rate, filter_freq2_high / sample_rate, filter_bw)
|
||||
plt.subplot("224")
|
||||
plt.title("Channel 2 Filtered ({})".format("".join(map(str, channel2_data))))
|
||||
plt.plot(chann2_filtered)
|
||||
|
||||
plt.show()
|
||||
|
||||
|
||||
def test_bandpass_h(self):
|
||||
f_low = -0.4
|
||||
f_high = -0.3
|
||||
bw = 0.01
|
||||
|
||||
f_shift = (f_low + f_high) / 2
|
||||
f_c = (f_high - f_low) / 2
|
||||
|
||||
N = Filter.get_filter_length_from_bandwidth(bw)
|
||||
|
||||
h = Filter.design_windowed_sinc_lpf(f_c, bw=bw) * np.exp(np.complex(0,1) * np.pi * 2 * f_shift * np.arange(0, N, dtype=complex))
|
||||
|
||||
#h = Filter.design_windowed_sinc_bandpass(f_low=f_low, f_high=f_high, bw=bw)
|
||||
#h = Filter.design_windowed_sinc_lpf(0.42, bw=0.08)
|
||||
|
||||
impulse = np.exp(1j * np.linspace(0, 1, 50))
|
||||
|
||||
plt.subplot("221")
|
||||
plt.title("f_low={} f_high={} bw={}".format(f_low, f_high, bw))
|
||||
plt.plot(np.fft.fftfreq(1024), np.fft.fft(h, 1024))
|
||||
|
||||
plt.subplot("222")
|
||||
plt.plot(h)
|
||||
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
# h = cls.design_windowed_sinc_bandpass(f_low, f_high, filter_bw)
|
@ -0,0 +1,44 @@
|
||||
import array
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from urh import settings
|
||||
from urh.signalprocessing.Encoding import Encoding
|
||||
|
||||
|
||||
class TestExternalDecodings(unittest.TestCase):
|
||||
def test_external_homematic(self):
|
||||
f = os.readlink(__file__) if os.path.islink(__file__) else __file__
|
||||
path = os.path.realpath(os.path.join(f, "..", ".."))
|
||||
code = os.path.join(path, "data", "decodings", "homematic_complete")
|
||||
|
||||
e = Encoding(["test external homematic", settings.DECODING_EXTERNAL,
|
||||
code + " d" + ";" + code + " e"])
|
||||
|
||||
data = array.array("B",
|
||||
[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
|
||||
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0,
|
||||
1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0,
|
||||
0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0,
|
||||
0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0,
|
||||
0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1,
|
||||
1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1,
|
||||
0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1,
|
||||
0, 0, 1, 0, 1, 0, 1, 1, 1, 1])
|
||||
decoded = e.decode(data)
|
||||
self.assertEqual(decoded, array.array("B",
|
||||
[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
|
||||
1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0,
|
||||
1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1,
|
||||
0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
|
||||
0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0,
|
||||
0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0,
|
||||
1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0,
|
||||
1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0,
|
||||
0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1,
|
||||
0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0]))
|
||||
encoded = e.encode(decoded)
|
||||
self.assertEqual(encoded, data)
|
@ -0,0 +1,82 @@
|
||||
import time
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtTest import QTest
|
||||
|
||||
from tests.QtTestCase import QtTestCase
|
||||
from urh.signalprocessing.Message import Message
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
|
||||
|
||||
class TestGeneratorTable(QtTestCase):
|
||||
NUM_MESSAGES = 2**16
|
||||
BITS_PER_MESSAGE = 100
|
||||
NUM_LABELS = 3
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
||||
def test_performance(self):
|
||||
self.cframe = self.form.compare_frame_controller
|
||||
self.gframe = self.form.generator_tab_controller
|
||||
self.form.ui.tabWidget.setCurrentIndex(2)
|
||||
self.cframe.ui.cbProtoView.setCurrentIndex(0)
|
||||
self.gframe.ui.cbViewType.setCurrentIndex(0)
|
||||
proto = self.__build_protocol()
|
||||
self.cframe.add_protocol(proto)
|
||||
proto.qt_signals.protocol_updated.emit()
|
||||
self.assertEqual(self.cframe.protocol_model.row_count, self.NUM_MESSAGES)
|
||||
self.assertEqual(self.cframe.protocol_model.col_count, self.BITS_PER_MESSAGE)
|
||||
self.__add_labels()
|
||||
item = self.gframe.tree_model.rootItem.children[0].children[0]
|
||||
index = self.gframe.tree_model.createIndex(0, 0, item)
|
||||
rect = self.gframe.ui.treeProtocols.visualRect(index)
|
||||
QTest.mousePress(self.gframe.ui.treeProtocols.viewport(), Qt.LeftButton, pos = rect.center())
|
||||
|
||||
self.assertEqual(self.gframe.ui.treeProtocols.selectedIndexes()[0], index)
|
||||
mimedata = self.gframe.tree_model.mimeData(self.gframe.ui.treeProtocols.selectedIndexes())
|
||||
t = time.time()
|
||||
self.gframe.table_model.dropMimeData(mimedata, 1, -1, -1, self.gframe.table_model.createIndex(0, 0))
|
||||
print("{0}: {1} s".format("Time for dropping mimedata", (time.time() - t)))
|
||||
self.assertEqual(self.gframe.table_model.row_count, self.NUM_MESSAGES)
|
||||
|
||||
print("==============================00")
|
||||
indx = self.gframe.table_model.createIndex(int(self.NUM_MESSAGES / 2), int(self.BITS_PER_MESSAGE / 2))
|
||||
roles = (Qt.DisplayRole, Qt.BackgroundColorRole, Qt.TextAlignmentRole, Qt.TextColorRole, Qt.FontRole)
|
||||
time_for_display = 100
|
||||
for role in roles:
|
||||
t = time.time()
|
||||
self.gframe.table_model.data(indx, role = role)
|
||||
microseconds = (time.time() - t) * 10 ** 6
|
||||
self.assertLessEqual(microseconds, 2 * time_for_display, msg=self.__role_to_str(role))
|
||||
if role == Qt.DisplayRole:
|
||||
time_for_display = microseconds
|
||||
print("{0}: {1} µs".format(self.__role_to_str(role), microseconds))
|
||||
|
||||
def __build_protocol(self):
|
||||
result = ProtocolAnalyzer(signal=None)
|
||||
for _ in range(self.NUM_MESSAGES):
|
||||
b = Message([True] * self.BITS_PER_MESSAGE, pause = 1000, message_type=result.default_message_type)
|
||||
result.messages.append(b)
|
||||
return result
|
||||
|
||||
def __add_labels(self):
|
||||
start = 0
|
||||
label_len = 3
|
||||
for i in range(self.NUM_LABELS):
|
||||
self.cframe.add_protocol_label(start=start, end=start + label_len, messagenr=0, proto_view=0, edit_label_name = False)
|
||||
start += label_len + 1
|
||||
|
||||
def __role_to_str(self, role):
|
||||
if role == Qt.DisplayRole:
|
||||
return "Display"
|
||||
if role == Qt.BackgroundColorRole:
|
||||
return "BG-Color"
|
||||
if role == Qt.TextAlignmentRole:
|
||||
return "Text-Alignment"
|
||||
if role == Qt.TextColorRole:
|
||||
return "TextColor"
|
||||
if role == Qt.ToolTipRole:
|
||||
return "ToolTip"
|
||||
if role == Qt.FontRole:
|
||||
return "Font"
|
150
Software/Universal Radio Hacker/tests/TestInstallation.py
Normal file
150
Software/Universal Radio Hacker/tests/TestInstallation.py
Normal file
@ -0,0 +1,150 @@
|
||||
import unittest
|
||||
|
||||
from subprocess import call, DEVNULL
|
||||
import time
|
||||
|
||||
from tests.docker import docker_util
|
||||
|
||||
|
||||
class VMHelper(object):
|
||||
def __init__(self, vm_name: str, shell: str = "", ssh_username: str = None, ssh_port: str = None):
|
||||
self.vm_name = vm_name
|
||||
self.shell = shell # like cmd.exe /c
|
||||
self.ssh_username = ssh_username
|
||||
self.ssh_port = ssh_port
|
||||
|
||||
self.use_ssh = self.ssh_username is not None and self.ssh_port is not None
|
||||
self.__vm_is_up = False
|
||||
|
||||
def start_vm(self):
|
||||
call('VBoxManage startvm "{0}"'.format(self.vm_name), shell=True)
|
||||
|
||||
def stop_vm(self, save=True):
|
||||
if save:
|
||||
call('VBoxManage controlvm "{0}" savestate'.format(self.vm_name), shell=True)
|
||||
return
|
||||
if self.use_ssh:
|
||||
self.send_command("sudo shutdown -h now")
|
||||
else:
|
||||
call('VBoxManage controlvm "{0}" acpipowerbutton'.format(self.vm_name), shell=True)
|
||||
|
||||
def wait_for_vm_up(self):
|
||||
if not self.__vm_is_up:
|
||||
print("Waiting for {} to come up.".format(self.vm_name))
|
||||
command = "ping -c 1" if self.use_ssh else "ping -n 1"
|
||||
command += " github.com"
|
||||
|
||||
while self.__send_command(command, hide_output=True, print_command=False) != 0:
|
||||
time.sleep(1)
|
||||
|
||||
self.__vm_is_up = True
|
||||
|
||||
def send_command(self, command: str) -> int:
|
||||
self.wait_for_vm_up()
|
||||
return self.__send_command(command)
|
||||
|
||||
def __send_command(self, command: str, hide_output=False, print_command=True) -> int:
|
||||
if self.use_ssh:
|
||||
fullcmd = ["ssh", "-p", str(self.ssh_port), "{0}@127.0.0.1".format(self.ssh_username), '"{0}"'.format(command)]
|
||||
else:
|
||||
fullcmd = ["VBoxManage", "guestcontrol", '"{0}"'.format(self.vm_name), "run"] \
|
||||
+ self.shell.split(" ") \
|
||||
+ ['"{0}"'.format(command)]
|
||||
|
||||
kwargs = {"stdout": DEVNULL, "stderr": DEVNULL} if hide_output else {}
|
||||
|
||||
fullcmd = " ".join(fullcmd)
|
||||
|
||||
if print_command:
|
||||
print("\033[1m" + fullcmd + "\033[0m")
|
||||
|
||||
return call(fullcmd, shell=True, **kwargs)
|
||||
|
||||
|
||||
class TestInstallation(unittest.TestCase):
|
||||
|
||||
def test_linux(self):
|
||||
distributions = [
|
||||
#"archlinux",
|
||||
"debian8",
|
||||
#"ubuntu1404",
|
||||
"ubuntu1604",
|
||||
#"kali",
|
||||
# "gentoo" # can't test gentoo till this bug is fixed: https://github.com/docker/docker/issues/1916#issuecomment-184356102
|
||||
]
|
||||
|
||||
for distribution in distributions:
|
||||
self.assertTrue(docker_util.run_image(distribution, rebuild=False), msg=distribution)
|
||||
|
||||
def test_windows(self):
|
||||
r"""
|
||||
Run the unittests on Windows + Install via Pip
|
||||
|
||||
To Fix Windows Error in Guest OS:
|
||||
type gpedit.msc and go to:
|
||||
Windows Settings
|
||||
-> Security Settings
|
||||
-> Local Policies
|
||||
-> Security Options
|
||||
-> Accounts: Limit local account use of blank passwords to console logon only
|
||||
and set it to DISABLED.
|
||||
|
||||
|
||||
configure pip on guest:
|
||||
|
||||
%APPDATA%\Roaming\pip
|
||||
|
||||
[global]
|
||||
no-cache-dir = false
|
||||
|
||||
[uninstall]
|
||||
yes = true
|
||||
:return:
|
||||
"""
|
||||
target_dir = r"C:\urh"
|
||||
vm_helper = VMHelper("Windows 10", shell="cmd.exe /c")
|
||||
vm_helper.start_vm()
|
||||
vm_helper.send_command("pip uninstall urh")
|
||||
vm_helper.send_command("rd /s /q {0}".format(target_dir))
|
||||
vm_helper.send_command("git clone https://github.com/jopohl/urh " + target_dir)
|
||||
rc = vm_helper.send_command(r"python C:\urh\src\urh\cythonext\build.py")
|
||||
self.assertEqual(rc, 0)
|
||||
|
||||
rc = vm_helper.send_command(r"py.test C:\urh\tests".format(target_dir))
|
||||
self.assertEqual(rc, 0)
|
||||
|
||||
vm_helper.send_command("pip install urh")
|
||||
time.sleep(0.5)
|
||||
rc = vm_helper.send_command("urh autoclose")
|
||||
self.assertEqual(rc, 0)
|
||||
vm_helper.send_command("pip uninstall urh")
|
||||
vm_helper.stop_vm()
|
||||
|
||||
def test_osx(self):
|
||||
"""
|
||||
Run Unittests + Pip Installation on OSX
|
||||
|
||||
:return:
|
||||
"""
|
||||
|
||||
vm_helper = VMHelper("OSX", ssh_port="3022", ssh_username="boss")
|
||||
vm_helper.start_vm()
|
||||
|
||||
python_bin_dir = "/Library/Frameworks/Python.framework/Versions/3.5/bin/"
|
||||
target_dir = "/tmp/urh"
|
||||
vm_helper.send_command("rm -rf {0}".format(target_dir))
|
||||
vm_helper.send_command("git clone https://github.com/jopohl/urh " + target_dir)
|
||||
|
||||
# Build extensions
|
||||
rc = vm_helper.send_command("{0}python3 {1}/src/urh/cythonext/build.py".format(python_bin_dir, target_dir))
|
||||
self.assertEqual(rc, 0)
|
||||
|
||||
# Run Unit tests
|
||||
rc = vm_helper.send_command("{1}py.test {0}/tests".format(target_dir, python_bin_dir))
|
||||
self.assertEqual(rc, 0)
|
||||
|
||||
vm_helper.send_command("{0}pip3 --no-cache-dir install urh".format(python_bin_dir))
|
||||
rc = vm_helper.send_command("{0}urh autoclose".format(python_bin_dir))
|
||||
self.assertEqual(rc, 0)
|
||||
vm_helper.send_command("{0}pip3 uninstall --yes urh".format(python_bin_dir))
|
||||
vm_helper.stop_vm()
|
7
Software/Universal Radio Hacker/tests/__init__.py
Normal file
7
Software/Universal Radio Hacker/tests/__init__.py
Normal file
@ -0,0 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
f = os.readlink(__file__) if os.path.islink(__file__) else __file__
|
||||
path = os.path.realpath(os.path.join(f, "..", "..", "src"))
|
||||
|
||||
if path not in sys.path:
|
||||
sys.path.insert(0, path)
|
@ -0,0 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
f = os.readlink(__file__) if os.path.islink(__file__) else __file__
|
||||
path = os.path.realpath(os.path.join(f, "..", "..", "..", "src"))
|
||||
|
||||
if path not in sys.path:
|
||||
sys.path.insert(0, path)
|
@ -0,0 +1,88 @@
|
||||
import random
|
||||
|
||||
import numpy as np
|
||||
|
||||
from urh.signalprocessing.IQArray import IQArray
|
||||
from urh.signalprocessing.Message import Message
|
||||
from urh.signalprocessing.Modulator import Modulator
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
|
||||
|
||||
def demodulate(signal_data, mod_type: str, bit_length, center, noise, tolerance, decoding=None, pause_threshold=8):
|
||||
signal = Signal("", "")
|
||||
if isinstance(signal_data, IQArray):
|
||||
signal.iq_array = signal_data
|
||||
else:
|
||||
if signal_data.dtype == np.complex64:
|
||||
signal.iq_array = IQArray(signal_data.view(np.float32))
|
||||
else:
|
||||
signal.iq_array = IQArray(signal_data)
|
||||
signal.modulation_type = mod_type
|
||||
signal.samples_per_symbol = bit_length
|
||||
signal.center = center
|
||||
signal.noise_threshold = noise
|
||||
signal.pause_threshold = pause_threshold
|
||||
if tolerance is not None:
|
||||
signal.tolerance = tolerance
|
||||
pa = ProtocolAnalyzer(signal)
|
||||
if decoding is not None:
|
||||
pa.decoder = decoding
|
||||
pa.get_protocol_from_signal()
|
||||
return pa.decoded_hex_str
|
||||
|
||||
|
||||
def generate_signal(messages: list, modulator: Modulator, snr_db: int, add_noise=True):
|
||||
result = []
|
||||
|
||||
message_powers = []
|
||||
if isinstance(messages, Message):
|
||||
messages = [messages]
|
||||
|
||||
for msg in messages:
|
||||
modulated = modulator.modulate(msg.encoded_bits, msg.pause)
|
||||
|
||||
if add_noise:
|
||||
message_powers.append(np.mean(np.abs(modulated[:len(modulated) - msg.pause])))
|
||||
|
||||
result.append(modulated)
|
||||
|
||||
result = np.concatenate(result)
|
||||
if not add_noise:
|
||||
return result
|
||||
|
||||
noise = np.random.normal(loc=0, scale=1, size=2 * len(result)).astype(np.float32).view(np.complex64)
|
||||
|
||||
# https://stackoverflow.com/questions/23690766/proper-way-to-add-noise-to-signal
|
||||
snr_ratio = np.power(10, snr_db / 10)
|
||||
|
||||
signal_power = np.mean(message_powers)
|
||||
noise_power = signal_power / snr_ratio
|
||||
noise = 1 / np.sqrt(2) * noise_power * noise
|
||||
|
||||
return result + noise
|
||||
|
||||
|
||||
def generate_message_bits(num_bits=80, preamble="", sync="", eof=""):
|
||||
bits_to_generate = num_bits - (len(preamble) + len(sync) + len(eof))
|
||||
|
||||
if bits_to_generate < 0:
|
||||
raise ValueError("Preamble and Sync and EOF are together larger than requested num bits")
|
||||
|
||||
bytes_to_generate = bits_to_generate // 8
|
||||
leftover_bits = bits_to_generate % 8
|
||||
return "".join([preamble, sync]
|
||||
+ ["{0:08b}".format(random.choice(range(0, 256))) for _ in range(bytes_to_generate)]
|
||||
+ [random.choice(["0", "1"]) for _ in range(leftover_bits)]
|
||||
+ [eof]
|
||||
)
|
||||
|
||||
|
||||
def generate_random_messages(num_messages: int, num_bits: int,
|
||||
preamble: str, sync: str, eof: str, message_pause: int):
|
||||
return [
|
||||
Message.from_plain_bits_str(
|
||||
generate_message_bits(num_bits, preamble, sync, eof), pause=message_pause
|
||||
)
|
||||
for _ in range(num_messages)
|
||||
]
|
@ -0,0 +1,153 @@
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from urh.ainterpretation import AutoInterpretation
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
from tests.auto_interpretation.auto_interpretation_test_util import demodulate
|
||||
|
||||
|
||||
class TestAutoInterpretationIntegration(unittest.TestCase):
|
||||
SIGNALPATH = "~/GIT/publications/ainterpretation/experiments/signals/"
|
||||
|
||||
def get_path(self, signalname):
|
||||
if sys.platform == "win32":
|
||||
return None
|
||||
|
||||
path = os.path.join(os.path.expanduser(self.SIGNALPATH), signalname)
|
||||
if os.path.exists(path):
|
||||
return path
|
||||
else:
|
||||
return None
|
||||
|
||||
def test_action(self):
|
||||
path = self.get_path("action_FB_A_B_C_D.coco")
|
||||
if not path:
|
||||
return
|
||||
|
||||
data = Signal(path, "").iq_array
|
||||
|
||||
result = AutoInterpretation.estimate(data)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
self.assertEqual(mod_type, "ASK")
|
||||
self.assertGreaterEqual(bit_length, 400)
|
||||
self.assertLessEqual(bit_length, 600)
|
||||
|
||||
print("noise", noise, "center", center, "bit length", bit_length, "tolerance", tolerance)
|
||||
demodulated = demodulate(data, mod_type, bit_length, center, noise, tolerance)
|
||||
print(demodulated)
|
||||
self.assertEqual(len(demodulated), 19)
|
||||
for i in range(2):
|
||||
self.assertTrue(demodulated[i].startswith("8e8eeeeeee8"))
|
||||
|
||||
def test_audi(self):
|
||||
path = self.get_path("audi_auf_sr5m.coco")
|
||||
if not path:
|
||||
return
|
||||
|
||||
data = Signal(path, "").iq_array
|
||||
|
||||
result = AutoInterpretation.estimate(data)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
self.assertEqual(mod_type, "ASK")
|
||||
self.assertGreaterEqual(bit_length, 2400)
|
||||
self.assertLessEqual(bit_length, 2500)
|
||||
self.assertGreaterEqual(center, 0.005)
|
||||
self.assertLessEqual(center, 0.32)
|
||||
|
||||
print("noise", noise, "center", center, "bit length", bit_length, "tolerance", tolerance)
|
||||
demodulated = demodulate(data, mod_type, bit_length, center, noise, tolerance)
|
||||
print(demodulated)
|
||||
self.assertEqual(len(demodulated), 1)
|
||||
self.assertTrue(demodulated[0].startswith("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))
|
||||
self.assertTrue(demodulated[0].endswith("cad4c"))
|
||||
|
||||
def test_brennenstuhl(self):
|
||||
path = self.get_path("brennenstuhl_signal_ABCD_onoff.coco")
|
||||
if not path:
|
||||
return
|
||||
|
||||
data = Signal(path, "").iq_array
|
||||
|
||||
result = AutoInterpretation.estimate(data)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
self.assertEqual(mod_type, "ASK")
|
||||
self.assertEqual(bit_length, 300)
|
||||
|
||||
print("noise", noise, "center", center, "bit length", bit_length, "tolerance", tolerance)
|
||||
demodulated = demodulate(data, mod_type, bit_length, center, noise, tolerance, pause_threshold=8)
|
||||
print(demodulated)
|
||||
self.assertEqual(len(demodulated), 64)
|
||||
for i in range(64):
|
||||
self.assertTrue(demodulated[i].startswith("88888888888"))
|
||||
self.assertEqual(len(demodulated[i]), len(demodulated[0]))
|
||||
|
||||
def test_esaver(self):
|
||||
path = self.get_path("esaver_test4on.complex")
|
||||
if not path:
|
||||
return
|
||||
|
||||
data = Signal(path, "").iq_array
|
||||
|
||||
result = AutoInterpretation.estimate(data)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
print(center, noise)
|
||||
self.assertEqual(mod_type, "FSK")
|
||||
self.assertEqual(bit_length, 100)
|
||||
|
||||
print("noise", noise, "center", center, "bit length", bit_length, "tolerance", tolerance)
|
||||
demodulated = demodulate(data, mod_type, bit_length, center, noise, tolerance)
|
||||
print(demodulated)
|
||||
self.assertEqual(len(demodulated), 12)
|
||||
for i in range(12):
|
||||
self.assertTrue(demodulated[i].startswith("aaaaaaaa"))
|
||||
|
||||
def test_scislo(self):
|
||||
path = self.get_path("scislo.complex")
|
||||
if not path:
|
||||
return
|
||||
|
||||
data = Signal(path, "").iq_array
|
||||
|
||||
result = AutoInterpretation.estimate(data)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
self.assertEqual(mod_type, "FSK")
|
||||
self.assertEqual(bit_length, 200)
|
||||
self.assertGreaterEqual(noise, 0.0120)
|
||||
|
||||
print("noise", noise, "center", center, "bit length", bit_length, "tolerance", tolerance)
|
||||
demodulated = demodulate(data, mod_type, bit_length, center, noise, tolerance)
|
||||
print(demodulated)
|
||||
self.assertEqual(len(demodulated), 8)
|
||||
for i in range(8):
|
||||
self.assertTrue(demodulated[i].startswith("000000000000aaaaaa"))
|
||||
|
||||
def test_vw(self):
|
||||
path = self.get_path("vw_auf.complex")
|
||||
if not path:
|
||||
return
|
||||
|
||||
data = Signal(path, "").iq_array
|
||||
|
||||
result = AutoInterpretation.estimate(data)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
self.assertEqual(mod_type, "ASK")
|
||||
self.assertGreaterEqual(bit_length, 2000)
|
||||
self.assertLessEqual(bit_length, 3000)
|
||||
|
||||
demodulated = demodulate(data, mod_type, bit_length, center, noise, tolerance)
|
||||
print(demodulated)
|
||||
self.assertEqual(len(demodulated), 1)
|
||||
self.assertTrue(demodulated[0].startswith("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))
|
@ -0,0 +1,104 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tests.auto_interpretation.auto_interpretation_test_util import demodulate
|
||||
from tests.test_util import get_path_for_data_file
|
||||
from urh import settings
|
||||
from urh.ainterpretation import AutoInterpretation
|
||||
from urh.signalprocessing.Encoding import Encoding
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
|
||||
|
||||
class TestAutoInterpretationIntegration(unittest.TestCase):
|
||||
def test_auto_interpretation_fsk(self):
|
||||
fsk_signal = np.fromfile(get_path_for_data_file("fsk.complex"), dtype=np.float32)
|
||||
result = AutoInterpretation.estimate(fsk_signal)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
self.assertEqual(mod_type, "FSK")
|
||||
self.assertEqual(bit_length, 100)
|
||||
self.assertGreater(tolerance, 0)
|
||||
self.assertLessEqual(tolerance, 5)
|
||||
|
||||
self.assertEqual(demodulate(fsk_signal, mod_type, bit_length, center, noise, tolerance)[0],
|
||||
"aaaaaaaac626c626f4dc1d98eef7a427999cd239d3f18")
|
||||
|
||||
def test_auto_interpretation_ask(self):
|
||||
ask_signal = np.fromfile(get_path_for_data_file("ask.complex"), dtype=np.float32)
|
||||
result = AutoInterpretation.estimate(ask_signal)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
self.assertEqual(mod_type, "ASK")
|
||||
self.assertEqual(bit_length, 300)
|
||||
self.assertGreater(tolerance, 0)
|
||||
self.assertLessEqual(tolerance, 6)
|
||||
|
||||
self.assertEqual(demodulate(ask_signal, mod_type, bit_length, center, noise, tolerance)[0], "b25b6db6c80")
|
||||
|
||||
def test_auto_interpretation_overshoot_ook(self):
|
||||
data = Signal(get_path_for_data_file("ook_overshoot.complex16s"), "").iq_array
|
||||
result = AutoInterpretation.estimate(data)
|
||||
self.assertEqual(result["modulation_type"], "ASK")
|
||||
self.assertEqual(result["bit_length"], 500)
|
||||
|
||||
def test_auto_interpretation_enocean(self):
|
||||
enocean_signal = np.fromfile(get_path_for_data_file("enocean.complex"), dtype=np.float32)
|
||||
result = AutoInterpretation.estimate(enocean_signal)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
self.assertEqual(mod_type, "ASK")
|
||||
self.assertGreaterEqual(center, 0.0077)
|
||||
self.assertLessEqual(center, 0.0465)
|
||||
self.assertLessEqual(tolerance, 5)
|
||||
self.assertEqual(bit_length, 40)
|
||||
|
||||
demod = demodulate(enocean_signal, mod_type, bit_length, center, noise, tolerance,
|
||||
decoding=Encoding(["WSP", settings.DECODING_ENOCEAN]))
|
||||
self.assertEqual(len(demod), 3)
|
||||
self.assertEqual(demod[0], demod[2])
|
||||
self.assertEqual(demod[0], "aa9610002c1c024b")
|
||||
|
||||
def test_auto_interpretation_xavax(self):
|
||||
signal = Signal(get_path_for_data_file("xavax.coco"), "")
|
||||
result = AutoInterpretation.estimate(signal.iq_array.data)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
self.assertEqual(mod_type, "FSK")
|
||||
self.assertEqual(bit_length, 100)
|
||||
demod = demodulate(signal.iq_array.data, mod_type, bit_length, center, noise, tolerance)
|
||||
self.assertGreaterEqual(len(demod), 5)
|
||||
|
||||
for i in range(1, len(demod)):
|
||||
self.assertTrue(demod[i].startswith("aaaaaaaa"))
|
||||
|
||||
def test_auto_interpretation_elektromaten(self):
|
||||
data = Signal(get_path_for_data_file("elektromaten.complex16s"), "").iq_array
|
||||
result = AutoInterpretation.estimate(data)
|
||||
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
self.assertEqual(mod_type, "ASK")
|
||||
self.assertEqual(bit_length, 600)
|
||||
|
||||
demodulated = demodulate(data, mod_type, bit_length, center, noise, tolerance, pause_threshold=8)
|
||||
self.assertEqual(len(demodulated), 11)
|
||||
for i in range(11):
|
||||
self.assertTrue(demodulated[i].startswith("8"))
|
||||
|
||||
def test_auto_interpretation_homematic(self):
|
||||
data = Signal(get_path_for_data_file("homematic.complex32s"), "").iq_array
|
||||
|
||||
result = AutoInterpretation.estimate(data)
|
||||
mod_type, bit_length = result["modulation_type"], result["bit_length"]
|
||||
center, noise, tolerance = result["center"], result["noise"], result["tolerance"]
|
||||
|
||||
self.assertEqual(mod_type, "FSK")
|
||||
self.assertEqual(bit_length, 100)
|
||||
|
||||
demodulated = demodulate(data, mod_type, bit_length, center, noise, tolerance)
|
||||
self.assertEqual(len(demodulated), 2)
|
||||
for i in range(2):
|
||||
self.assertTrue(demodulated[i].startswith("aaaaaaaa"))
|
@ -0,0 +1,54 @@
|
||||
import unittest
|
||||
import numpy as np
|
||||
|
||||
from urh.ainterpretation import AutoInterpretation
|
||||
|
||||
class TestAutoInterpretation(unittest.TestCase):
|
||||
def __run_merge(self, data):
|
||||
return list(AutoInterpretation.merge_plateau_lengths(np.array(data, dtype=np.uint64)))
|
||||
|
||||
def test_merge_plateau_lengths(self):
|
||||
self.assertEqual(AutoInterpretation.merge_plateau_lengths([]), [])
|
||||
self.assertEqual(AutoInterpretation.merge_plateau_lengths([42]), [42])
|
||||
self.assertEqual(AutoInterpretation.merge_plateau_lengths([100, 100, 100]), [100, 100, 100])
|
||||
self.assertEqual(self.__run_merge([100, 49, 1, 50, 100]), [100, 100, 100])
|
||||
self.assertEqual(self.__run_merge([100, 48, 2, 50, 100]), [100, 100, 100])
|
||||
self.assertEqual(self.__run_merge([100, 100, 67, 1, 10, 1, 21]), [100, 100, 100])
|
||||
self.assertEqual(self.__run_merge([100, 100, 67, 1, 10, 1, 21, 100, 50, 1, 49]), [100, 100, 100, 100, 100])
|
||||
|
||||
def test_estimate_tolerance_from_plateau_lengths(self):
|
||||
self.assertEqual(AutoInterpretation.estimate_tolerance_from_plateau_lengths([]), None)
|
||||
self.assertEqual(AutoInterpretation.estimate_tolerance_from_plateau_lengths([10]), None)
|
||||
self.assertEqual(AutoInterpretation.estimate_tolerance_from_plateau_lengths([100, 49, 1, 50, 100]), 1)
|
||||
self.assertEqual(AutoInterpretation.estimate_tolerance_from_plateau_lengths([100, 49, 2, 50, 100]), 2)
|
||||
self.assertEqual(AutoInterpretation.estimate_tolerance_from_plateau_lengths([100, 49, 2, 50, 100, 1]), 2)
|
||||
self.assertEqual(AutoInterpretation.estimate_tolerance_from_plateau_lengths([8, 8, 6, 1, 1]), 1)
|
||||
|
||||
def test_tolerant_greatest_common_divisor(self):
|
||||
self.assertEqual(AutoInterpretation.get_tolerant_greatest_common_divisor([]), 1)
|
||||
self.assertEqual(AutoInterpretation.get_tolerant_greatest_common_divisor([22]), 1)
|
||||
self.assertEqual(AutoInterpretation.get_tolerant_greatest_common_divisor([10, 5, 5]), 5)
|
||||
self.assertEqual(AutoInterpretation.get_tolerant_greatest_common_divisor([100, 100, 100]), 100)
|
||||
self.assertEqual(AutoInterpretation.get_tolerant_greatest_common_divisor([100, 100, 200, 300, 100, 400]), 100)
|
||||
self.assertEqual(AutoInterpretation.get_tolerant_greatest_common_divisor([100, 101, 100, 100]), 100)
|
||||
self.assertEqual(AutoInterpretation.get_tolerant_greatest_common_divisor([100, 101, 202, 301, 100, 500]), 100)
|
||||
|
||||
def test_get_bit_length_from_plateau_length(self):
|
||||
self.assertEqual(AutoInterpretation.get_bit_length_from_plateau_lengths([]), 0)
|
||||
self.assertEqual(AutoInterpretation.get_bit_length_from_plateau_lengths([42]), 42)
|
||||
plateau_lengths = np.array([2, 1, 2, 73, 1, 26, 100, 40, 1, 59, 100, 47, 1, 52, 67, 1, 10, 1, 21, 33, 1, 66, 100, 5, 1, 3, 1, 48, 1, 27, 1, 8], dtype=np.uint64)
|
||||
merged_lengths = AutoInterpretation.merge_plateau_lengths(plateau_lengths)
|
||||
self.assertEqual(AutoInterpretation.get_bit_length_from_plateau_lengths(merged_lengths), 100)
|
||||
|
||||
|
||||
plateau_lengths = np.array([1, 292, 331, 606, 647, 286, 645, 291, 334, 601, 339, 601, 338, 602, 337, 603, 338, 604, 336, 605, 337, 600, 338, 605, 646], dtype=np.uint64)
|
||||
merged_lengths = AutoInterpretation.merge_plateau_lengths(plateau_lengths)
|
||||
self.assertEqual(AutoInterpretation.get_bit_length_from_plateau_lengths(merged_lengths), 300)
|
||||
|
||||
plateau_lengths = np.array([3, 8, 8, 8, 8, 8, 8, 8, 8, 16, 8, 8, 16, 32, 8, 8, 8, 8, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 16, 16, 24, 8], dtype=np.uint64)
|
||||
merged_lengths = AutoInterpretation.merge_plateau_lengths(plateau_lengths)
|
||||
self.assertEqual(AutoInterpretation.get_bit_length_from_plateau_lengths(merged_lengths), 8)
|
||||
|
||||
def test_get_bit_length_from_merged_plateau_lengths(self):
|
||||
merged_lengths = np.array([40, 40, 40, 40, 40, 30, 50, 30, 90, 40, 40, 80, 160, 30, 50, 30], dtype=np.uint64)
|
||||
self.assertEqual(AutoInterpretation.get_bit_length_from_plateau_lengths(merged_lengths), 40)
|
@ -0,0 +1,118 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tests.test_util import get_path_for_data_file
|
||||
from urh.ainterpretation.AutoInterpretation import detect_center
|
||||
from urh.cythonext.signal_functions import afp_demod
|
||||
|
||||
from urh.signalprocessing.Filter import Filter, FilterType
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
|
||||
|
||||
class TestCenterDetection(unittest.TestCase):
|
||||
def test_noiseless_rect(self):
|
||||
def generate_rectangular_signal(bits: str, bit_len: int):
|
||||
result = np.zeros(len(bits) * bit_len, dtype=np.float32)
|
||||
for i, bit in enumerate(bits):
|
||||
if int(bit) != 0:
|
||||
result[i * bit_len:(i + 1) * bit_len] = np.ones(bit_len, dtype=np.int8)
|
||||
return result
|
||||
|
||||
rect = generate_rectangular_signal("101010111100011", bit_len=10)
|
||||
center = detect_center(rect)
|
||||
self.assertGreaterEqual(center, 0.4)
|
||||
self.assertLessEqual(center, 0.6)
|
||||
|
||||
def test_noisy_rect(self):
|
||||
data = Signal(get_path_for_data_file("fsk.complex")).iq_array.data
|
||||
rect = afp_demod(data, 0.008, "FSK", 2)[5:15000]
|
||||
|
||||
center = detect_center(rect)
|
||||
self.assertGreaterEqual(center, -0.0587)
|
||||
self.assertLessEqual(center, 0.02)
|
||||
|
||||
def test_ask_center_detection(self):
|
||||
data = Signal(get_path_for_data_file("ask.complex")).iq_array.data
|
||||
rect = afp_demod(data, 0.01111, "ASK", 2)
|
||||
|
||||
center = detect_center(rect)
|
||||
self.assertGreaterEqual(center, 0)
|
||||
self.assertLessEqual(center, 0.06)
|
||||
|
||||
def test_enocean_center_detection(self):
|
||||
data = Signal(get_path_for_data_file("enocean.complex")).iq_array.data
|
||||
rect = afp_demod(data, 0.05, "ASK", 2)
|
||||
messages = [rect[2107:5432], rect[20428:23758], rect[44216:47546]]
|
||||
|
||||
for i, msg in enumerate(messages):
|
||||
center = detect_center(msg)
|
||||
self.assertGreaterEqual(center, 0.04, msg=str(i))
|
||||
self.assertLessEqual(center, 0.072, msg=str(i))
|
||||
|
||||
def test_ask_50_center_detection(self):
|
||||
message_indices = [(0, 8000), (18000, 26000), (36000, 44000), (54000, 62000), (72000, 80000)]
|
||||
|
||||
data = Signal(get_path_for_data_file("ask50.complex")).iq_array.data
|
||||
rect = afp_demod(data, 0.0509, "ASK", 2)
|
||||
|
||||
for start, end in message_indices:
|
||||
center = detect_center(rect[start:end])
|
||||
self.assertGreaterEqual(center, 0.4, msg="{}/{}".format(start, end))
|
||||
self.assertLessEqual(center, 0.65, msg="{}/{}".format(start, end))
|
||||
|
||||
def test_homematic_center_detection(self):
|
||||
data = Signal(get_path_for_data_file("homematic.complex32s"), "").iq_array.data
|
||||
rect = afp_demod(data, 0.0012, "FSK", 2)
|
||||
|
||||
msg1 = rect[17719:37861]
|
||||
msg2 = rect[70412:99385]
|
||||
|
||||
center1 = detect_center(msg1)
|
||||
self.assertGreaterEqual(center1, -0.1285)
|
||||
self.assertLessEqual(center1, -0.0413)
|
||||
|
||||
center2 = detect_center(msg2)
|
||||
self.assertGreaterEqual(center2, -0.1377)
|
||||
self.assertLessEqual(center2, -0.0367)
|
||||
|
||||
def test_noised_homematic_center_detection(self):
|
||||
data = Signal(get_path_for_data_file("noised_homematic.complex"), "").iq_array.data
|
||||
rect = afp_demod(data, 0.0, "FSK", 2)
|
||||
|
||||
center = detect_center(rect)
|
||||
|
||||
self.assertGreater(center, -0.0148)
|
||||
self.assertLess(center, 0.0024)
|
||||
|
||||
def test_fsk_15db_center_detection(self):
|
||||
data = Signal(get_path_for_data_file("FSK15.complex"), "").iq_array.data
|
||||
rect = afp_demod(data, 0, "FSK", 2)
|
||||
center = detect_center(rect)
|
||||
self.assertGreaterEqual(center, -0.1979)
|
||||
self.assertLessEqual(center, 0.1131)
|
||||
|
||||
def test_fsk_10db_center_detection(self):
|
||||
data = Signal(get_path_for_data_file("FSK10.complex"), "").iq_array.data
|
||||
rect = afp_demod(data, 0, "FSK", 2)
|
||||
center = detect_center(rect)
|
||||
self.assertGreaterEqual(center, -0.1413)
|
||||
self.assertLessEqual(center, 0.05)
|
||||
|
||||
def test_fsk_live_capture(self):
|
||||
data = Signal(get_path_for_data_file("fsk_live.coco"), "").iq_array.data
|
||||
|
||||
n = 10
|
||||
moving_average_filter = Filter([1/n for _ in range(n)], filter_type=FilterType.moving_average)
|
||||
filtered_data = moving_average_filter.apply_fir_filter(data.flatten()).view(np.float32)
|
||||
filtered_data = filtered_data.reshape((len(filtered_data)//2, 2))
|
||||
|
||||
rect = afp_demod(filtered_data, 0.0175, "FSK", 2)
|
||||
center = detect_center(rect)
|
||||
self.assertGreaterEqual(center, -0.0148, msg="Filtered")
|
||||
self.assertLessEqual(center, 0.01, msg="Filtered")
|
||||
|
||||
rect = afp_demod(data, 0.0175, "FSK", 2)
|
||||
center = detect_center(rect)
|
||||
self.assertGreaterEqual(center, -0.02, msg="Original")
|
||||
self.assertLessEqual(center, 0.01, msg="Original")
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,79 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tests.test_util import get_path_for_data_file
|
||||
from urh.ainterpretation.AutoInterpretation import segment_messages_from_magnitudes, merge_message_segments_for_ook
|
||||
from urh.signalprocessing.IQArray import IQArray
|
||||
from urh.signalprocessing.Modulator import Modulator
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
|
||||
|
||||
class TestMessageSegmentation(unittest.TestCase):
|
||||
def test_segmentation_for_fsk(self):
|
||||
signal = np.fromfile(get_path_for_data_file("fsk.complex"), dtype=np.complex64)
|
||||
segments = segment_messages_from_magnitudes(np.abs(signal), 0.0009)
|
||||
self.assertEqual(len(segments), 1)
|
||||
self.assertEqual(segments[0], (0, 17742))
|
||||
|
||||
def test_segmentation_for_ask(self):
|
||||
signal = np.fromfile(get_path_for_data_file("ask.complex"), dtype=np.complex64)
|
||||
segments = segment_messages_from_magnitudes(np.abs(signal), 0.02)
|
||||
segments = merge_message_segments_for_ook(segments)
|
||||
self.assertEqual(len(segments), 1)
|
||||
self.assertEqual(segments[0], (462, 12011))
|
||||
|
||||
def test_segmentation_enocean_multiple_messages(self):
|
||||
signal = np.fromfile(get_path_for_data_file("enocean.complex"), dtype=np.complex64)
|
||||
segments = segment_messages_from_magnitudes(np.abs(signal), 0.0448)
|
||||
segments = merge_message_segments_for_ook(segments)
|
||||
self.assertEqual(len(segments), 3)
|
||||
self.assertEqual(segments[0], (2107, 5432))
|
||||
self.assertEqual(segments[1], (20428, 23758))
|
||||
self.assertEqual(segments[2], (44216, 47546))
|
||||
|
||||
def test_message_segmentation_fsk_xavax(self):
|
||||
signal = Signal(get_path_for_data_file("xavax.coco"), "")
|
||||
segments = segment_messages_from_magnitudes(signal.iq_array.magnitudes, noise_threshold=0.002)
|
||||
|
||||
# Signal starts with overdrive, so one message more
|
||||
self.assertTrue(len(segments) == 6 or len(segments) == 7)
|
||||
if len(segments) == 7:
|
||||
segments = segments[1:]
|
||||
|
||||
self.assertEqual(segments,
|
||||
[(275146, 293697), (321073, 338819), (618213, 1631898), (1657890, 1678041), (1803145, 1820892),
|
||||
(1846213, 1866364)])
|
||||
|
||||
def test_segmentation_ask_50(self):
|
||||
modulator = Modulator("ask50")
|
||||
modulator.modulation_type = "ASK"
|
||||
modulator.parameters[0] = 50
|
||||
modulator.parameters[1] = 100
|
||||
modulator.samples_per_symbol = 100
|
||||
|
||||
msg1 = modulator.modulate("1010101111", pause=10000)
|
||||
msg2 = modulator.modulate("1010101110010101", pause=20000)
|
||||
msg3 = modulator.modulate("1010101010101111", pause=30000)
|
||||
|
||||
data = IQArray.concatenate((msg1, msg2, msg3))
|
||||
|
||||
segments = segment_messages_from_magnitudes(data.magnitudes, noise_threshold=0)
|
||||
self.assertEqual(len(segments), 3)
|
||||
self.assertEqual(segments, [(0, 999), (10999, 12599), (32599, 34199)])
|
||||
|
||||
def test_segmentation_elektromaten(self):
|
||||
signal = Signal(get_path_for_data_file("elektromaten.complex16s"), "")
|
||||
|
||||
signal.noise_threshold_relative = 0.1
|
||||
|
||||
segments = segment_messages_from_magnitudes(signal.iq_array.magnitudes, noise_threshold=signal.noise_threshold)
|
||||
segments = merge_message_segments_for_ook(segments)
|
||||
|
||||
self.assertEqual(len(segments), 11)
|
||||
|
||||
def test_ook_merge(self):
|
||||
input = [(26728, 27207), (28716, 29216), (30712, 32190), (32695, 34178), (34686, 35181), (36683, 38181), (38670, 39165), (40668, 42154), (42659, 44151), (44642, 46139), (46634, 47121), (47134, 47145), (48632, 50129), (50617, 51105), (52612, 54089), (54100, 54113), (54601, 56095), (56592, 58075), (58581, 59066), (59076, 59091), (60579, 61081), (62567, 64063), (64559, 66053), (66548, 67035), (68539, 69031), (70533, 71035), (72527, 73008), (73019, 73035), (74522, 75006), (90465, 90958), (92456, 92944), (94455, 95935), (96441, 97930), (98437, 98937), (100430, 101914), (102414, 102901), (104413, 105889), (106398, 107895), (108389, 109873), (110385, 110877), (112374, 113853), (114367, 114862), (116355, 117842), (118344, 119826), (120340, 121824), (122324, 122825), (124323, 124821), (126316, 127807), (128300, 129782), (130293, 130777), (132280, 132774), (134275, 134773), (136266, 136767), (138265, 138751), (154205, 154694), (156206, 156703), (158191, 159685), (160189, 161683), (162176, 162667), (164164, 165657), (166159, 166648), (168147, 169631), (170145, 171621), (172131, 173611), (174125, 174607), (176118, 177600), (178105, 178590), (180093, 181574), (181585, 181599), (182090, 183573), (184074, 185565), (186070, 186553), (188061, 188555), (190052, 191533), (192043, 193523), (194034, 194518), (196021, 196510), (198012, 198503), (200014, 200496), (202003, 202485), (202498, 202511), (217953, 218430), (218442, 218457), (219940, 220426), (221935, 223431), (223926, 225409), (225912, 226399), (227912, 229387), (229896, 230382), (231886, 233369), (233383, 233393), (233882, 235375), (235874, 237357), (237858, 238361), (239850, 241343), (241844, 242328), (243840, 245331), (245828, 247306), (247820, 249296), (249811, 250298), (251803, 252283), (252296, 252309), (253790, 255271), (255778, 257276), (257774, 258258), (259764, 260257), (261760, 262239), (263744, 264241), (265744, 266225), (281684, 282171), (283676, 284163), (285668, 287153), (287665, 289149), (289654, 290145), (291642, 293131), (293633, 294120), (295629, 297104), (297116, 297129)]
|
||||
|
||||
merged = merge_message_segments_for_ook(input)
|
||||
self.assertEqual(len(merged), 5)
|
@ -0,0 +1,41 @@
|
||||
import unittest
|
||||
from tests.test_util import get_path_for_data_file
|
||||
from urh.ainterpretation import AutoInterpretation
|
||||
import numpy as np
|
||||
|
||||
from urh.signalprocessing.Modulator import Modulator
|
||||
|
||||
|
||||
class TestModulationDetection(unittest.TestCase):
|
||||
def test_fsk_detection(self):
|
||||
fsk_signal = np.fromfile(get_path_for_data_file("fsk.complex"), dtype=np.complex64)[5:15000]
|
||||
|
||||
mod = AutoInterpretation.detect_modulation(fsk_signal, wavelet_scale=4, median_filter_order=7)
|
||||
self.assertEqual(mod, "FSK")
|
||||
|
||||
def test_ook_detection(self):
|
||||
data = np.fromfile(get_path_for_data_file("ask.complex"), dtype=np.complex64)
|
||||
mod = AutoInterpretation.detect_modulation(data)
|
||||
self.assertEqual(mod, "OOK")
|
||||
|
||||
data = np.fromfile(get_path_for_data_file("ASK_mod.complex"), dtype=np.complex64)
|
||||
mod = AutoInterpretation.detect_modulation(data)
|
||||
self.assertEqual(mod, "OOK")
|
||||
|
||||
def test_ask50_detection(self):
|
||||
message_indices = [(0, 8000), (18000, 26000), (36000, 44000), (54000, 62000), (72000, 80000)]
|
||||
data = np.fromfile(get_path_for_data_file("ask50.complex"), dtype=np.complex64)
|
||||
|
||||
for start, end in message_indices:
|
||||
mod = AutoInterpretation.detect_modulation(data[start:end])
|
||||
self.assertEqual(mod, "ASK", msg="{}/{}".format(start, end))
|
||||
|
||||
def test_psk_detection(self):
|
||||
modulator = Modulator("")
|
||||
modulator.modulation_type = "PSK"
|
||||
modulator.parameters[0] = -90
|
||||
modulator.parameters[1] = 90
|
||||
|
||||
data = modulator.modulate("10101010111000")
|
||||
mod = AutoInterpretation.detect_modulation(data)
|
||||
self.assertEqual(mod, "PSK")
|
@ -0,0 +1,56 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
from urh.ainterpretation.AutoInterpretation import detect_noise_level
|
||||
from tests.test_util import get_path_for_data_file
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
|
||||
|
||||
class TestNoiseDetection(unittest.TestCase):
|
||||
def test_for_fsk_signal(self):
|
||||
data = np.fromfile(get_path_for_data_file("fsk.complex"), dtype=np.complex64)
|
||||
noise_level = detect_noise_level(np.abs(data))
|
||||
self.assertGreaterEqual(noise_level, 0.0005)
|
||||
self.assertLessEqual(noise_level, 0.009)
|
||||
|
||||
def test_for_ask_signal(self):
|
||||
data = np.fromfile(get_path_for_data_file("ask.complex"), dtype=np.complex64)
|
||||
noise_level = detect_noise_level(np.abs(data))
|
||||
self.assertGreaterEqual(noise_level, 0.0110)
|
||||
self.assertLessEqual(noise_level, 0.043)
|
||||
|
||||
def test_for_fsk_signal_with_little_noise_before_and_after(self):
|
||||
data = np.concatenate((np.fromfile(get_path_for_data_file("fsk.complex"), dtype=np.complex64)[-1000:],
|
||||
np.fromfile(get_path_for_data_file("fsk.complex"), dtype=np.complex64)[0:18800]))
|
||||
noise_level = detect_noise_level(np.abs(data))
|
||||
self.assertGreaterEqual(noise_level, 0.0005)
|
||||
self.assertLessEqual(noise_level, 0.009)
|
||||
|
||||
def test_for_enocean_ask_signal(self):
|
||||
data = np.fromfile(get_path_for_data_file("enocean.complex"), dtype=np.complex64)
|
||||
noise_level = detect_noise_level(np.abs(data))
|
||||
self.assertGreaterEqual(noise_level, 0.01)
|
||||
self.assertLessEqual(noise_level, 0.28)
|
||||
|
||||
def test_for_noiseless_signal(self):
|
||||
data = np.fromfile(get_path_for_data_file("fsk.complex"), dtype=np.complex64)[0:17639]
|
||||
noise_level = detect_noise_level(np.abs(data))
|
||||
self.assertEqual(noise_level, 0)
|
||||
|
||||
def test_multi_messages_different_rssi(self):
|
||||
data = Signal(get_path_for_data_file("multi_messages_different_rssi.coco"), "").iq_array.data
|
||||
noise_level = detect_noise_level(np.abs(data))
|
||||
self.assertGreater(noise_level, 0.001)
|
||||
self.assertLess(noise_level, 0.002)
|
||||
|
||||
def test_for_psk_signal(self):
|
||||
data = Signal(get_path_for_data_file("psk_generated.complex"), "").iq_array.data
|
||||
noise_level = detect_noise_level(np.abs(data))
|
||||
self.assertGreater(noise_level, 0.0067)
|
||||
self.assertLessEqual(noise_level, 0.0081)
|
||||
|
||||
def test_for_noisy_fsk_15db_signal(self):
|
||||
data = Signal(get_path_for_data_file("FSK15.complex"), "").iq_array.data
|
||||
noise_level = detect_noise_level(np.abs(data))
|
||||
self.assertEqual(noise_level, 0)
|
65
Software/Universal Radio Hacker/tests/awre/AWRETestCase.py
Normal file
65
Software/Universal Radio Hacker/tests/awre/AWRETestCase.py
Normal file
@ -0,0 +1,65 @@
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
import numpy
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
|
||||
from tests.utils_testing import get_path_for_data_file
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
|
||||
from urh.signalprocessing.MessageType import MessageType
|
||||
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
|
||||
|
||||
class AWRETestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
numpy.set_printoptions(linewidth=80)
|
||||
self.field_types = self.__init_field_types()
|
||||
|
||||
def get_format_finder_from_protocol_file(self, filename: str, clear_participant_addresses=True, return_messages=False):
|
||||
proto_file = get_path_for_data_file(filename)
|
||||
protocol = ProtocolAnalyzer(signal=None, filename=proto_file)
|
||||
protocol.from_xml_file(filename=proto_file, read_bits=True)
|
||||
|
||||
self.clear_message_types(protocol.messages)
|
||||
|
||||
ff = FormatFinder(protocol.messages)
|
||||
if clear_participant_addresses:
|
||||
ff.known_participant_addresses.clear()
|
||||
|
||||
if return_messages:
|
||||
return ff, protocol.messages
|
||||
else:
|
||||
return ff
|
||||
|
||||
@staticmethod
|
||||
def __init_field_types():
|
||||
result = []
|
||||
for field_type_function in FieldType.Function:
|
||||
result.append(FieldType(field_type_function.value, field_type_function))
|
||||
return result
|
||||
|
||||
@staticmethod
|
||||
def clear_message_types(messages: list):
|
||||
mt = MessageType("empty")
|
||||
for msg in messages:
|
||||
msg.message_type = mt
|
||||
|
||||
@staticmethod
|
||||
def save_protocol(name, protocol_generator, silent=False):
|
||||
filename = os.path.join(tempfile.gettempdir(), name + ".proto")
|
||||
if isinstance(protocol_generator, ProtocolGenerator):
|
||||
protocol_generator.to_file(filename)
|
||||
elif isinstance(protocol_generator, ProtocolAnalyzer):
|
||||
participants = list(set(msg.participant for msg in protocol_generator.messages))
|
||||
protocol_generator.to_xml_file(filename, [], participants=participants, write_bits=True)
|
||||
info = "Protocol written to " + filename
|
||||
if not silent:
|
||||
print()
|
||||
print("-" * len(info))
|
||||
print(info)
|
||||
print("-" * len(info))
|
791
Software/Universal Radio Hacker/tests/awre/AWRExperiments.py
Normal file
791
Software/Universal Radio Hacker/tests/awre/AWRExperiments.py
Normal file
@ -0,0 +1,791 @@
|
||||
import array
|
||||
import multiprocessing
|
||||
import os
|
||||
import random
|
||||
import time
|
||||
from collections import defaultdict
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from tests.utils_testing import get_path_for_data_file
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.Preprocessor import Preprocessor
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.awre.engines.Engine import Engine
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.signalprocessing.Message import Message
|
||||
from urh.signalprocessing.MessageType import MessageType
|
||||
from urh.signalprocessing.Participant import Participant
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
from urh.util.GenericCRC import GenericCRC
|
||||
|
||||
|
||||
def run_for_num_broken(protocol_nr, num_broken: list, num_messages: int, num_runs: int) -> list:
|
||||
random.seed(0)
|
||||
np.random.seed(0)
|
||||
|
||||
result = []
|
||||
for broken in num_broken:
|
||||
tmp_accuracies = np.empty(num_runs, dtype=np.float64)
|
||||
tmp_accuracies_without_broken = np.empty(num_runs, dtype=np.float64)
|
||||
for i in range(num_runs):
|
||||
protocol, expected_labels = AWRExperiments.get_protocol(protocol_nr,
|
||||
num_messages=num_messages,
|
||||
num_broken_messages=broken,
|
||||
silent=True)
|
||||
|
||||
AWRExperiments.run_format_finder_for_protocol(protocol)
|
||||
accuracy = AWRExperiments.calculate_accuracy(protocol.messages, expected_labels)
|
||||
accuracy_without_broken = AWRExperiments.calculate_accuracy(protocol.messages, expected_labels, broken)
|
||||
tmp_accuracies[i] = accuracy
|
||||
tmp_accuracies_without_broken[i] = accuracy_without_broken
|
||||
|
||||
avg_accuracy = np.mean(tmp_accuracies)
|
||||
avg_accuracy_without_broken = np.mean(tmp_accuracies_without_broken)
|
||||
|
||||
result.append((avg_accuracy, avg_accuracy_without_broken))
|
||||
print("Protocol {} with {} broken: {:>3}% {:>3}%".format(protocol_nr, broken, int(avg_accuracy),
|
||||
int(avg_accuracy_without_broken)))
|
||||
|
||||
return result
|
||||
|
||||
|
||||
class AWRExperiments(AWRETestCase):
|
||||
@staticmethod
|
||||
def _prepare_protocol_1() -> ProtocolGenerator:
|
||||
alice = Participant("Alice", address_hex="dead")
|
||||
bob = Participant("Bob", address_hex="beef")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x1337"},
|
||||
participants=[alice, bob])
|
||||
return pg
|
||||
|
||||
@staticmethod
|
||||
def _prepare_protocol_2() -> ProtocolGenerator:
|
||||
alice = Participant("Alice", address_hex="dead01")
|
||||
bob = Participant("Bob", address_hex="beef24")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 72)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 24)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 24)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x1337"},
|
||||
preambles_by_mt={mb.message_type: "10" * 36},
|
||||
sequence_number_increment=32,
|
||||
participants=[alice, bob])
|
||||
|
||||
return pg
|
||||
|
||||
@staticmethod
|
||||
def _prepare_protocol_3() -> ProtocolGenerator:
|
||||
alice = Participant("Alice", address_hex="1337")
|
||||
bob = Participant("Bob", address_hex="beef")
|
||||
|
||||
checksum = GenericCRC.from_standard_checksum("CRC8 CCITT")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
mb.add_label(FieldType.Function.DATA, 10 * 8)
|
||||
mb.add_checksum_label(8, checksum)
|
||||
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_ack.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb_ack.add_checksum_label(8, checksum)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb_ack.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a7d", mb_ack.message_type: "0x9a7d"},
|
||||
preambles_by_mt={mb.message_type: "10" * 8, mb_ack.message_type: "10" * 8},
|
||||
participants=[alice, bob])
|
||||
|
||||
return pg
|
||||
|
||||
@staticmethod
|
||||
def _prepare_protocol_4() -> ProtocolGenerator:
|
||||
alice = Participant("Alice", address_hex="1337")
|
||||
bob = Participant("Bob", address_hex="beef")
|
||||
|
||||
checksum = GenericCRC.from_standard_checksum("CRC16 CCITT")
|
||||
|
||||
mb = MessageTypeBuilder("data1")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DATA, 8 * 8)
|
||||
mb.add_checksum_label(16, checksum)
|
||||
|
||||
mb2 = MessageTypeBuilder("data2")
|
||||
mb2.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb2.add_label(FieldType.Function.SYNC, 16)
|
||||
mb2.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb2.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb2.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb2.add_label(FieldType.Function.DATA, 64 * 8)
|
||||
mb2.add_checksum_label(16, checksum)
|
||||
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_ack.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb_ack.add_checksum_label(16, checksum)
|
||||
|
||||
mt1, mt2, mt3 = mb.message_type, mb2.message_type, mb_ack.message_type
|
||||
|
||||
preamble = "10001000" * 2
|
||||
|
||||
pg = ProtocolGenerator([mt1, mt2, mt3],
|
||||
syncs_by_mt={mt1: "0x9a7d", mt2: "0x9a7d", mt3: "0x9a7d"},
|
||||
preambles_by_mt={mt1: preamble, mt2: preamble, mt3: preamble},
|
||||
participants=[alice, bob])
|
||||
|
||||
return pg
|
||||
|
||||
@staticmethod
|
||||
def _prepare_protocol_5() -> ProtocolGenerator:
|
||||
alice = Participant("Alice", address_hex="1337")
|
||||
bob = Participant("Bob", address_hex="beef")
|
||||
carl = Participant("Carl", address_hex="cafe")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_ack.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb_ack.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a7d", mb_ack.message_type: "0x9a7d"},
|
||||
preambles_by_mt={mb.message_type: "10" * 8, mb_ack.message_type: "10" * 8},
|
||||
participants=[alice, bob, carl])
|
||||
|
||||
return pg
|
||||
|
||||
@staticmethod
|
||||
def _prepare_protocol_6() -> ProtocolGenerator:
|
||||
alice = Participant("Alice", address_hex="24")
|
||||
broadcast = Participant("Bob", address_hex="ff")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 8)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x8e88"},
|
||||
preambles_by_mt={mb.message_type: "10" * 8},
|
||||
participants=[alice, broadcast])
|
||||
|
||||
return pg
|
||||
|
||||
@staticmethod
|
||||
def _prepare_protocol_7() -> ProtocolGenerator:
|
||||
alice = Participant("Alice", address_hex="313370")
|
||||
bob = Participant("Bob", address_hex="031337")
|
||||
charly = Participant("Charly", address_hex="110000")
|
||||
daniel = Participant("Daniel", address_hex="001100")
|
||||
# broadcast = Participant("Broadcast", address_hex="ff") #TODO: Sometimes messages to broadcast
|
||||
|
||||
checksum = GenericCRC.from_standard_checksum("CRC16 CC1101")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 24)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 24)
|
||||
mb.add_label(FieldType.Function.DATA, 8 * 8)
|
||||
mb.add_checksum_label(16, checksum)
|
||||
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 24)
|
||||
mb_ack.add_checksum_label(16, checksum)
|
||||
|
||||
mb_kex = MessageTypeBuilder("kex")
|
||||
mb_kex.add_label(FieldType.Function.PREAMBLE, 24)
|
||||
mb_kex.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_kex.add_label(FieldType.Function.DST_ADDRESS, 24)
|
||||
mb_kex.add_label(FieldType.Function.SRC_ADDRESS, 24)
|
||||
mb_kex.add_label(FieldType.Function.DATA, 64 * 8)
|
||||
mb_kex.add_checksum_label(16, checksum)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb_ack.message_type, mb_kex.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x0420", mb_ack.message_type: "0x2222",
|
||||
mb_kex.message_type: "0x6767"},
|
||||
preambles_by_mt={mb.message_type: "10" * 8, mb_ack.message_type: "10" * 4,
|
||||
mb_kex.message_type: "10" * 12},
|
||||
participants=[alice, bob, charly, daniel])
|
||||
|
||||
return pg
|
||||
|
||||
@staticmethod
|
||||
def _prepare_protocol_8() -> ProtocolGenerator:
|
||||
alice = Participant("Alice")
|
||||
|
||||
mb = MessageTypeBuilder("data1")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 4)
|
||||
mb.add_label(FieldType.Function.SYNC, 4)
|
||||
mb.add_label(FieldType.Function.LENGTH, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
mb.add_label(FieldType.Function.DATA, 8 * 542)
|
||||
|
||||
mb2 = MessageTypeBuilder("data2")
|
||||
mb2.add_label(FieldType.Function.PREAMBLE, 4)
|
||||
mb2.add_label(FieldType.Function.SYNC, 4)
|
||||
mb2.add_label(FieldType.Function.LENGTH, 16)
|
||||
mb2.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
mb2.add_label(FieldType.Function.DATA, 8 * 260)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb2.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9", mb2.message_type: "0x9"},
|
||||
preambles_by_mt={mb.message_type: "10" * 2, mb2.message_type: "10" * 2},
|
||||
sequence_number_increment=32,
|
||||
participants=[alice],
|
||||
little_endian=True)
|
||||
|
||||
return pg
|
||||
|
||||
def test_export_to_latex(self):
|
||||
filename = os.path.expanduser("~/GIT/publications/awre/USENIX/protocols.tex")
|
||||
if os.path.isfile(filename):
|
||||
os.remove(filename)
|
||||
|
||||
for i in range(1, 9):
|
||||
pg = getattr(self, "_prepare_protocol_" + str(i))()
|
||||
pg.export_to_latex(filename, i)
|
||||
|
||||
@classmethod
|
||||
def get_protocol(cls, protocol_number: int, num_messages, num_broken_messages=0, silent=False):
|
||||
if protocol_number == 1:
|
||||
pg = cls._prepare_protocol_1()
|
||||
elif protocol_number == 2:
|
||||
pg = cls._prepare_protocol_2()
|
||||
elif protocol_number == 3:
|
||||
pg = cls._prepare_protocol_3()
|
||||
elif protocol_number == 4:
|
||||
pg = cls._prepare_protocol_4()
|
||||
elif protocol_number == 5:
|
||||
pg = cls._prepare_protocol_5()
|
||||
elif protocol_number == 6:
|
||||
pg = cls._prepare_protocol_6()
|
||||
elif protocol_number == 7:
|
||||
pg = cls._prepare_protocol_7()
|
||||
elif protocol_number == 8:
|
||||
pg = cls._prepare_protocol_8()
|
||||
else:
|
||||
raise ValueError("Unknown protocol number")
|
||||
|
||||
messages_types_with_data_field = [mt for mt in pg.protocol.message_types
|
||||
if mt.get_first_label_with_type(FieldType.Function.DATA)]
|
||||
i = -1
|
||||
while len(pg.protocol.messages) < num_messages:
|
||||
i += 1
|
||||
source = pg.participants[i % len(pg.participants)]
|
||||
destination = pg.participants[(i + 1) % len(pg.participants)]
|
||||
if i % 2 == 0:
|
||||
data_bytes = 8
|
||||
else:
|
||||
# data_bytes = 16
|
||||
data_bytes = 64
|
||||
|
||||
if len(messages_types_with_data_field) == 0:
|
||||
# set data automatically
|
||||
data = "".join(random.choice(["0", "1"]) for _ in range(data_bytes * 8))
|
||||
pg.generate_message(data=data, source=source, destination=destination)
|
||||
else:
|
||||
# search for message type with right data length
|
||||
mt = messages_types_with_data_field[i % len(messages_types_with_data_field)]
|
||||
data_length = mt.get_first_label_with_type(FieldType.Function.DATA).length
|
||||
data = "".join(random.choice(["0", "1"]) for _ in range(data_length))
|
||||
pg.generate_message(message_type=mt, data=data, source=source, destination=destination)
|
||||
|
||||
ack_message_type = next((mt for mt in pg.protocol.message_types if "ack" in mt.name), None)
|
||||
if ack_message_type:
|
||||
pg.generate_message(message_type=ack_message_type, data="", source=destination, destination=source)
|
||||
|
||||
for i in range(num_broken_messages):
|
||||
msg = pg.protocol.messages[i]
|
||||
pos = random.randint(0, len(msg.plain_bits) // 2)
|
||||
msg.plain_bits[pos:] = array.array("B",
|
||||
[random.randint(0, 1) for _ in range(len(msg.plain_bits) - pos)])
|
||||
|
||||
if num_broken_messages == 0:
|
||||
cls.save_protocol("protocol{}_{}_messages".format(protocol_number, num_messages), pg, silent=silent)
|
||||
else:
|
||||
cls.save_protocol("protocol{}_{}_broken".format(protocol_number, num_broken_messages), pg, silent=silent)
|
||||
|
||||
expected_message_types = [msg.message_type for msg in pg.protocol.messages]
|
||||
|
||||
# Delete message type information -> no prior knowledge
|
||||
cls.clear_message_types(pg.protocol.messages)
|
||||
|
||||
# Delete data labels if present
|
||||
for mt in expected_message_types:
|
||||
data_lbl = mt.get_first_label_with_type(FieldType.Function.DATA)
|
||||
if data_lbl:
|
||||
mt.remove(data_lbl)
|
||||
|
||||
return pg.protocol, expected_message_types
|
||||
|
||||
@staticmethod
|
||||
def calculate_accuracy(messages, expected_labels, num_broken_messages=0):
|
||||
"""
|
||||
Calculate the accuracy of labels compared to expected labels
|
||||
Accuracy is 100% when labels == expected labels
|
||||
Accuracy drops by 1 / len(expected_labels) for every expected label not present in labels
|
||||
|
||||
:type messages: list of Message
|
||||
:type expected_labels: list of MessageType
|
||||
:return:
|
||||
"""
|
||||
accuracy = sum(len(set(expected_labels[i]) & set(messages[i].message_type)) / len(expected_labels[i])
|
||||
for i in range(num_broken_messages, len(messages)))
|
||||
try:
|
||||
accuracy /= (len(messages) - num_broken_messages)
|
||||
except ZeroDivisionError:
|
||||
accuracy = 0
|
||||
|
||||
return accuracy * 100
|
||||
|
||||
def test_against_num_messages(self):
|
||||
num_messages = list(range(1, 24, 1))
|
||||
accuracies = defaultdict(list)
|
||||
|
||||
protocols = [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
|
||||
random.seed(0)
|
||||
np.random.seed(0)
|
||||
for protocol_nr in protocols:
|
||||
for n in num_messages:
|
||||
protocol, expected_labels = self.get_protocol(protocol_nr, num_messages=n)
|
||||
self.run_format_finder_for_protocol(protocol)
|
||||
|
||||
accuracy = self.calculate_accuracy(protocol.messages, expected_labels)
|
||||
accuracies["protocol {}".format(protocol_nr)].append(accuracy)
|
||||
|
||||
self.__plot(num_messages, accuracies, xlabel="Number of messages", ylabel="Accuracy in %", grid=True)
|
||||
self.__export_to_csv("/tmp/accuray-vs-messages", num_messages, accuracies)
|
||||
|
||||
def test_against_error(self):
|
||||
Engine._DEBUG_ = False
|
||||
Preprocessor._DEBUG_ = False
|
||||
|
||||
num_runs = 100
|
||||
|
||||
num_messages = 30
|
||||
num_broken_messages = list(range(0, num_messages + 1))
|
||||
accuracies = defaultdict(list)
|
||||
accuracies_without_broken = defaultdict(list)
|
||||
|
||||
protocols = [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
|
||||
random.seed(0)
|
||||
np.random.seed(0)
|
||||
|
||||
with multiprocessing.Pool() as p:
|
||||
result = p.starmap(run_for_num_broken,
|
||||
[(i, num_broken_messages, num_messages, num_runs) for i in protocols])
|
||||
for i, acc in enumerate(result):
|
||||
accuracies["protocol {}".format(i + 1)] = [a[0] for a in acc]
|
||||
accuracies_without_broken["protocol {}".format(i + 1)] = [a[1] for a in acc]
|
||||
|
||||
self.__plot(100 * np.array(num_broken_messages) / num_messages, accuracies,
|
||||
title="Overall Accuracy vs percentage of broken messages",
|
||||
xlabel="Broken messages in %",
|
||||
ylabel="Accuracy in %", grid=True)
|
||||
self.__plot(100 * np.array(num_broken_messages) / num_messages, accuracies_without_broken,
|
||||
title=" Accuracy of unbroken vs percentage of broken messages",
|
||||
xlabel="Broken messages in %",
|
||||
ylabel="Accuracy in %", grid=True)
|
||||
self.__export_to_csv("/tmp/accuray-vs-error", num_broken_messages, accuracies, relative=num_messages)
|
||||
self.__export_to_csv("/tmp/accuray-vs-error-without-broken", num_broken_messages, accuracies_without_broken,
|
||||
relative=num_messages)
|
||||
|
||||
def test_performance(self):
|
||||
Engine._DEBUG_ = False
|
||||
Preprocessor._DEBUG_ = False
|
||||
|
||||
num_messages = list(range(200, 205, 5))
|
||||
protocols = [1]
|
||||
|
||||
random.seed(0)
|
||||
np.random.seed(0)
|
||||
|
||||
performances = defaultdict(list)
|
||||
|
||||
for protocol_nr in protocols:
|
||||
print("Running for protocol", protocol_nr)
|
||||
for messages in num_messages:
|
||||
protocol, _ = self.get_protocol(protocol_nr, messages, silent=True)
|
||||
|
||||
t = time.time()
|
||||
self.run_format_finder_for_protocol(protocol)
|
||||
performances["protocol {}".format(protocol_nr)].append(time.time() - t)
|
||||
|
||||
# self.__plot(num_messages, performances, xlabel="Number of messages", ylabel="Time in seconds", grid=True)
|
||||
|
||||
def test_performance_real_protocols(self):
|
||||
Engine._DEBUG_ = False
|
||||
Preprocessor._DEBUG_ = False
|
||||
|
||||
num_runs = 100
|
||||
|
||||
num_messages = list(range(8, 512, 4))
|
||||
protocol_names = ["enocean", "homematic", "rwe"]
|
||||
|
||||
random.seed(0)
|
||||
np.random.seed(0)
|
||||
|
||||
performances = defaultdict(list)
|
||||
|
||||
for protocol_name in protocol_names:
|
||||
for messages in num_messages:
|
||||
if protocol_name == "homematic":
|
||||
protocol = self.generate_homematic(messages, save_protocol=False)
|
||||
elif protocol_name == "enocean":
|
||||
protocol = self.generate_enocean(messages, save_protocol=False)
|
||||
elif protocol_name == "rwe":
|
||||
protocol = self.generate_rwe(messages, save_protocol=False)
|
||||
else:
|
||||
raise ValueError("Unknown protocol name")
|
||||
|
||||
tmp_performances = np.empty(num_runs, dtype=np.float64)
|
||||
for i in range(num_runs):
|
||||
print("\r{0} with {1:02d} messages ({2}/{3} runs)".format(protocol_name, messages, i + 1, num_runs),
|
||||
flush=True, end="")
|
||||
|
||||
t = time.time()
|
||||
self.run_format_finder_for_protocol(protocol)
|
||||
tmp_performances[i] = time.time() - t
|
||||
self.clear_message_types(protocol.messages)
|
||||
|
||||
mean_performance = tmp_performances.mean()
|
||||
print(" {:.2f}s".format(mean_performance))
|
||||
performances["{}".format(protocol_name)].append(mean_performance)
|
||||
|
||||
self.__plot(num_messages, performances, xlabel="Number of messages", ylabel="Time in seconds", grid=True)
|
||||
self.__export_to_csv("/tmp/performance.csv", num_messages, performances)
|
||||
|
||||
@staticmethod
|
||||
def __export_to_csv(filename: str, x: list, y: dict, relative=None):
|
||||
if not filename.endswith(".csv"):
|
||||
filename += ".csv"
|
||||
|
||||
with open(filename, "w") as f:
|
||||
f.write("N,")
|
||||
if relative is not None:
|
||||
f.write("NRel,")
|
||||
for y_cap in sorted(y):
|
||||
f.write(y_cap + ",")
|
||||
f.write("\n")
|
||||
|
||||
for i, x_val in enumerate(x):
|
||||
f.write("{},".format(x_val))
|
||||
if relative is not None:
|
||||
f.write("{},".format(100 * x_val / relative))
|
||||
|
||||
for y_cap in sorted(y):
|
||||
f.write("{},".format(y[y_cap][i]))
|
||||
f.write("\n")
|
||||
|
||||
@staticmethod
|
||||
def __plot(x: list, y: dict, xlabel: str, ylabel: str, grid=False, title=None):
|
||||
plt.xlabel(xlabel)
|
||||
plt.ylabel(ylabel)
|
||||
|
||||
for y_cap, y_values in sorted(y.items()):
|
||||
plt.plot(x, y_values, label=y_cap)
|
||||
|
||||
if grid:
|
||||
plt.grid()
|
||||
|
||||
if title:
|
||||
plt.title(title)
|
||||
|
||||
plt.legend()
|
||||
plt.show()
|
||||
|
||||
@staticmethod
|
||||
def run_format_finder_for_protocol(protocol: ProtocolAnalyzer):
|
||||
ff = FormatFinder(protocol.messages)
|
||||
ff.known_participant_addresses.clear()
|
||||
ff.run()
|
||||
|
||||
for msg_type, indices in ff.existing_message_types.items():
|
||||
for i in indices:
|
||||
protocol.messages[i].message_type = msg_type
|
||||
|
||||
@classmethod
|
||||
def generate_homematic(cls, num_messages: int, save_protocol=True):
|
||||
mb_m_frame = MessageTypeBuilder("mframe")
|
||||
mb_c_frame = MessageTypeBuilder("cframe")
|
||||
mb_r_frame = MessageTypeBuilder("rframe")
|
||||
mb_a_frame = MessageTypeBuilder("aframe")
|
||||
|
||||
participants = [Participant("CCU", address_hex="3927cc"), Participant("Switch", address_hex="3101cc")]
|
||||
|
||||
checksum = GenericCRC.from_standard_checksum("CRC16 CC1101")
|
||||
for mb_builder in [mb_m_frame, mb_c_frame, mb_r_frame, mb_a_frame]:
|
||||
mb_builder.add_label(FieldType.Function.PREAMBLE, 32)
|
||||
mb_builder.add_label(FieldType.Function.SYNC, 32)
|
||||
mb_builder.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_builder.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
mb_builder.add_label(FieldType.Function.TYPE, 16)
|
||||
mb_builder.add_label(FieldType.Function.SRC_ADDRESS, 24)
|
||||
mb_builder.add_label(FieldType.Function.DST_ADDRESS, 24)
|
||||
if mb_builder.name == "mframe":
|
||||
mb_builder.add_label(FieldType.Function.DATA, 16, name="command")
|
||||
elif mb_builder.name == "cframe":
|
||||
mb_builder.add_label(FieldType.Function.DATA, 16 * 4, name="command+challenge+magic")
|
||||
elif mb_builder.name == "rframe":
|
||||
mb_builder.add_label(FieldType.Function.DATA, 32 * 4, name="cipher")
|
||||
elif mb_builder.name == "aframe":
|
||||
mb_builder.add_label(FieldType.Function.DATA, 10 * 4, name="command + auth")
|
||||
mb_builder.add_checksum_label(16, checksum)
|
||||
|
||||
message_types = [mb_m_frame.message_type, mb_c_frame.message_type, mb_r_frame.message_type,
|
||||
mb_a_frame.message_type]
|
||||
preamble = "0xaaaaaaaa"
|
||||
sync = "0xe9cae9ca"
|
||||
initial_sequence_number = 36
|
||||
pg = ProtocolGenerator(message_types, participants,
|
||||
preambles_by_mt={mt: preamble for mt in message_types},
|
||||
syncs_by_mt={mt: sync for mt in message_types},
|
||||
sequence_numbers={mt: initial_sequence_number for mt in message_types},
|
||||
message_type_codes={mb_m_frame.message_type: 42560,
|
||||
mb_c_frame.message_type: 40962,
|
||||
mb_r_frame.message_type: 40963,
|
||||
mb_a_frame.message_type: 32770})
|
||||
|
||||
for i in range(num_messages):
|
||||
mt = pg.message_types[i % 4]
|
||||
data_length = mt.get_first_label_with_type(FieldType.Function.DATA).length
|
||||
data = "".join(random.choice(["0", "1"]) for _ in range(data_length))
|
||||
pg.generate_message(mt, data, source=pg.participants[i % 2], destination=pg.participants[(i + 1) % 2])
|
||||
|
||||
if save_protocol:
|
||||
cls.save_protocol("homematic", pg)
|
||||
|
||||
cls.clear_message_types(pg.messages)
|
||||
return pg.protocol
|
||||
|
||||
@classmethod
|
||||
def generate_enocean(cls, num_messages: int, save_protocol=True):
|
||||
filename = get_path_for_data_file("enocean_bits.txt")
|
||||
enocean_bits = []
|
||||
with open(filename, "r") as f:
|
||||
for line in map(str.strip, f):
|
||||
enocean_bits.append(line)
|
||||
|
||||
protocol = ProtocolAnalyzer(None)
|
||||
message_type = MessageType("empty")
|
||||
for i in range(num_messages):
|
||||
msg = Message.from_plain_bits_str(enocean_bits[i % len(enocean_bits)])
|
||||
msg.message_type = message_type
|
||||
protocol.messages.append(msg)
|
||||
|
||||
if save_protocol:
|
||||
cls.save_protocol("enocean", protocol)
|
||||
|
||||
return protocol
|
||||
|
||||
@classmethod
|
||||
def generate_rwe(cls, num_messages: int, save_protocol=True):
|
||||
proto_file = get_path_for_data_file("rwe.proto.xml")
|
||||
protocol = ProtocolAnalyzer(signal=None, filename=proto_file)
|
||||
protocol.from_xml_file(filename=proto_file, read_bits=True)
|
||||
messages = protocol.messages
|
||||
|
||||
result = ProtocolAnalyzer(None)
|
||||
message_type = MessageType("empty")
|
||||
for i in range(num_messages):
|
||||
msg = messages[i % len(messages)] # type: Message
|
||||
msg.message_type = message_type
|
||||
result.messages.append(msg)
|
||||
|
||||
if save_protocol:
|
||||
cls.save_protocol("rwe", result)
|
||||
|
||||
return result
|
||||
|
||||
def test_export_latex_table(self):
|
||||
def bold_latex(s):
|
||||
return r"\textbf{" + str(s) + r"}"
|
||||
|
||||
comments = {
|
||||
1: "common protocol",
|
||||
2: "unusual field sizes",
|
||||
3: "contains ack and CRC8 CCITT",
|
||||
4: "contains ack and CRC16 CCITT",
|
||||
5: "three participants with ack frame",
|
||||
6: "short address",
|
||||
7: "four participants, varying preamble size, varying sync words",
|
||||
8: "nibble fields + LE"
|
||||
}
|
||||
|
||||
bold = {i: defaultdict(bool) for i in range(1, 9)}
|
||||
bold[2][FieldType.Function.PREAMBLE] = True
|
||||
bold[2][FieldType.Function.SRC_ADDRESS] = True
|
||||
bold[2][FieldType.Function.DST_ADDRESS] = True
|
||||
|
||||
bold[3][FieldType.Function.CHECKSUM] = True
|
||||
|
||||
bold[4][FieldType.Function.CHECKSUM] = True
|
||||
|
||||
bold[6][FieldType.Function.SRC_ADDRESS] = True
|
||||
|
||||
bold[7][FieldType.Function.PREAMBLE] = True
|
||||
bold[7][FieldType.Function.SYNC] = True
|
||||
bold[7][FieldType.Function.SRC_ADDRESS] = True
|
||||
bold[7][FieldType.Function.DST_ADDRESS] = True
|
||||
|
||||
bold[8][FieldType.Function.PREAMBLE] = True
|
||||
bold[8][FieldType.Function.SYNC] = True
|
||||
|
||||
filename = os.path.expanduser("~/GIT/publications/awre/USENIX/protocol_table.tex")
|
||||
rowcolors = [r"\rowcolor{black!10}", r"\rowcolor{black!20}"]
|
||||
|
||||
with open(filename, "w") as f:
|
||||
f.write(r"\begin{table*}[!h]" + "\n")
|
||||
f.write(
|
||||
"\t" + r"\caption{Properties of tested protocols whereby $\times$ means field is not present and $N_P$ is the number of participants.}" + "\n")
|
||||
f.write("\t" + r"\label{tab:protocols}" + "\n")
|
||||
f.write("\t" + r"\centering" + "\n")
|
||||
f.write("\t" + r"\begin{tabularx}{\linewidth}{cp{2.5cm}llcccccccc}" + "\n")
|
||||
f.write("\t\t" + r"\hline" + "\n")
|
||||
f.write("\t\t" + r"\rowcolor{black!90}" + "\n")
|
||||
f.write("\t\t" + r"\textcolor{white}{\textbf{\#}} & "
|
||||
r"\textcolor{white}{\textbf{Comment}} & "
|
||||
r"\textcolor{white}{$\mathbf{ N_P }$} & "
|
||||
r"\textcolor{white}{\textbf{Message}} & "
|
||||
r"\textcolor{white}{\textbf{Even/odd}} & "
|
||||
r"\multicolumn{7}{c}{\textcolor{white}{\textbf{Size of field in bit (BE=Big Endian, LE=Little Endian)}}}\\"
|
||||
"\n\t\t"
|
||||
r"\rowcolor{black!90}"
|
||||
"\n\t\t"
|
||||
r"& & & \textcolor{white}{\textbf{Type}} & \textcolor{white}{\textbf{message data}} &"
|
||||
r"\textcolor{white}{Preamble} & "
|
||||
r"\textcolor{white}{Sync} & "
|
||||
r"\textcolor{white}{Length} & "
|
||||
r"\textcolor{white}{SRC} & "
|
||||
r"\textcolor{white}{DST} & "
|
||||
r"\textcolor{white}{SEQ Nr} & "
|
||||
r"\textcolor{white}{CRC} \\" + "\n")
|
||||
f.write("\t\t" + r"\hline" + "\n")
|
||||
|
||||
rowcolor_index = 0
|
||||
for i in range(1, 9):
|
||||
pg = getattr(self, "_prepare_protocol_" + str(i))()
|
||||
assert isinstance(pg, ProtocolGenerator)
|
||||
|
||||
try:
|
||||
data1 = next(mt for mt in pg.message_types if mt.name == "data1")
|
||||
data2 = next(mt for mt in pg.message_types if mt.name == "data2")
|
||||
|
||||
data1_len = data1.get_first_label_with_type(FieldType.Function.DATA).length // 8
|
||||
data2_len = data2.get_first_label_with_type(FieldType.Function.DATA).length // 8
|
||||
|
||||
except StopIteration:
|
||||
data1_len, data2_len = 8, 64
|
||||
|
||||
rowcolor = rowcolors[rowcolor_index % len(rowcolors)]
|
||||
rowcount = 0
|
||||
for j, mt in enumerate(pg.message_types):
|
||||
if mt.name == "data2":
|
||||
continue
|
||||
|
||||
rowcount += 1
|
||||
if j == 0:
|
||||
protocol_nr, participants = str(i), len(pg.participants)
|
||||
if participants > 2:
|
||||
participants = bold_latex(participants)
|
||||
else:
|
||||
protocol_nr, participants = " ", " "
|
||||
|
||||
f.write("\t\t" + rowcolor + "\n")
|
||||
|
||||
if len(pg.message_types) == 1 or (
|
||||
mt.name == "data1" and "ack" not in {m.name for m in pg.message_types}):
|
||||
f.write("\t\t{} & {} & {} & {} &".format(protocol_nr, comments[i], participants,
|
||||
mt.name.replace("1", "")))
|
||||
elif j == len(pg.message_types) - 1:
|
||||
f.write(
|
||||
"\t\t{} & \\multirow{{{}}}{{\\linewidth}}{{{}}} & {} & {} &".format(protocol_nr, -rowcount,
|
||||
comments[i],
|
||||
participants,
|
||||
mt.name.replace("1",
|
||||
"")))
|
||||
else:
|
||||
f.write("\t\t{} & & {} & {} &".format(protocol_nr, participants, mt.name.replace("1", "")))
|
||||
data_lbl = mt.get_first_label_with_type(FieldType.Function.DATA)
|
||||
|
||||
if mt.name == "data1" or mt.name == "data2":
|
||||
f.write("{}/{} byte &".format(data1_len, data2_len))
|
||||
elif mt.name == "data" and data_lbl is None:
|
||||
f.write("{}/{} byte &".format(data1_len, data2_len))
|
||||
elif data_lbl is not None:
|
||||
f.write("{0}/{0} byte & ".format(data_lbl.length // 8))
|
||||
else:
|
||||
f.write(r"$ \times $ & ")
|
||||
|
||||
for t in (FieldType.Function.PREAMBLE, FieldType.Function.SYNC, FieldType.Function.LENGTH,
|
||||
FieldType.Function.SRC_ADDRESS, FieldType.Function.DST_ADDRESS,
|
||||
FieldType.Function.SEQUENCE_NUMBER,
|
||||
FieldType.Function.CHECKSUM):
|
||||
lbl = mt.get_first_label_with_type(t)
|
||||
if lbl is not None:
|
||||
if bold[i][lbl.field_type.function]:
|
||||
f.write(bold_latex(lbl.length))
|
||||
else:
|
||||
f.write(str(lbl.length))
|
||||
if lbl.length > 8 and t in (FieldType.Function.LENGTH, FieldType.Function.SEQUENCE_NUMBER):
|
||||
f.write(" ({})".format(bold_latex("LE") if pg.little_endian else "BE"))
|
||||
else:
|
||||
f.write(r"$ \times $")
|
||||
|
||||
if t != FieldType.Function.CHECKSUM:
|
||||
f.write(" & ")
|
||||
else:
|
||||
f.write(r"\\" + "\n")
|
||||
|
||||
rowcolor_index += 1
|
||||
|
||||
f.write("\t" + r"\end{tabularx}" + "\n")
|
||||
|
||||
f.write(r"\end{table*}" + "\n")
|
179
Software/Universal Radio Hacker/tests/awre/TestAWREHistograms.py
Normal file
179
Software/Universal Radio Hacker/tests/awre/TestAWREHistograms.py
Normal file
@ -0,0 +1,179 @@
|
||||
import random
|
||||
from collections import defaultdict
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.Histogram import Histogram
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.signalprocessing.Participant import Participant
|
||||
|
||||
SHOW_PLOTS = True
|
||||
|
||||
class TestAWREHistograms(AWRETestCase):
|
||||
def test_very_simple_protocol(self):
|
||||
"""
|
||||
Test a very simple protocol consisting just of a preamble, sync and some random data
|
||||
:return:
|
||||
"""
|
||||
mb = MessageTypeBuilder("very_simple_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 8)
|
||||
|
||||
num_messages = 10
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type], syncs_by_mt={mb.message_type: "0x9a"})
|
||||
for _ in range(num_messages):
|
||||
pg.generate_message(data=pg.decimal_to_bits(random.randint(0, 255), 8))
|
||||
|
||||
self.save_protocol("very_simple", pg)
|
||||
|
||||
h = Histogram(FormatFinder.get_bitvectors_from_messages(pg.protocol.messages))
|
||||
if SHOW_PLOTS:
|
||||
h.plot()
|
||||
|
||||
def test_simple_protocol(self):
|
||||
"""
|
||||
Test a simple protocol with preamble, sync and length field and some random data
|
||||
:return:
|
||||
"""
|
||||
mb = MessageTypeBuilder("simple_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
|
||||
num_messages_by_data_length = {8: 5, 16: 10, 32: 15}
|
||||
pg = ProtocolGenerator([mb.message_type], syncs_by_mt={mb.message_type: "0x9a9d"})
|
||||
for data_length, num_messages in num_messages_by_data_length.items():
|
||||
for _ in range(num_messages):
|
||||
pg.generate_message(data=pg.decimal_to_bits(random.randint(0, 2 ** data_length - 1), data_length))
|
||||
|
||||
self.save_protocol("simple", pg)
|
||||
|
||||
plt.subplot("221")
|
||||
plt.title("All messages")
|
||||
format_finder = FormatFinder(pg.protocol.messages)
|
||||
|
||||
for i, sync_end in enumerate(format_finder.sync_ends):
|
||||
self.assertEqual(sync_end, 24, msg=str(i))
|
||||
|
||||
h = Histogram(format_finder.bitvectors)
|
||||
h.subplot_on(plt)
|
||||
|
||||
bitvectors = FormatFinder.get_bitvectors_from_messages(pg.protocol.messages)
|
||||
bitvectors_by_length = defaultdict(list)
|
||||
for bitvector in bitvectors:
|
||||
bitvectors_by_length[len(bitvector)].append(bitvector)
|
||||
|
||||
for i, (message_length, bitvectors) in enumerate(bitvectors_by_length.items()):
|
||||
plt.subplot(2, 2, i + 2)
|
||||
plt.title("Messages with length {} ({})".format(message_length, len(bitvectors)))
|
||||
Histogram(bitvectors).subplot_on(plt)
|
||||
|
||||
if SHOW_PLOTS:
|
||||
plt.show()
|
||||
|
||||
def test_medium_protocol(self):
|
||||
"""
|
||||
Test a protocol with preamble, sync, length field, 2 participants and addresses and seq nr and random data
|
||||
:return:
|
||||
"""
|
||||
mb = MessageTypeBuilder("medium_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 8)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
|
||||
alice = Participant("Alice", "A", "1234", color_index=0)
|
||||
bob = Participant("Bob", "B", "5a9d", color_index=1)
|
||||
|
||||
num_messages = 100
|
||||
pg = ProtocolGenerator([mb.message_type], syncs_by_mt={mb.message_type: "0x1c"}, little_endian=False)
|
||||
for i in range(num_messages):
|
||||
len_data = random.randint(1, 5)
|
||||
data = "".join(pg.decimal_to_bits(random.randint(0, 2 ** 8 - 1), 8) for _ in range(len_data))
|
||||
if i % 2 == 0:
|
||||
source, dest = alice, bob
|
||||
else:
|
||||
source, dest = bob, alice
|
||||
pg.generate_message(data=data, source=source, destination=dest)
|
||||
|
||||
self.save_protocol("medium", pg)
|
||||
|
||||
plt.subplot(2, 2, 1)
|
||||
plt.title("All messages")
|
||||
bitvectors = FormatFinder.get_bitvectors_from_messages(pg.protocol.messages)
|
||||
h = Histogram(bitvectors)
|
||||
h.subplot_on(plt)
|
||||
|
||||
for i, (participant, bitvectors) in enumerate(
|
||||
sorted(self.get_bitvectors_by_participant(pg.protocol.messages).items())):
|
||||
plt.subplot(2, 2, i + 3)
|
||||
plt.title("Messages with participant {} ({})".format(participant.shortname, len(bitvectors)))
|
||||
Histogram(bitvectors).subplot_on(plt)
|
||||
|
||||
if SHOW_PLOTS:
|
||||
plt.show()
|
||||
|
||||
def get_bitvectors_by_participant(self, messages):
|
||||
import numpy as np
|
||||
result = defaultdict(list)
|
||||
for msg in messages: # type: Message
|
||||
result[msg.participant].append(np.array(msg.decoded_bits, dtype=np.uint8, order="C"))
|
||||
return result
|
||||
|
||||
def test_ack_protocol(self):
|
||||
"""
|
||||
Test a protocol with acks
|
||||
:return:
|
||||
"""
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 8)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 8)
|
||||
mb_ack.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
|
||||
alice = Participant("Alice", "A", "1234", color_index=0)
|
||||
bob = Participant("Bob", "B", "5a9d", color_index=1)
|
||||
|
||||
num_messages = 50
|
||||
pg = ProtocolGenerator([mb.message_type, mb_ack.message_type],
|
||||
syncs_by_mt={mb.message_type: "0xbf", mb_ack.message_type: "0xbf"},
|
||||
little_endian=False)
|
||||
for i in range(num_messages):
|
||||
if i % 2 == 0:
|
||||
source, dest = alice, bob
|
||||
else:
|
||||
source, dest = bob, alice
|
||||
pg.generate_message(data="0xffff", source=source, destination=dest)
|
||||
pg.generate_message(data="", source=dest, destination=source, message_type=mb_ack.message_type)
|
||||
|
||||
self.save_protocol("proto_with_acks", pg)
|
||||
|
||||
plt.subplot(2, 2, 1)
|
||||
plt.title("All messages")
|
||||
bitvectors = FormatFinder.get_bitvectors_from_messages(pg.protocol.messages)
|
||||
h = Histogram(bitvectors)
|
||||
h.subplot_on(plt)
|
||||
|
||||
for i, (participant, bitvectors) in enumerate(
|
||||
sorted(self.get_bitvectors_by_participant(pg.protocol.messages).items())):
|
||||
plt.subplot(2, 2, i + 3)
|
||||
plt.title("Messages with participant {} ({})".format(participant.shortname, len(bitvectors)))
|
||||
Histogram(bitvectors).subplot_on(plt)
|
||||
|
||||
if SHOW_PLOTS:
|
||||
plt.show()
|
@ -0,0 +1,386 @@
|
||||
import random
|
||||
from array import array
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from tests.utils_testing import get_path_for_data_file
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.awre.engines.AddressEngine import AddressEngine
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.signalprocessing.Message import Message
|
||||
from urh.signalprocessing.Participant import Participant
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
from urh.util import util
|
||||
|
||||
|
||||
class TestAddressEngine(AWRETestCase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.alice = Participant("Alice", "A", address_hex="1234")
|
||||
self.bob = Participant("Bob", "B", address_hex="cafe")
|
||||
|
||||
def test_one_participant(self):
|
||||
"""
|
||||
Test a simple protocol with
|
||||
preamble, sync and length field (8 bit) and some random data
|
||||
|
||||
:return:
|
||||
"""
|
||||
mb = MessageTypeBuilder("simple_address_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
|
||||
num_messages_by_data_length = {8: 5, 16: 10, 32: 15}
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a9d"},
|
||||
participants=[self.alice])
|
||||
for data_length, num_messages in num_messages_by_data_length.items():
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data=pg.decimal_to_bits(22 * i, data_length), source=self.alice)
|
||||
|
||||
#self.save_protocol("address_one_participant", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
|
||||
address_engine = AddressEngine(ff.hexvectors, ff.participant_indices)
|
||||
address_dict = address_engine.find_addresses()
|
||||
|
||||
self.assertEqual(len(address_dict), 0)
|
||||
|
||||
def test_two_participants(self):
|
||||
mb = MessageTypeBuilder("address_two_participants")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
|
||||
num_messages = 50
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a9d"},
|
||||
participants=[self.alice, self.bob])
|
||||
|
||||
for i in range(num_messages):
|
||||
if i % 2 == 0:
|
||||
source, destination = self.alice, self.bob
|
||||
data_length = 8
|
||||
else:
|
||||
source, destination = self.bob, self.alice
|
||||
data_length = 16
|
||||
pg.generate_message(data=pg.decimal_to_bits(4 * i, data_length), source=source, destination=destination)
|
||||
|
||||
#self.save_protocol("address_two_participants", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
|
||||
address_engine = AddressEngine(ff.hexvectors, ff.participant_indices)
|
||||
address_dict = address_engine.find_addresses()
|
||||
self.assertEqual(len(address_dict), 2)
|
||||
addresses_1 = list(map(util.convert_numbers_to_hex_string, address_dict[0]))
|
||||
addresses_2 = list(map(util.convert_numbers_to_hex_string, address_dict[1]))
|
||||
self.assertIn(self.alice.address_hex, addresses_1)
|
||||
self.assertIn(self.alice.address_hex, addresses_2)
|
||||
self.assertIn(self.bob.address_hex, addresses_1)
|
||||
self.assertIn(self.bob.address_hex, addresses_2)
|
||||
|
||||
ff.known_participant_addresses.clear()
|
||||
self.assertEqual(len(ff.known_participant_addresses), 0)
|
||||
|
||||
ff.perform_iteration()
|
||||
|
||||
self.assertEqual(len(ff.known_participant_addresses), 2)
|
||||
self.assertIn(bytes([int(h, 16) for h in self.alice.address_hex]),
|
||||
map(bytes, ff.known_participant_addresses.values()))
|
||||
self.assertIn(bytes([int(h, 16) for h in self.bob.address_hex]),
|
||||
map(bytes, ff.known_participant_addresses.values()))
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
mt = ff.message_types[0]
|
||||
dst_addr = mt.get_first_label_with_type(FieldType.Function.DST_ADDRESS)
|
||||
self.assertIsNotNone(dst_addr)
|
||||
self.assertEqual(dst_addr.start, 32)
|
||||
self.assertEqual(dst_addr.length, 16)
|
||||
src_addr = mt.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertIsNotNone(src_addr)
|
||||
self.assertEqual(src_addr.start, 48)
|
||||
self.assertEqual(src_addr.length, 16)
|
||||
|
||||
def test_two_participants_with_ack_messages(self):
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_ack.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
|
||||
num_messages = 50
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb_ack.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x6768", mb_ack.message_type: "0x6768"},
|
||||
participants=[self.alice, self.bob])
|
||||
|
||||
random.seed(0)
|
||||
for i in range(num_messages):
|
||||
if i % 2 == 0:
|
||||
source, destination = self.alice, self.bob
|
||||
data_length = 8
|
||||
else:
|
||||
source, destination = self.bob, self.alice
|
||||
data_length = 16
|
||||
pg.generate_message(data=pg.decimal_to_bits(random.randint(0, 2 ** (data_length - 1)), data_length),
|
||||
source=source, destination=destination)
|
||||
pg.generate_message(data="", message_type=mb_ack.message_type, destination=source, source=destination)
|
||||
|
||||
#self.save_protocol("address_two_participants_with_acks", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
address_engine = AddressEngine(ff.hexvectors, ff.participant_indices)
|
||||
address_dict = address_engine.find_addresses()
|
||||
self.assertEqual(len(address_dict), 2)
|
||||
addresses_1 = list(map(util.convert_numbers_to_hex_string, address_dict[0]))
|
||||
addresses_2 = list(map(util.convert_numbers_to_hex_string, address_dict[1]))
|
||||
self.assertIn(self.alice.address_hex, addresses_1)
|
||||
self.assertIn(self.alice.address_hex, addresses_2)
|
||||
self.assertIn(self.bob.address_hex, addresses_1)
|
||||
self.assertIn(self.bob.address_hex, addresses_2)
|
||||
|
||||
ff.known_participant_addresses.clear()
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(ff.message_types), 2)
|
||||
mt = ff.message_types[1]
|
||||
dst_addr = mt.get_first_label_with_type(FieldType.Function.DST_ADDRESS)
|
||||
self.assertIsNotNone(dst_addr)
|
||||
self.assertEqual(dst_addr.start, 32)
|
||||
self.assertEqual(dst_addr.length, 16)
|
||||
src_addr = mt.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertIsNotNone(src_addr)
|
||||
self.assertEqual(src_addr.start, 48)
|
||||
self.assertEqual(src_addr.length, 16)
|
||||
|
||||
mt = ff.message_types[0]
|
||||
dst_addr = mt.get_first_label_with_type(FieldType.Function.DST_ADDRESS)
|
||||
self.assertIsNotNone(dst_addr)
|
||||
self.assertEqual(dst_addr.start, 32)
|
||||
self.assertEqual(dst_addr.length, 16)
|
||||
|
||||
def test_two_participants_with_ack_messages_and_type(self):
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.TYPE, 8)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_ack.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
|
||||
num_messages = 50
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb_ack.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x6768", mb_ack.message_type: "0x6768"},
|
||||
participants=[self.alice, self.bob])
|
||||
|
||||
random.seed(0)
|
||||
for i in range(num_messages):
|
||||
if i % 2 == 0:
|
||||
source, destination = self.alice, self.bob
|
||||
data_length = 8
|
||||
else:
|
||||
source, destination = self.bob, self.alice
|
||||
data_length = 16
|
||||
pg.generate_message(data=pg.decimal_to_bits(random.randint(0, 2 ** (data_length - 1)), data_length),
|
||||
source=source, destination=destination)
|
||||
pg.generate_message(data="", message_type=mb_ack.message_type, destination=source, source=destination)
|
||||
|
||||
#self.save_protocol("address_two_participants_with_acks_and_types", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
address_engine = AddressEngine(ff.hexvectors, ff.participant_indices)
|
||||
address_dict = address_engine.find_addresses()
|
||||
self.assertEqual(len(address_dict), 2)
|
||||
addresses_1 = list(map(util.convert_numbers_to_hex_string, address_dict[0]))
|
||||
addresses_2 = list(map(util.convert_numbers_to_hex_string, address_dict[1]))
|
||||
self.assertIn(self.alice.address_hex, addresses_1)
|
||||
self.assertIn(self.alice.address_hex, addresses_2)
|
||||
self.assertIn(self.bob.address_hex, addresses_1)
|
||||
self.assertIn(self.bob.address_hex, addresses_2)
|
||||
|
||||
ff.known_participant_addresses.clear()
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(ff.message_types), 2)
|
||||
mt = ff.message_types[1]
|
||||
dst_addr = mt.get_first_label_with_type(FieldType.Function.DST_ADDRESS)
|
||||
self.assertIsNotNone(dst_addr)
|
||||
self.assertEqual(dst_addr.start, 40)
|
||||
self.assertEqual(dst_addr.length, 16)
|
||||
src_addr = mt.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertIsNotNone(src_addr)
|
||||
self.assertEqual(src_addr.start, 56)
|
||||
self.assertEqual(src_addr.length, 16)
|
||||
|
||||
mt = ff.message_types[0]
|
||||
dst_addr = mt.get_first_label_with_type(FieldType.Function.DST_ADDRESS)
|
||||
self.assertIsNotNone(dst_addr)
|
||||
self.assertEqual(dst_addr.start, 32)
|
||||
self.assertEqual(dst_addr.length, 16)
|
||||
|
||||
def test_three_participants_with_ack(self):
|
||||
alice = Participant("Alice", address_hex="1337")
|
||||
bob = Participant("Bob", address_hex="4711")
|
||||
carl = Participant("Carl", address_hex="cafe")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_ack.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb_ack.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a7d", mb_ack.message_type: "0x9a7d"},
|
||||
preambles_by_mt={mb.message_type: "10" * 8, mb_ack.message_type: "10" * 8},
|
||||
participants=[alice, bob, carl])
|
||||
|
||||
i = -1
|
||||
while len(pg.protocol.messages) < 20:
|
||||
i += 1
|
||||
source = pg.participants[i % len(pg.participants)]
|
||||
destination = pg.participants[(i + 1) % len(pg.participants)]
|
||||
if i % 2 == 0:
|
||||
data_bytes = 8
|
||||
else:
|
||||
data_bytes = 16
|
||||
|
||||
data = "".join(random.choice(["0", "1"]) for _ in range(data_bytes * 8))
|
||||
pg.generate_message(data=data, source=source, destination=destination)
|
||||
|
||||
if "ack" in (msg_type.name for msg_type in pg.protocol.message_types):
|
||||
pg.generate_message(message_type=1, data="", source=destination, destination=source)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
ff.known_participant_addresses.clear()
|
||||
self.assertEqual(len(ff.known_participant_addresses), 0)
|
||||
ff.run()
|
||||
|
||||
# Since there are ACKS in this protocol, the engine must be able to assign the correct participant addresses
|
||||
# IN CORRECT ORDER!
|
||||
self.assertEqual(util.convert_numbers_to_hex_string(ff.known_participant_addresses[0]), "1337")
|
||||
self.assertEqual(util.convert_numbers_to_hex_string(ff.known_participant_addresses[1]), "4711")
|
||||
self.assertEqual(util.convert_numbers_to_hex_string(ff.known_participant_addresses[2]), "cafe")
|
||||
|
||||
def test_protocol_with_acks_and_checksum(self):
|
||||
proto_file = get_path_for_data_file("ack_frames_with_crc.proto.xml")
|
||||
protocol = ProtocolAnalyzer(signal=None, filename=proto_file)
|
||||
protocol.from_xml_file(filename=proto_file, read_bits=True)
|
||||
|
||||
self.clear_message_types(protocol.messages)
|
||||
|
||||
ff = FormatFinder(protocol.messages)
|
||||
ff.known_participant_addresses.clear()
|
||||
|
||||
ff.run()
|
||||
self.assertEqual(util.convert_numbers_to_hex_string(ff.known_participant_addresses[0]), "1337")
|
||||
self.assertEqual(util.convert_numbers_to_hex_string(ff.known_participant_addresses[1]), "4711")
|
||||
|
||||
for mt in ff.message_types:
|
||||
preamble = mt.get_first_label_with_type(FieldType.Function.PREAMBLE)
|
||||
self.assertEqual(preamble.start, 0)
|
||||
self.assertEqual(preamble.length, 16)
|
||||
sync = mt.get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 16)
|
||||
self.assertEqual(sync.length, 16)
|
||||
length = mt.get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertEqual(length.start, 32)
|
||||
self.assertEqual(length.length, 8)
|
||||
|
||||
def test_address_engine_performance(self):
|
||||
ff, messages = self.get_format_finder_from_protocol_file("35_messages.proto.xml", return_messages=True)
|
||||
|
||||
engine = AddressEngine(ff.hexvectors, ff.participant_indices)
|
||||
engine.find()
|
||||
|
||||
def test_paper_example(self):
|
||||
alice = Participant("Alice", "A")
|
||||
bob = Participant("Bob", "B")
|
||||
participants = [alice, bob]
|
||||
msg1 = Message.from_plain_hex_str("aabb1234")
|
||||
msg1.participant = alice
|
||||
msg2 = Message.from_plain_hex_str("aabb6789")
|
||||
msg2.participant = alice
|
||||
msg3 = Message.from_plain_hex_str("bbaa4711")
|
||||
msg3.participant = bob
|
||||
msg4 = Message.from_plain_hex_str("bbaa1337")
|
||||
msg4.participant = bob
|
||||
|
||||
protocol = ProtocolAnalyzer(None)
|
||||
protocol.messages.extend([msg1, msg2, msg3, msg4])
|
||||
#self.save_protocol("paper_example", protocol)
|
||||
|
||||
bitvectors = FormatFinder.get_bitvectors_from_messages(protocol.messages)
|
||||
hexvectors = FormatFinder.get_hexvectors(bitvectors)
|
||||
address_engine = AddressEngine(hexvectors, participant_indices=[participants.index(msg.participant) for msg in
|
||||
protocol.messages])
|
||||
|
||||
def test_find_common_sub_sequence(self):
|
||||
from urh.cythonext import awre_util
|
||||
str1 = "0612345678"
|
||||
str2 = "0756781234"
|
||||
|
||||
seq1 = np.array(list(map(int, str1)), dtype=np.uint8, order="C")
|
||||
seq2 = np.array(list(map(int, str2)), dtype=np.uint8, order="C")
|
||||
|
||||
indices = awre_util.find_longest_common_sub_sequence_indices(seq1, seq2)
|
||||
self.assertEqual(len(indices), 2)
|
||||
for ind in indices:
|
||||
s = str1[slice(*ind)]
|
||||
self.assertIn(s, ("5678", "1234"))
|
||||
self.assertIn(s, str1)
|
||||
self.assertIn(s, str2)
|
||||
|
||||
def test_find_first_occurrence(self):
|
||||
from urh.cythonext import awre_util
|
||||
str1 = "00" * 100 + "1234500012345" + "00" * 100
|
||||
str2 = "12345"
|
||||
|
||||
seq1 = np.array(list(map(int, str1)), dtype=np.uint8, order="C")
|
||||
seq2 = np.array(list(map(int, str2)), dtype=np.uint8, order="C")
|
||||
indices = awre_util.find_occurrences(seq1, seq2)
|
||||
self.assertEqual(len(indices), 2)
|
||||
index = indices[0]
|
||||
self.assertEqual(str1[index:index + len(str2)], str2)
|
||||
|
||||
# Test with ignoring indices
|
||||
indices = awre_util.find_occurrences(seq1, seq2, array("L", list(range(0, 205))))
|
||||
self.assertEqual(len(indices), 1)
|
||||
|
||||
# Test with ignoring indices
|
||||
indices = awre_util.find_occurrences(seq1, seq2, array("L", list(range(0, 210))))
|
||||
self.assertEqual(len(indices), 0)
|
||||
|
||||
self.assertEqual(awre_util.find_occurrences(seq1, np.ones(10, dtype=np.uint8)), [])
|
@ -0,0 +1,256 @@
|
||||
import random
|
||||
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.Preprocessor import Preprocessor
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.signalprocessing.Message import Message
|
||||
from urh.signalprocessing.Participant import Participant
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
import numpy as np
|
||||
|
||||
|
||||
class TestAWREPreprocessing(AWRETestCase):
|
||||
def test_very_simple_sync_word_finding(self):
|
||||
preamble = "10101010"
|
||||
sync = "1101"
|
||||
|
||||
pg = self.build_protocol_generator(preamble_syncs=[(preamble, sync)],
|
||||
num_messages=(20,),
|
||||
data=(lambda i: 10 * i,))
|
||||
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in pg.protocol.messages])
|
||||
|
||||
possible_syncs = preprocessor.find_possible_syncs()
|
||||
#self.save_protocol("very_simple_sync_test", pg)
|
||||
self.assertGreaterEqual(len(possible_syncs), 1)
|
||||
self.assertEqual(preprocessor.find_possible_syncs()[0], sync)
|
||||
|
||||
def test_simple_sync_word_finding(self):
|
||||
preamble = "10101010"
|
||||
sync = "1001"
|
||||
|
||||
pg = self.build_protocol_generator(preamble_syncs=[(preamble, sync), (preamble + "1010", sync)],
|
||||
num_messages=(20, 5),
|
||||
data=(lambda i: 10 * i, lambda i: 22 * i))
|
||||
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in pg.protocol.messages])
|
||||
|
||||
possible_syncs = preprocessor.find_possible_syncs()
|
||||
#self.save_protocol("simple_sync_test", pg)
|
||||
self.assertGreaterEqual(len(possible_syncs), 1)
|
||||
self.assertEqual(preprocessor.find_possible_syncs()[0], sync)
|
||||
|
||||
def test_sync_word_finding_odd_preamble(self):
|
||||
preamble = "0101010"
|
||||
sync = "1101"
|
||||
pg = self.build_protocol_generator(preamble_syncs=[(preamble, sync), (preamble + "10", sync)],
|
||||
num_messages=(20, 5),
|
||||
data=(lambda i: 10 * i, lambda i: i))
|
||||
|
||||
# If we have a odd preamble length, the last bit of the preamble is counted to the sync
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in pg.protocol.messages])
|
||||
possible_syncs = preprocessor.find_possible_syncs()
|
||||
|
||||
#self.save_protocol("odd_preamble", pg)
|
||||
self.assertEqual(preamble[-1] + sync[:-1], possible_syncs[0])
|
||||
|
||||
def test_sync_word_finding_special_preamble(self):
|
||||
preamble = "111001110011100"
|
||||
sync = "0110"
|
||||
pg = self.build_protocol_generator(preamble_syncs=[(preamble, sync), (preamble + "10", sync)],
|
||||
num_messages=(20, 5),
|
||||
data=(lambda i: 10 * i, lambda i: i))
|
||||
|
||||
# If we have a odd preamble length, the last bit of the preamble is counted to the sync
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in pg.protocol.messages])
|
||||
possible_syncs = preprocessor.find_possible_syncs()
|
||||
|
||||
#self.save_protocol("special_preamble", pg)
|
||||
self.assertEqual(sync, possible_syncs[0])
|
||||
|
||||
def test_sync_word_finding_errored_preamble(self):
|
||||
preamble = "00010101010" # first bits are wrong
|
||||
sync = "0110"
|
||||
pg = self.build_protocol_generator(preamble_syncs=[(preamble, sync), (preamble + "10", sync)],
|
||||
num_messages=(20, 5),
|
||||
data=(lambda i: 10 * i, lambda i: i))
|
||||
|
||||
# If we have a odd preamble length, the last bit of the preamble is counted to the sync
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in pg.protocol.messages])
|
||||
possible_syncs = preprocessor.find_possible_syncs()
|
||||
|
||||
#self.save_protocol("errored_preamble", pg)
|
||||
self.assertIn(preamble[-1] + sync[:-1], possible_syncs)
|
||||
|
||||
def test_sync_word_finding_with_two_sync_words(self):
|
||||
preamble = "0xaaaa"
|
||||
sync1, sync2 = "0x1234", "0xcafe"
|
||||
pg = self.build_protocol_generator(preamble_syncs=[(preamble, sync1), (preamble, sync2)],
|
||||
num_messages=(15, 10),
|
||||
data=(lambda i: 12 * i, lambda i: 16 * i))
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in pg.protocol.messages])
|
||||
possible_syncs = preprocessor.find_possible_syncs()
|
||||
#self.save_protocol("two_syncs", pg)
|
||||
self.assertGreaterEqual(len(possible_syncs), 2)
|
||||
self.assertIn(ProtocolGenerator.to_bits(sync1), possible_syncs)
|
||||
self.assertIn(ProtocolGenerator.to_bits(sync2), possible_syncs)
|
||||
|
||||
def test_multiple_sync_words(self):
|
||||
hex_messages = [
|
||||
"aaS1234",
|
||||
"aaScafe",
|
||||
"aaSdead",
|
||||
"aaSbeef",
|
||||
]
|
||||
|
||||
for i in range(1, 256):
|
||||
messages = []
|
||||
sync = "{0:02x}".format(i)
|
||||
if sync.startswith("a"):
|
||||
continue
|
||||
|
||||
for msg in hex_messages:
|
||||
messages.append(Message.from_plain_hex_str(msg.replace("S", sync)))
|
||||
|
||||
for i in range(1, len(messages)):
|
||||
messages[i].message_type = messages[0].message_type
|
||||
|
||||
ff = FormatFinder(messages)
|
||||
ff.run()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1, msg=sync)
|
||||
|
||||
preamble = ff.message_types[0].get_first_label_with_type(FieldType.Function.PREAMBLE)
|
||||
self.assertEqual(preamble.start, 0, msg=sync)
|
||||
self.assertEqual(preamble.length, 8, msg=sync)
|
||||
|
||||
sync = ff.message_types[0].get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 8, msg=sync)
|
||||
self.assertEqual(sync.length, 8, msg=sync)
|
||||
|
||||
def test_sync_word_finding_varying_message_length(self):
|
||||
hex_messages = [
|
||||
"aaaa9a7d0f1337471100009a44ebdd13517bf9",
|
||||
"aaaa9a7d4747111337000134a4473c002b909630b11df37e34728c79c60396176aff2b5384e82f31511581d0cbb4822ad1b6734e2372ad5cf4af4c9d6b067e5f7ec359ec443c3b5ddc7a9e",
|
||||
"aaaa9a7d0f13374711000205ee081d26c86b8c",
|
||||
"aaaa9a7d474711133700037cae4cda789885f88f5fb29adc9acf954cb2850b9d94e7f3b009347c466790e89f2bcd728987d4670690861bbaa120f71f14d4ef8dc738a6d7c30e7d2143c267",
|
||||
"aaaa9a7d0f133747110004c2906142300427f3"
|
||||
]
|
||||
|
||||
messages = [Message.from_plain_hex_str(hex_msg) for hex_msg in hex_messages]
|
||||
for i in range(1, len(messages)):
|
||||
messages[i].message_type = messages[0].message_type
|
||||
|
||||
ff = FormatFinder(messages)
|
||||
ff.run()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
preamble = ff.message_types[0].get_first_label_with_type(FieldType.Function.PREAMBLE)
|
||||
self.assertEqual(preamble.start, 0)
|
||||
self.assertEqual(preamble.length, 16)
|
||||
|
||||
sync = ff.message_types[0].get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 16)
|
||||
self.assertEqual(sync.length, 16)
|
||||
|
||||
def test_sync_word_finding_common_prefix(self):
|
||||
"""
|
||||
Messages are very similar (odd and even ones are the same)
|
||||
However, they do not have two different sync words!
|
||||
The algorithm needs to check for a common prefix of the two found sync words
|
||||
|
||||
:return:
|
||||
"""
|
||||
sync = "0x1337"
|
||||
num_messages = 10
|
||||
|
||||
alice = Participant("Alice", address_hex="dead01")
|
||||
bob = Participant("Bob", address_hex="beef24")
|
||||
|
||||
mb = MessageTypeBuilder("protocol_with_one_message_type")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 72)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 24)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 24)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x1337"},
|
||||
preambles_by_mt={mb.message_type: "10" * 36},
|
||||
participants=[alice, bob])
|
||||
|
||||
random.seed(0)
|
||||
for i in range(num_messages):
|
||||
if i % 2 == 0:
|
||||
source, destination = alice, bob
|
||||
data_length = 8
|
||||
else:
|
||||
source, destination = bob, alice
|
||||
data_length = 16
|
||||
pg.generate_message(data=pg.decimal_to_bits(random.randint(0, 2 ** (data_length - 1)), data_length),
|
||||
source=source, destination=destination)
|
||||
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in pg.protocol.messages])
|
||||
possible_syncs = preprocessor.find_possible_syncs()
|
||||
#self.save_protocol("sync_by_common_prefix", pg)
|
||||
self.assertEqual(len(possible_syncs), 1)
|
||||
|
||||
# +0000 is okay, because this will get fixed by correction in FormatFinder
|
||||
self.assertIn(possible_syncs[0], [ProtocolGenerator.to_bits(sync), ProtocolGenerator.to_bits(sync) + "0000"])
|
||||
|
||||
def test_with_given_preamble_and_sync(self):
|
||||
preamble = "10101010"
|
||||
sync = "10011"
|
||||
pg = self.build_protocol_generator(preamble_syncs=[(preamble, sync)],
|
||||
num_messages=(20,),
|
||||
data=(lambda i: 10 * i,))
|
||||
|
||||
# If we have a odd preamble length, the last bit of the preamble is counted to the sync
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in pg.protocol.messages],
|
||||
existing_message_types={i: msg.message_type for i, msg in
|
||||
enumerate(pg.protocol.messages)})
|
||||
preamble_starts, preamble_lengths, sync_len = preprocessor.preprocess()
|
||||
|
||||
#self.save_protocol("given_preamble", pg)
|
||||
|
||||
self.assertTrue(all(preamble_start == 0 for preamble_start in preamble_starts))
|
||||
self.assertTrue(all(preamble_length == len(preamble) for preamble_length in preamble_lengths))
|
||||
self.assertEqual(sync_len, len(sync))
|
||||
|
||||
@staticmethod
|
||||
def build_protocol_generator(preamble_syncs: list, num_messages: tuple, data: tuple) -> ProtocolGenerator:
|
||||
message_types = []
|
||||
preambles_by_mt = dict()
|
||||
syncs_by_mt = dict()
|
||||
|
||||
assert len(preamble_syncs) == len(num_messages) == len(data)
|
||||
|
||||
for i, (preamble, sync_word) in enumerate(preamble_syncs):
|
||||
assert isinstance(preamble, str)
|
||||
assert isinstance(sync_word, str)
|
||||
|
||||
preamble, sync_word = map(ProtocolGenerator.to_bits, (preamble, sync_word))
|
||||
|
||||
mb = MessageTypeBuilder("message type #{0}".format(i))
|
||||
mb.add_label(FieldType.Function.PREAMBLE, len(preamble))
|
||||
mb.add_label(FieldType.Function.SYNC, len(sync_word))
|
||||
|
||||
message_types.append(mb.message_type)
|
||||
preambles_by_mt[mb.message_type] = preamble
|
||||
syncs_by_mt[mb.message_type] = sync_word
|
||||
|
||||
pg = ProtocolGenerator(message_types, preambles_by_mt=preambles_by_mt, syncs_by_mt=syncs_by_mt)
|
||||
for i, msg_type in enumerate(message_types):
|
||||
for j in range(num_messages[i]):
|
||||
if callable(data[i]):
|
||||
msg_data = pg.decimal_to_bits(data[i](j), num_bits=8)
|
||||
else:
|
||||
msg_data = data[i]
|
||||
|
||||
pg.generate_message(message_type=msg_type, data=msg_data)
|
||||
|
||||
return pg
|
@ -0,0 +1,149 @@
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from tests.utils_testing import get_path_for_data_file
|
||||
from urh.awre.CommonRange import CommonRange
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.Preprocessor import Preprocessor
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.signalprocessing.Message import Message
|
||||
from urh.signalprocessing.MessageType import MessageType
|
||||
from urh.signalprocessing.Participant import Participant
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
import numpy as np
|
||||
|
||||
class TestAWRERealProtocols(AWRETestCase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
alice = Participant("Alice", "A")
|
||||
bob = Participant("Bob", "B")
|
||||
self.participants = [alice, bob]
|
||||
|
||||
def test_format_finding_enocean(self):
|
||||
enocean_protocol = ProtocolAnalyzer(None)
|
||||
with open(get_path_for_data_file("enocean_bits.txt")) as f:
|
||||
for line in f:
|
||||
enocean_protocol.messages.append(Message.from_plain_bits_str(line.replace("\n", "")))
|
||||
enocean_protocol.messages[-1].message_type = enocean_protocol.default_message_type
|
||||
|
||||
ff = FormatFinder(enocean_protocol.messages)
|
||||
ff.perform_iteration()
|
||||
|
||||
message_types = ff.message_types
|
||||
self.assertEqual(len(message_types), 1)
|
||||
|
||||
preamble = message_types[0].get_first_label_with_type(FieldType.Function.PREAMBLE)
|
||||
self.assertEqual(preamble.start, 0)
|
||||
self.assertEqual(preamble.length, 8)
|
||||
|
||||
sync = message_types[0].get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 8)
|
||||
self.assertEqual(sync.length, 4)
|
||||
|
||||
checksum = message_types[0].get_first_label_with_type(FieldType.Function.CHECKSUM)
|
||||
self.assertEqual(checksum.start, 56)
|
||||
self.assertEqual(checksum.length, 4)
|
||||
|
||||
self.assertIsNone(message_types[0].get_first_label_with_type(FieldType.Function.SRC_ADDRESS))
|
||||
self.assertIsNone(message_types[0].get_first_label_with_type(FieldType.Function.DST_ADDRESS))
|
||||
self.assertIsNone(message_types[0].get_first_label_with_type(FieldType.Function.LENGTH))
|
||||
self.assertIsNone(message_types[0].get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER))
|
||||
|
||||
def test_format_finding_rwe(self):
|
||||
ff, messages = self.get_format_finder_from_protocol_file("rwe.proto.xml", return_messages=True)
|
||||
ff.run()
|
||||
|
||||
sync1, sync2 = "0x9a7d9a7d", "0x67686768"
|
||||
|
||||
preprocessor = Preprocessor([np.array(msg.plain_bits, dtype=np.uint8) for msg in messages])
|
||||
possible_syncs = preprocessor.find_possible_syncs()
|
||||
self.assertIn(ProtocolGenerator.to_bits(sync1), possible_syncs)
|
||||
self.assertIn(ProtocolGenerator.to_bits(sync2), possible_syncs)
|
||||
|
||||
ack_messages = (3, 5, 7, 9, 11, 13, 15, 17, 20)
|
||||
ack_message_type = next(mt for mt, messages in ff.existing_message_types.items() if ack_messages[0] in messages)
|
||||
self.assertTrue(all(ack_msg in ff.existing_message_types[ack_message_type] for ack_msg in ack_messages))
|
||||
|
||||
for mt in ff.message_types:
|
||||
preamble = mt.get_first_label_with_type(FieldType.Function.PREAMBLE)
|
||||
self.assertEqual(preamble.start, 0)
|
||||
self.assertEqual(preamble.length, 32)
|
||||
|
||||
sync = mt.get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 32)
|
||||
self.assertEqual(sync.length, 32)
|
||||
|
||||
length = mt.get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertEqual(length.start, 64)
|
||||
self.assertEqual(length.length, 8)
|
||||
|
||||
dst = mt.get_first_label_with_type(FieldType.Function.DST_ADDRESS)
|
||||
self.assertEqual(dst.length, 24)
|
||||
|
||||
if mt == ack_message_type or 1 in ff.existing_message_types[mt]:
|
||||
self.assertEqual(dst.start, 72)
|
||||
else:
|
||||
self.assertEqual(dst.start, 88)
|
||||
|
||||
if mt != ack_message_type and 1 not in ff.existing_message_types[mt]:
|
||||
src = mt.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertEqual(src.start, 112)
|
||||
self.assertEqual(src.length, 24)
|
||||
elif 1 in ff.existing_message_types[mt]:
|
||||
# long ack
|
||||
src = mt.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertEqual(src.start, 96)
|
||||
self.assertEqual(src.length, 24)
|
||||
|
||||
crc = mt.get_first_label_with_type(FieldType.Function.CHECKSUM)
|
||||
self.assertIsNotNone(crc)
|
||||
|
||||
def test_homematic(self):
|
||||
proto_file = get_path_for_data_file("homematic.proto.xml")
|
||||
protocol = ProtocolAnalyzer(signal=None, filename=proto_file)
|
||||
protocol.message_types = []
|
||||
protocol.from_xml_file(filename=proto_file, read_bits=True)
|
||||
# prevent interfering with preassinged labels
|
||||
protocol.message_types = [MessageType("Default")]
|
||||
|
||||
participants = sorted({msg.participant for msg in protocol.messages})
|
||||
|
||||
self.clear_message_types(protocol.messages)
|
||||
ff = FormatFinder(protocol.messages, participants=participants)
|
||||
ff.known_participant_addresses.clear()
|
||||
ff.perform_iteration()
|
||||
|
||||
self.assertGreater(len(ff.message_types), 0)
|
||||
|
||||
for i, message_type in enumerate(ff.message_types):
|
||||
preamble = message_type.get_first_label_with_type(FieldType.Function.PREAMBLE)
|
||||
self.assertEqual(preamble.start, 0)
|
||||
self.assertEqual(preamble.length, 32)
|
||||
|
||||
sync = message_type.get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 32)
|
||||
self.assertEqual(sync.length, 32)
|
||||
|
||||
length = message_type.get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertEqual(length.start, 64)
|
||||
self.assertEqual(length.length, 8)
|
||||
|
||||
seq = message_type.get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER)
|
||||
self.assertEqual(seq.start, 72)
|
||||
self.assertEqual(seq.length, 8)
|
||||
|
||||
src = message_type.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertEqual(src.start, 96)
|
||||
self.assertEqual(src.length, 24)
|
||||
|
||||
dst = message_type.get_first_label_with_type(FieldType.Function.DST_ADDRESS)
|
||||
self.assertEqual(dst.start, 120)
|
||||
self.assertEqual(dst.length, 24)
|
||||
|
||||
checksum = message_type.get_first_label_with_type(FieldType.Function.CHECKSUM)
|
||||
self.assertEqual(checksum.length, 16)
|
||||
self.assertIn("CC1101", checksum.checksum.caption)
|
||||
|
||||
for msg_index in ff.existing_message_types[message_type]:
|
||||
msg_len = len(protocol.messages[msg_index])
|
||||
self.assertEqual(checksum.start, msg_len-16)
|
||||
self.assertEqual(checksum.end, msg_len)
|
@ -0,0 +1,102 @@
|
||||
import array
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from urh.awre.CommonRange import ChecksumRange
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.awre.engines.ChecksumEngine import ChecksumEngine
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.util import util
|
||||
from urh.util.GenericCRC import GenericCRC
|
||||
from urh.cythonext import util as c_util
|
||||
|
||||
class TestChecksumEngine(AWRETestCase):
|
||||
def test_find_crc8(self):
|
||||
messages = ["aabbcc7d", "abcdee24", "dacafe33"]
|
||||
message_bits = [np.array(msg, dtype=np.uint8) for msg in map(util.hex2bit, messages)]
|
||||
|
||||
checksum_engine = ChecksumEngine(message_bits, n_gram_length=8)
|
||||
result = checksum_engine.find()
|
||||
self.assertEqual(len(result), 1)
|
||||
checksum_range = result[0] # type: ChecksumRange
|
||||
self.assertEqual(checksum_range.length, 8)
|
||||
self.assertEqual(checksum_range.start, 24)
|
||||
|
||||
reference = GenericCRC()
|
||||
reference.set_polynomial_from_hex("0x07")
|
||||
self.assertEqual(checksum_range.crc.polynomial, reference.polynomial)
|
||||
|
||||
self.assertEqual(checksum_range.message_indices, {0, 1, 2})
|
||||
|
||||
def test_find_crc16(self):
|
||||
messages = ["12345678347B", "abcdefffABBD", "cafe1337CE12"]
|
||||
message_bits = [np.array(msg, dtype=np.uint8) for msg in map(util.hex2bit, messages)]
|
||||
|
||||
checksum_engine = ChecksumEngine(message_bits, n_gram_length=8)
|
||||
result = checksum_engine.find()
|
||||
self.assertEqual(len(result), 1)
|
||||
checksum_range = result[0] # type: ChecksumRange
|
||||
self.assertEqual(checksum_range.start, 32)
|
||||
self.assertEqual(checksum_range.length, 16)
|
||||
|
||||
reference = GenericCRC()
|
||||
reference.set_polynomial_from_hex("0x8005")
|
||||
self.assertEqual(checksum_range.crc.polynomial, reference.polynomial)
|
||||
|
||||
self.assertEqual(checksum_range.message_indices, {0, 1, 2})
|
||||
|
||||
def test_find_crc32(self):
|
||||
messages = ["deadcafe5D7F3F5A", "47111337E3319242", "beefaffe0DCD0E15"]
|
||||
message_bits = [np.array(msg, dtype=np.uint8) for msg in map(util.hex2bit, messages)]
|
||||
|
||||
checksum_engine = ChecksumEngine(message_bits, n_gram_length=8)
|
||||
result = checksum_engine.find()
|
||||
self.assertEqual(len(result), 1)
|
||||
checksum_range = result[0] # type: ChecksumRange
|
||||
self.assertEqual(checksum_range.start, 32)
|
||||
self.assertEqual(checksum_range.length, 32)
|
||||
|
||||
reference = GenericCRC()
|
||||
reference.set_polynomial_from_hex("0x04C11DB7")
|
||||
self.assertEqual(checksum_range.crc.polynomial, reference.polynomial)
|
||||
|
||||
self.assertEqual(checksum_range.message_indices, {0, 1, 2})
|
||||
|
||||
def test_find_generated_crc16(self):
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.DATA, 32)
|
||||
mb.add_checksum_label(16, GenericCRC.from_standard_checksum("CRC16 CCITT"))
|
||||
|
||||
mb2 = MessageTypeBuilder("data2")
|
||||
mb2.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb2.add_label(FieldType.Function.SYNC, 16)
|
||||
mb2.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb2.add_label(FieldType.Function.DATA, 16)
|
||||
|
||||
mb2.add_checksum_label(16, GenericCRC.from_standard_checksum("CRC16 CCITT"))
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb2.message_type], syncs_by_mt={mb.message_type: "0x1234", mb2.message_type: "0x1234"})
|
||||
|
||||
num_messages = 5
|
||||
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data="{0:032b}".format(i), message_type=mb.message_type)
|
||||
pg.generate_message(data="{0:016b}".format(i), message_type=mb2.message_type)
|
||||
|
||||
#self.save_protocol("crc16_test", pg)
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
ff.run()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 2)
|
||||
for mt in ff.message_types:
|
||||
checksum_label = mt.get_first_label_with_type(FieldType.Function.CHECKSUM)
|
||||
self.assertEqual(checksum_label.length, 16)
|
||||
self.assertEqual(checksum_label.checksum.caption, "CRC16 CCITT")
|
@ -0,0 +1,35 @@
|
||||
import unittest
|
||||
|
||||
from urh.awre.CommonRange import CommonRange
|
||||
|
||||
|
||||
class TestCommonRange(unittest.TestCase):
|
||||
def test_ensure_not_overlaps(self):
|
||||
test_range = CommonRange(start=4, length=8, value="12345678")
|
||||
self.assertEqual(test_range.end, 11)
|
||||
|
||||
# no overlapping
|
||||
self.assertEqual(test_range, test_range.ensure_not_overlaps(0, 3)[0])
|
||||
self.assertEqual(test_range, test_range.ensure_not_overlaps(20, 24)[0])
|
||||
|
||||
# overlapping on left
|
||||
result = test_range.ensure_not_overlaps(2, 6)[0]
|
||||
self.assertEqual(result.start, 6)
|
||||
self.assertEqual(result.end, 11)
|
||||
|
||||
# overlapping on right
|
||||
result = test_range.ensure_not_overlaps(6, 14)[0]
|
||||
self.assertEqual(result.start, 4)
|
||||
self.assertEqual(result.end, 5)
|
||||
|
||||
# full overlapping
|
||||
self.assertEqual(len(test_range.ensure_not_overlaps(3, 14)), 0)
|
||||
|
||||
# overlapping in the middle
|
||||
result = test_range.ensure_not_overlaps(6, 9)
|
||||
self.assertEqual(len(result), 2)
|
||||
left, right = result[0], result[1]
|
||||
self.assertEqual(left.start, 4)
|
||||
self.assertEqual(left.end, 5)
|
||||
self.assertEqual(right.start, 10)
|
||||
self.assertEqual(right.end, 11)
|
102
Software/Universal Radio Hacker/tests/awre/test_format_finder.py
Normal file
102
Software/Universal Radio Hacker/tests/awre/test_format_finder.py
Normal file
@ -0,0 +1,102 @@
|
||||
import numpy as np
|
||||
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from urh.awre.CommonRange import CommonRange, CommonRangeContainer
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
|
||||
|
||||
class TestFormatFinder(AWRETestCase):
|
||||
def test_create_message_types_1(self):
|
||||
rng1 = CommonRange(0, 8, "1" * 8, score=1, field_type="Length")
|
||||
rng1.message_indices = {0, 1, 2}
|
||||
rng2 = CommonRange(8, 8, "1" * 8, score=1, field_type="Address")
|
||||
rng2.message_indices = {0, 1, 2}
|
||||
|
||||
message_types = FormatFinder.create_common_range_containers({rng1, rng2})
|
||||
self.assertEqual(len(message_types), 1)
|
||||
|
||||
expected = CommonRangeContainer([rng1, rng2], message_indices={0, 1, 2})
|
||||
self.assertEqual(message_types[0], expected)
|
||||
|
||||
def test_create_message_types_2(self):
|
||||
rng1 = CommonRange(0, 8, "1" * 8, score=1, field_type="Length")
|
||||
rng1.message_indices = {0, 2, 4, 6, 8, 12}
|
||||
rng2 = CommonRange(8, 8, "1" * 8, score=1, field_type="Address")
|
||||
rng2.message_indices = {1, 2, 3, 4, 5, 12}
|
||||
rng3 = CommonRange(16, 8, "1" * 8, score=1, field_type="Seq")
|
||||
rng3.message_indices = {1, 3, 5, 7, 12}
|
||||
|
||||
message_types = FormatFinder.create_common_range_containers({rng1, rng2, rng3})
|
||||
expected1 = CommonRangeContainer([rng1], message_indices={0, 6, 8})
|
||||
expected2 = CommonRangeContainer([rng1, rng2], message_indices={2, 4})
|
||||
expected3 = CommonRangeContainer([rng1, rng2, rng3], message_indices={12})
|
||||
expected4 = CommonRangeContainer([rng2, rng3], message_indices={1, 3, 5})
|
||||
expected5 = CommonRangeContainer([rng3], message_indices={7})
|
||||
|
||||
self.assertEqual(len(message_types), 5)
|
||||
|
||||
self.assertIn(expected1, message_types)
|
||||
self.assertIn(expected2, message_types)
|
||||
self.assertIn(expected3, message_types)
|
||||
self.assertIn(expected4, message_types)
|
||||
self.assertIn(expected5, message_types)
|
||||
|
||||
def test_retransform_message_indices(self):
|
||||
sync_ends = np.array([12, 12, 12, 14, 14])
|
||||
|
||||
rng = CommonRange(0, 8, "1" * 8, score=1, field_type="length", message_indices={0, 1, 2, 3, 4})
|
||||
retransformed_ranges = FormatFinder.retransform_message_indices([rng], [0, 1, 2, 3, 4], sync_ends)
|
||||
|
||||
# two different sync ends
|
||||
self.assertEqual(len(retransformed_ranges), 2)
|
||||
|
||||
expected1 = CommonRange(12, 8, "1" * 8, score=1, field_type="length", message_indices={0, 1, 2})
|
||||
expected2 = CommonRange(14, 8, "1" * 8, score=1, field_type="length", message_indices={3, 4})
|
||||
|
||||
self.assertIn(expected1, retransformed_ranges)
|
||||
self.assertIn(expected2, retransformed_ranges)
|
||||
|
||||
def test_handle_no_overlapping_conflict(self):
|
||||
rng1 = CommonRange(0, 8, "1" * 8, score=1, field_type="Length")
|
||||
rng1.message_indices = {0, 1, 2}
|
||||
rng2 = CommonRange(8, 8, "1" * 8, score=1, field_type="Address")
|
||||
rng2.message_indices = {0, 1, 2}
|
||||
|
||||
container = CommonRangeContainer([rng1, rng2], message_indices={0, 1, 2})
|
||||
|
||||
# no conflict
|
||||
result = FormatFinder.handle_overlapping_conflict([container])
|
||||
self.assertEqual(len(result), 1)
|
||||
self.assertEqual(len(result[0]), 2)
|
||||
self.assertIn(rng1, result[0])
|
||||
self.assertEqual(result[0].message_indices, {0, 1, 2})
|
||||
self.assertIn(rng2, result[0])
|
||||
|
||||
def test_handle_easy_overlapping_conflict(self):
|
||||
# Easy conflict: First Label has higher score
|
||||
rng1 = CommonRange(8, 8, "1" * 8, score=1, field_type="Length")
|
||||
rng1.message_indices = {0, 1, 2}
|
||||
rng2 = CommonRange(8, 8, "1" * 8, score=0.8, field_type="Address")
|
||||
rng2.message_indices = {0, 1, 2}
|
||||
|
||||
container = CommonRangeContainer([rng1, rng2], message_indices={0, 1, 2})
|
||||
result = FormatFinder.handle_overlapping_conflict([container])
|
||||
self.assertEqual(len(result), 1)
|
||||
self.assertEqual(len(result[0]), 1)
|
||||
self.assertIn(rng1, result[0])
|
||||
self.assertEqual(result[0].message_indices, {0, 1, 2})
|
||||
|
||||
def test_handle_medium_overlapping_conflict(self):
|
||||
rng1 = CommonRange(8, 8, "1" * 8, score=1, field_type="Length")
|
||||
rng2 = CommonRange(4, 10, "1" * 8, score=0.8, field_type="Address")
|
||||
rng3 = CommonRange(15, 20, "1" * 8, score=1, field_type="Seq")
|
||||
rng4 = CommonRange(60, 80, "1" * 8, score=0.8, field_type="Type")
|
||||
rng5 = CommonRange(70, 90, "1" * 8, score=0.9, field_type="Data")
|
||||
|
||||
container = CommonRangeContainer([rng1, rng2, rng3, rng4, rng5])
|
||||
result = FormatFinder.handle_overlapping_conflict([container])
|
||||
self.assertEqual(len(result), 1)
|
||||
self.assertEqual(len(result[0]), 3)
|
||||
self.assertIn(rng1, result[0])
|
||||
self.assertIn(rng3, result[0])
|
||||
self.assertIn(rng5, result[0])
|
@ -0,0 +1,236 @@
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from urh.awre import AutoAssigner
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.Preprocessor import Preprocessor
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.signalprocessing.Participant import Participant
|
||||
from urh.util import util
|
||||
|
||||
|
||||
class TestGeneratedProtocols(AWRETestCase):
|
||||
def __check_addresses(self, messages, format_finder, known_participant_addresses):
|
||||
"""
|
||||
Use the AutoAssigner used also in main GUI to test assigned participant addresses to get same results
|
||||
as in main program and not rely on cache of FormatFinder, because values there might be false
|
||||
but SRC address labels still on right position which is the basis for Auto Assigner
|
||||
|
||||
:param messages:
|
||||
:param format_finder:
|
||||
:param known_participant_addresses:
|
||||
:return:
|
||||
"""
|
||||
|
||||
for msg_type, indices in format_finder.existing_message_types.items():
|
||||
for i in indices:
|
||||
messages[i].message_type = msg_type
|
||||
|
||||
participants = list(set(m.participant for m in messages))
|
||||
for p in participants:
|
||||
p.address_hex = ""
|
||||
AutoAssigner.auto_assign_participant_addresses(messages, participants)
|
||||
|
||||
for i in range(len(participants)):
|
||||
self.assertIn(participants[i].address_hex,
|
||||
list(map(util.convert_numbers_to_hex_string, known_participant_addresses.values())),
|
||||
msg=" [ " + " ".join(p.address_hex for p in participants) + " ]")
|
||||
|
||||
def test_without_preamble(self):
|
||||
alice = Participant("Alice", address_hex="24")
|
||||
broadcast = Participant("Broadcast", address_hex="ff")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 8)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x8e88"},
|
||||
preambles_by_mt={mb.message_type: "10" * 8},
|
||||
participants=[alice, broadcast])
|
||||
|
||||
for i in range(20):
|
||||
data_bits = 16 if i % 2 == 0 else 32
|
||||
source = pg.participants[i % 2]
|
||||
destination = pg.participants[(i + 1) % 2]
|
||||
pg.generate_message(data="1010" * (data_bits // 4), source=source, destination=destination)
|
||||
|
||||
#self.save_protocol("without_preamble", pg)
|
||||
self.clear_message_types(pg.messages)
|
||||
ff = FormatFinder(pg.messages)
|
||||
ff.known_participant_addresses.clear()
|
||||
|
||||
ff.run()
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
|
||||
mt = ff.message_types[0]
|
||||
sync = mt.get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 0)
|
||||
self.assertEqual(sync.length, 16)
|
||||
|
||||
length = mt.get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertEqual(length.start, 16)
|
||||
self.assertEqual(length.length, 8)
|
||||
|
||||
dst = mt.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertEqual(dst.start, 24)
|
||||
self.assertEqual(dst.length, 8)
|
||||
|
||||
seq = mt.get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER)
|
||||
self.assertEqual(seq.start, 32)
|
||||
self.assertEqual(seq.length, 8)
|
||||
|
||||
def test_without_preamble_random_data(self):
|
||||
ff = self.get_format_finder_from_protocol_file("without_ack_random_data.proto.xml")
|
||||
ff.run()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
|
||||
mt = ff.message_types[0]
|
||||
sync = mt.get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 0)
|
||||
self.assertEqual(sync.length, 16)
|
||||
|
||||
length = mt.get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertEqual(length.start, 16)
|
||||
self.assertEqual(length.length, 8)
|
||||
|
||||
dst = mt.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertEqual(dst.start, 24)
|
||||
self.assertEqual(dst.length, 8)
|
||||
|
||||
seq = mt.get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER)
|
||||
self.assertEqual(seq.start, 32)
|
||||
self.assertEqual(seq.length, 8)
|
||||
|
||||
def test_without_preamble_random_data2(self):
|
||||
ff = self.get_format_finder_from_protocol_file("without_ack_random_data2.proto.xml")
|
||||
ff.run()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
|
||||
mt = ff.message_types[0]
|
||||
sync = mt.get_first_label_with_type(FieldType.Function.SYNC)
|
||||
self.assertEqual(sync.start, 0)
|
||||
self.assertEqual(sync.length, 16)
|
||||
|
||||
length = mt.get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertEqual(length.start, 16)
|
||||
self.assertEqual(length.length, 8)
|
||||
|
||||
dst = mt.get_first_label_with_type(FieldType.Function.SRC_ADDRESS)
|
||||
self.assertEqual(dst.start, 24)
|
||||
self.assertEqual(dst.length, 8)
|
||||
|
||||
seq = mt.get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER)
|
||||
self.assertEqual(seq.start, 32)
|
||||
self.assertEqual(seq.length, 8)
|
||||
|
||||
def test_with_checksum(self):
|
||||
ff = self.get_format_finder_from_protocol_file("with_checksum.proto.xml", clear_participant_addresses=False)
|
||||
known_participant_addresses = ff.known_participant_addresses.copy()
|
||||
ff.known_participant_addresses.clear()
|
||||
ff.run()
|
||||
|
||||
self.assertIn(known_participant_addresses[0].tostring(),
|
||||
list(map(bytes, ff.known_participant_addresses.values())))
|
||||
self.assertIn(known_participant_addresses[1].tostring(),
|
||||
list(map(bytes, ff.known_participant_addresses.values())))
|
||||
|
||||
self.assertEqual(len(ff.message_types), 3)
|
||||
|
||||
def test_with_only_one_address(self):
|
||||
ff = self.get_format_finder_from_protocol_file("only_one_address.proto.xml", clear_participant_addresses=False)
|
||||
known_participant_addresses = ff.known_participant_addresses.copy()
|
||||
ff.known_participant_addresses.clear()
|
||||
|
||||
ff.run()
|
||||
|
||||
self.assertIn(known_participant_addresses[0].tostring(),
|
||||
list(map(bytes, ff.known_participant_addresses.values())))
|
||||
self.assertIn(known_participant_addresses[1].tostring(),
|
||||
list(map(bytes, ff.known_participant_addresses.values())))
|
||||
|
||||
def test_with_four_broken(self):
|
||||
ff, messages = self.get_format_finder_from_protocol_file("four_broken.proto.xml",
|
||||
clear_participant_addresses=False,
|
||||
return_messages=True)
|
||||
|
||||
assert isinstance(ff, FormatFinder)
|
||||
known_participant_addresses = ff.known_participant_addresses.copy()
|
||||
ff.known_participant_addresses.clear()
|
||||
|
||||
ff.run()
|
||||
|
||||
self.__check_addresses(messages, ff, known_participant_addresses)
|
||||
|
||||
for i in range(4, len(messages)):
|
||||
mt = next(mt for mt, indices in ff.existing_message_types.items() if i in indices)
|
||||
self.assertIsNotNone(mt.get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER))
|
||||
|
||||
def test_with_one_address_one_message_type(self):
|
||||
ff, messages = self.get_format_finder_from_protocol_file("one_address_one_mt.proto.xml",
|
||||
clear_participant_addresses=False,
|
||||
return_messages=True)
|
||||
|
||||
self.assertEqual(len(messages), 17)
|
||||
self.assertEqual(len(ff.hexvectors), 17)
|
||||
|
||||
known_participant_addresses = ff.known_participant_addresses.copy()
|
||||
ff.known_participant_addresses.clear()
|
||||
|
||||
ff.run()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
|
||||
self.assertIn(known_participant_addresses[0].tostring(),
|
||||
list(map(bytes, ff.known_participant_addresses.values())))
|
||||
self.assertIn(known_participant_addresses[1].tostring(),
|
||||
list(map(bytes, ff.known_participant_addresses.values())))
|
||||
|
||||
def test_without_preamble_24_messages(self):
|
||||
ff, messages = self.get_format_finder_from_protocol_file("no_preamble24.proto.xml",
|
||||
clear_participant_addresses=False,
|
||||
return_messages=True)
|
||||
|
||||
known_participant_addresses = ff.known_participant_addresses.copy()
|
||||
ff.known_participant_addresses.clear()
|
||||
|
||||
ff.run()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
|
||||
self.assertIn(known_participant_addresses[0].tostring(),
|
||||
list(map(bytes, ff.known_participant_addresses.values())))
|
||||
self.assertIn(known_participant_addresses[1].tostring(),
|
||||
list(map(bytes, ff.known_participant_addresses.values())))
|
||||
|
||||
def test_with_three_syncs_different_preamble_lengths(self):
|
||||
ff, messages = self.get_format_finder_from_protocol_file("three_syncs.proto.xml", return_messages=True)
|
||||
preprocessor = Preprocessor(ff.get_bitvectors_from_messages(messages))
|
||||
sync_words = preprocessor.find_possible_syncs()
|
||||
self.assertIn("0000010000100000", sync_words, msg="Sync 1")
|
||||
self.assertIn("0010001000100010", sync_words, msg="Sync 2")
|
||||
self.assertIn("0110011101100111", sync_words, msg="Sync 3")
|
||||
|
||||
ff.run()
|
||||
|
||||
expected_sync_ends = [32, 24, 40, 24, 32, 24, 40, 24, 32, 24, 40, 24, 32, 24, 40, 24]
|
||||
|
||||
for i, (s1, s2) in enumerate(zip(expected_sync_ends, ff.sync_ends)):
|
||||
self.assertEqual(s1, s2, msg=str(i))
|
||||
|
||||
def test_with_four_participants(self):
|
||||
ff, messages = self.get_format_finder_from_protocol_file("four_participants.proto.xml",
|
||||
clear_participant_addresses=False,
|
||||
return_messages=True)
|
||||
|
||||
known_participant_addresses = ff.known_participant_addresses.copy()
|
||||
ff.known_participant_addresses.clear()
|
||||
|
||||
ff.run()
|
||||
|
||||
self.__check_addresses(messages, ff, known_participant_addresses)
|
||||
self.assertEqual(len(ff.message_types), 3)
|
167
Software/Universal Radio Hacker/tests/awre/test_length_engine.py
Normal file
167
Software/Universal Radio Hacker/tests/awre/test_length_engine.py
Normal file
@ -0,0 +1,167 @@
|
||||
import random
|
||||
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.awre.engines.LengthEngine import LengthEngine
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.signalprocessing.ProtocoLabel import ProtocolLabel
|
||||
|
||||
|
||||
class TestLengthEngine(AWRETestCase):
|
||||
def test_simple_protocol(self):
|
||||
"""
|
||||
Test a simple protocol with
|
||||
preamble, sync and length field (8 bit) and some random data
|
||||
|
||||
:return:
|
||||
"""
|
||||
mb = MessageTypeBuilder("simple_length_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
|
||||
num_messages_by_data_length = {8: 5, 16: 10, 32: 15}
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a9d"})
|
||||
random.seed(0)
|
||||
for data_length, num_messages in num_messages_by_data_length.items():
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data="".join([random.choice(["0", "1"]) for _ in range(data_length)]))
|
||||
|
||||
#self.save_protocol("simple_length", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
|
||||
length_engine = LengthEngine(ff.bitvectors)
|
||||
highscored_ranges = length_engine.find(n_gram_length=8)
|
||||
self.assertEqual(len(highscored_ranges), 3)
|
||||
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
self.assertGreater(len(ff.message_types[0]), 0)
|
||||
label = ff.message_types[0].get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertEqual(label.start, 24)
|
||||
self.assertEqual(label.length, 8)
|
||||
|
||||
def test_easy_protocol(self):
|
||||
"""
|
||||
preamble, sync, sequence number, length field (8 bit) and some random data
|
||||
|
||||
:return:
|
||||
"""
|
||||
mb = MessageTypeBuilder("easy_length_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 16)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
|
||||
num_messages_by_data_length = {32: 10, 64: 15, 16: 5, 24: 7}
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
preambles_by_mt={mb.message_type: "10" * 8},
|
||||
syncs_by_mt={mb.message_type: "0xcafe"})
|
||||
for data_length, num_messages in num_messages_by_data_length.items():
|
||||
for i in range(num_messages):
|
||||
if i % 4 == 0:
|
||||
data = "1" * data_length
|
||||
elif i % 4 == 1:
|
||||
data = "0" * data_length
|
||||
elif i % 4 == 2:
|
||||
data = "10" * (data_length // 2)
|
||||
else:
|
||||
data = "01" * (data_length // 2)
|
||||
|
||||
pg.generate_message(data=data)
|
||||
|
||||
#self.save_protocol("easy_length", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
|
||||
length_engine = LengthEngine(ff.bitvectors)
|
||||
highscored_ranges = length_engine.find(n_gram_length=8)
|
||||
self.assertEqual(len(highscored_ranges), 4)
|
||||
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
self.assertGreater(len(ff.message_types[0]), 0)
|
||||
label = ff.message_types[0].get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertIsInstance(label, ProtocolLabel)
|
||||
self.assertEqual(label.start, 32)
|
||||
self.assertEqual(label.length, 8)
|
||||
|
||||
def test_medium_protocol(self):
|
||||
"""
|
||||
Protocol with two message types. Length field only present in one of them
|
||||
|
||||
:return:
|
||||
"""
|
||||
mb1 = MessageTypeBuilder("data")
|
||||
mb1.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb1.add_label(FieldType.Function.SYNC, 8)
|
||||
mb1.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb1.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
|
||||
mb2 = MessageTypeBuilder("ack")
|
||||
mb2.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb2.add_label(FieldType.Function.SYNC, 8)
|
||||
|
||||
pg = ProtocolGenerator([mb1.message_type, mb2.message_type],
|
||||
syncs_by_mt={mb1.message_type: "11110011",
|
||||
mb2.message_type: "11110011"})
|
||||
num_messages_by_data_length = {8: 5, 16: 10, 32: 5}
|
||||
for data_length, num_messages in num_messages_by_data_length.items():
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data=pg.decimal_to_bits(10 * i, data_length), message_type=mb1.message_type)
|
||||
pg.generate_message(message_type=mb2.message_type, data="0xaf")
|
||||
|
||||
#self.save_protocol("medium_length", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(ff.message_types), 2)
|
||||
length_mt = next(
|
||||
mt for mt in ff.message_types if mt.get_first_label_with_type(FieldType.Function.LENGTH) is not None)
|
||||
length_label = length_mt.get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
|
||||
for i, sync_end in enumerate(ff.sync_ends):
|
||||
self.assertEqual(sync_end, 16, msg=str(i))
|
||||
|
||||
self.assertEqual(16, length_label.start)
|
||||
self.assertEqual(8, length_label.length)
|
||||
|
||||
def test_little_endian_16_bit(self):
|
||||
mb = MessageTypeBuilder("little_endian_16_length_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 16)
|
||||
|
||||
num_messages_by_data_length = {256*8: 5, 16: 4, 512: 2}
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a9d"},
|
||||
little_endian=True)
|
||||
|
||||
random.seed(0)
|
||||
for data_length, num_messages in num_messages_by_data_length.items():
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data="".join([random.choice(["0", "1"]) for _ in range(data_length)]))
|
||||
|
||||
#self.save_protocol("little_endian_16_length_test", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
|
||||
length_engine = LengthEngine(ff.bitvectors)
|
||||
highscored_ranges = length_engine.find(n_gram_length=8)
|
||||
self.assertEqual(len(highscored_ranges), 3)
|
||||
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
self.assertGreater(len(ff.message_types[0]), 0)
|
||||
label = ff.message_types[0].get_first_label_with_type(FieldType.Function.LENGTH)
|
||||
self.assertEqual(label.start, 24)
|
||||
self.assertEqual(label.length, 16)
|
@ -0,0 +1,198 @@
|
||||
import copy
|
||||
import random
|
||||
|
||||
from urh.signalprocessing.MessageType import MessageType
|
||||
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.signalprocessing.Participant import Participant
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
|
||||
|
||||
class TestPartiallyLabeled(AWRETestCase):
|
||||
"""
|
||||
Some tests if there are already information about the message types present
|
||||
|
||||
"""
|
||||
def test_fully_labeled(self):
|
||||
"""
|
||||
For fully labeled protocol, nothing should be done
|
||||
|
||||
:return:
|
||||
"""
|
||||
protocol = self.__prepare_example_protocol()
|
||||
message_types = sorted(copy.deepcopy(protocol.message_types), key=lambda x: x.name)
|
||||
ff = FormatFinder(protocol.messages)
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(message_types), len(ff.message_types))
|
||||
|
||||
for mt1, mt2 in zip(message_types, ff.message_types):
|
||||
self.assertTrue(self.__message_types_have_same_labels(mt1, mt2))
|
||||
|
||||
def test_one_message_type_empty(self):
|
||||
"""
|
||||
Empty the "ACK" message type, the labels should be find by FormatFinder
|
||||
|
||||
:return:
|
||||
"""
|
||||
protocol = self.__prepare_example_protocol()
|
||||
n_message_types = len(protocol.message_types)
|
||||
ack_mt = next(mt for mt in protocol.message_types if mt.name == "ack")
|
||||
ack_mt.clear()
|
||||
self.assertEqual(len(ack_mt), 0)
|
||||
|
||||
ff = FormatFinder(protocol.messages)
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(n_message_types, len(ff.message_types))
|
||||
|
||||
self.assertEqual(len(ack_mt), 4, msg=str(ack_mt))
|
||||
|
||||
def test_given_address_information(self):
|
||||
"""
|
||||
Empty both message types and see if addresses are found, when information of participant addresses is given
|
||||
|
||||
:return:
|
||||
"""
|
||||
protocol = self.__prepare_example_protocol()
|
||||
self.clear_message_types(protocol.messages)
|
||||
|
||||
ff = FormatFinder(protocol.messages)
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(2, len(ff.message_types))
|
||||
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.PREAMBLE))
|
||||
self.assertIsNotNone(ff.message_types[1].get_first_label_with_type(FieldType.Function.PREAMBLE))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.SYNC))
|
||||
self.assertIsNotNone(ff.message_types[1].get_first_label_with_type(FieldType.Function.SYNC))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.LENGTH))
|
||||
self.assertIsNotNone(ff.message_types[1].get_first_label_with_type(FieldType.Function.LENGTH))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.DST_ADDRESS))
|
||||
self.assertIsNotNone(ff.message_types[1].get_first_label_with_type(FieldType.Function.DST_ADDRESS))
|
||||
self.assertIsNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.SRC_ADDRESS))
|
||||
self.assertIsNotNone(ff.message_types[1].get_first_label_with_type(FieldType.Function.SRC_ADDRESS))
|
||||
|
||||
def test_type_part_already_labeled(self):
|
||||
protocol = self.__prepare_simple_example_protocol()
|
||||
self.clear_message_types(protocol.messages)
|
||||
ff = FormatFinder(protocol.messages)
|
||||
|
||||
# overlaps type
|
||||
ff.message_types[0].add_protocol_label_start_length(32, 8)
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(1, len(ff.message_types))
|
||||
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.PREAMBLE))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.SYNC))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.LENGTH))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.DST_ADDRESS))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.SRC_ADDRESS))
|
||||
|
||||
def test_length_part_already_labeled(self):
|
||||
protocol = self.__prepare_simple_example_protocol()
|
||||
self.clear_message_types(protocol.messages)
|
||||
ff = FormatFinder(protocol.messages)
|
||||
|
||||
# overlaps length
|
||||
ff.message_types[0].add_protocol_label_start_length(24, 8)
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(1, len(ff.message_types))
|
||||
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.PREAMBLE))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.SYNC))
|
||||
self.assertIsNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.LENGTH))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.DST_ADDRESS))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.SRC_ADDRESS))
|
||||
|
||||
def test_address_part_already_labeled(self):
|
||||
protocol = self.__prepare_simple_example_protocol()
|
||||
self.clear_message_types(protocol.messages)
|
||||
ff = FormatFinder(protocol.messages)
|
||||
|
||||
# overlaps dst address
|
||||
ff.message_types[0].add_protocol_label_start_length(40, 16)
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(1, len(ff.message_types))
|
||||
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.PREAMBLE))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.SYNC))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.LENGTH))
|
||||
self.assertIsNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.DST_ADDRESS))
|
||||
self.assertIsNotNone(ff.message_types[0].get_first_label_with_type(FieldType.Function.SRC_ADDRESS))
|
||||
|
||||
@staticmethod
|
||||
def __message_types_have_same_labels(mt1: MessageType, mt2: MessageType):
|
||||
if len(mt1) != len(mt2):
|
||||
return False
|
||||
|
||||
for i, lbl in enumerate(mt1):
|
||||
if lbl != mt2[i]:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def __prepare_example_protocol(self) -> ProtocolAnalyzer:
|
||||
alice = Participant("Alice", "A", address_hex="1234")
|
||||
bob = Participant("Bob", "B", address_hex="cafe")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.TYPE, 8)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb_ack = MessageTypeBuilder("ack")
|
||||
mb_ack.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb_ack.add_label(FieldType.Function.SYNC, 16)
|
||||
mb_ack.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb_ack.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
|
||||
num_messages = 50
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type, mb_ack.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x6768", mb_ack.message_type: "0x6768"},
|
||||
participants=[alice, bob])
|
||||
|
||||
random.seed(0)
|
||||
for i in range(num_messages):
|
||||
if i % 2 == 0:
|
||||
source, destination = alice, bob
|
||||
data_length = 8
|
||||
else:
|
||||
source, destination = bob, alice
|
||||
data_length = 16
|
||||
pg.generate_message(data=pg.decimal_to_bits(random.randint(0, 2 ** (data_length - 1)), data_length),
|
||||
source=source, destination=destination)
|
||||
pg.generate_message(data="", message_type=mb_ack.message_type, destination=source, source=destination)
|
||||
|
||||
#self.save_protocol("labeled_protocol", pg)
|
||||
|
||||
return pg.protocol
|
||||
|
||||
def __prepare_simple_example_protocol(self):
|
||||
random.seed(0)
|
||||
alice = Participant("Alice", "A", address_hex="1234")
|
||||
bob = Participant("Bob", "B", address_hex="cafe")
|
||||
|
||||
mb = MessageTypeBuilder("data")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.TYPE, 8)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x6768"},
|
||||
participants=[alice, bob])
|
||||
|
||||
for i in range(10):
|
||||
pg.generate_message(data="".join([random.choice(["0", "1"]) for _ in range(16)]), source=alice, destination=bob)
|
||||
pg.generate_message(data="".join([random.choice(["0", "1"]) for _ in range(8)]), source=bob, destination=alice)
|
||||
|
||||
return pg.protocol
|
@ -0,0 +1,182 @@
|
||||
from tests.awre.AWRETestCase import AWRETestCase
|
||||
from urh.awre.CommonRange import CommonRange
|
||||
from urh.awre.FormatFinder import FormatFinder
|
||||
from urh.awre.MessageTypeBuilder import MessageTypeBuilder
|
||||
from urh.awre.ProtocolGenerator import ProtocolGenerator
|
||||
from urh.awre.engines.SequenceNumberEngine import SequenceNumberEngine
|
||||
from urh.signalprocessing.FieldType import FieldType
|
||||
from urh.signalprocessing.Participant import Participant
|
||||
|
||||
|
||||
class TestSequenceNumberEngine(AWRETestCase):
|
||||
def test_simple_protocol(self):
|
||||
"""
|
||||
Test a simple protocol with
|
||||
preamble, sync and increasing sequence number (8 bit) and some constant data
|
||||
|
||||
:return:
|
||||
"""
|
||||
mb = MessageTypeBuilder("simple_seq_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 8)
|
||||
|
||||
num_messages = 20
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a9d"})
|
||||
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data="0xcafe")
|
||||
|
||||
#self.save_protocol("simple_sequence_number", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
|
||||
seq_engine = SequenceNumberEngine(ff.bitvectors, n_gram_length=8)
|
||||
highscored_ranges = seq_engine.find()
|
||||
self.assertEqual(len(highscored_ranges), 1)
|
||||
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
self.assertGreater(len(ff.message_types[0]), 0)
|
||||
self.assertEqual(ff.message_types[0].num_labels_with_type(FieldType.Function.SEQUENCE_NUMBER), 1)
|
||||
label = ff.message_types[0].get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER)
|
||||
self.assertEqual(label.start, 24)
|
||||
self.assertEqual(label.length, 8)
|
||||
|
||||
def test_16bit_seq_nr(self):
|
||||
mb = MessageTypeBuilder("16bit_seq_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
|
||||
num_messages = 10
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a9d"}, sequence_number_increment=64)
|
||||
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data="0xcafe")
|
||||
|
||||
#self.save_protocol("16bit_seq", pg)
|
||||
|
||||
bitvectors = FormatFinder.get_bitvectors_from_messages(pg.protocol.messages, sync_ends=[24]*num_messages)
|
||||
seq_engine = SequenceNumberEngine(bitvectors, n_gram_length=8)
|
||||
highscored_ranges = seq_engine.find()
|
||||
self.assertEqual(len(highscored_ranges), 1)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
ff.perform_iteration()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
self.assertGreater(len(ff.message_types[0]), 0)
|
||||
self.assertEqual(ff.message_types[0].num_labels_with_type(FieldType.Function.SEQUENCE_NUMBER), 1)
|
||||
label = ff.message_types[0].get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER)
|
||||
self.assertEqual(label.start, 24)
|
||||
self.assertEqual(label.length, 16)
|
||||
|
||||
def test_16bit_seq_nr_with_zeros_in_first_part(self):
|
||||
mb = MessageTypeBuilder("16bit_seq_first_byte_zero_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
|
||||
num_messages = 10
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a9d"}, sequence_number_increment=1)
|
||||
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data="0xcafe" + "abc" * i)
|
||||
|
||||
#self.save_protocol("16bit_seq_first_byte_zero_test", pg)
|
||||
|
||||
bitvectors = FormatFinder.get_bitvectors_from_messages(pg.protocol.messages, sync_ends=[24]*num_messages)
|
||||
seq_engine = SequenceNumberEngine(bitvectors, n_gram_length=8)
|
||||
highscored_ranges = seq_engine.find()
|
||||
self.assertEqual(len(highscored_ranges), 1)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
ff.perform_iteration()
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
self.assertGreater(len(ff.message_types[0]), 0)
|
||||
self.assertEqual(ff.message_types[0].num_labels_with_type(FieldType.Function.SEQUENCE_NUMBER), 1)
|
||||
label = ff.message_types[0].get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER)
|
||||
|
||||
# Not consider constants as part of SEQ Nr!
|
||||
self.assertEqual(label.start, 40)
|
||||
self.assertEqual(label.length, 8)
|
||||
|
||||
def test_no_sequence_number(self):
|
||||
"""
|
||||
Ensure no sequence number is labeled, when it cannot be found
|
||||
|
||||
:return:
|
||||
"""
|
||||
alice = Participant("Alice", address_hex="dead")
|
||||
bob = Participant("Bob", address_hex="beef")
|
||||
|
||||
mb = MessageTypeBuilder("protocol_with_one_message_type")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.LENGTH, 8)
|
||||
mb.add_label(FieldType.Function.SRC_ADDRESS, 16)
|
||||
mb.add_label(FieldType.Function.DST_ADDRESS, 16)
|
||||
|
||||
num_messages = 3
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x1337"},
|
||||
participants=[alice, bob])
|
||||
|
||||
for i in range(num_messages):
|
||||
if i % 2 == 0:
|
||||
source, destination = alice, bob
|
||||
else:
|
||||
source, destination = bob, alice
|
||||
pg.generate_message(data="", source=source, destination=destination)
|
||||
|
||||
#self.save_protocol("protocol_1", pg)
|
||||
|
||||
# Delete message type information -> no prior knowledge
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
ff.known_participant_addresses.clear()
|
||||
ff.perform_iteration()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
|
||||
self.assertEqual(ff.message_types[0].num_labels_with_type(FieldType.Function.SEQUENCE_NUMBER), 0)
|
||||
|
||||
def test_sequence_number_little_endian_16_bit(self):
|
||||
mb = MessageTypeBuilder("16bit_seq_test")
|
||||
mb.add_label(FieldType.Function.PREAMBLE, 8)
|
||||
mb.add_label(FieldType.Function.SYNC, 16)
|
||||
mb.add_label(FieldType.Function.SEQUENCE_NUMBER, 16)
|
||||
|
||||
num_messages = 8
|
||||
|
||||
pg = ProtocolGenerator([mb.message_type],
|
||||
syncs_by_mt={mb.message_type: "0x9a9d"},
|
||||
little_endian=True, sequence_number_increment=64)
|
||||
|
||||
for i in range(num_messages):
|
||||
pg.generate_message(data="0xcafe")
|
||||
|
||||
#self.save_protocol("16bit_litte_endian_seq", pg)
|
||||
|
||||
self.clear_message_types(pg.protocol.messages)
|
||||
ff = FormatFinder(pg.protocol.messages)
|
||||
ff.perform_iteration()
|
||||
|
||||
self.assertEqual(len(ff.message_types), 1)
|
||||
self.assertEqual(ff.message_types[0].num_labels_with_type(FieldType.Function.SEQUENCE_NUMBER), 1)
|
||||
label = ff.message_types[0].get_first_label_with_type(FieldType.Function.SEQUENCE_NUMBER)
|
||||
self.assertEqual(label.start, 24)
|
||||
self.assertEqual(label.length, 16)
|
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
../../src/urh/cli/urh_cli.py -d HackRF -f 868.3e6 -s 2e6 -g 0 -if 30 -cf 3.906e3 -mo ASK -bl 16 -p0 0 -p1 1 -m aad3d5ddddcc5d45ddbba000000/500ms aad3c5ddddcc5d45ddbaa00000000 --pause 10s -tx --hex -e "'WSP', 'Wireless Short Packet (WSP)'"
|
36
Software/Universal Radio Hacker/tests/cli/test_cli_logic.py
Normal file
36
Software/Universal Radio Hacker/tests/cli/test_cli_logic.py
Normal file
@ -0,0 +1,36 @@
|
||||
import unittest
|
||||
|
||||
from urh.cli import urh_cli
|
||||
from urh.signalprocessing.Message import Message
|
||||
from urh.signalprocessing.Modulator import Modulator
|
||||
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
|
||||
from urh.signalprocessing.Signal import Signal
|
||||
|
||||
|
||||
class TestCLILogic(unittest.TestCase):
|
||||
def test_cli_modulate_messages(self):
|
||||
modulator = Modulator("test")
|
||||
modulator.sample_rate = 2e3
|
||||
modulator.samples_per_symbol = 100
|
||||
modulator.modulation_type = "ASK"
|
||||
modulator.parameters[0] = 0
|
||||
modulator.parameters[1] = 100
|
||||
|
||||
bits = "1010111100001"
|
||||
|
||||
self.assertIsNone(urh_cli.modulate_messages([], modulator))
|
||||
|
||||
message = Message.from_plain_bits_str(bits, pause=1000)
|
||||
|
||||
modulated = urh_cli.modulate_messages([message], modulator)
|
||||
|
||||
# Demodulate for testing
|
||||
s = Signal("", "", modulation="ASK", sample_rate=2e6)
|
||||
s.samples_per_symbol = 100
|
||||
s.noise_threshold = 0
|
||||
s.iq_array = modulated
|
||||
|
||||
pa = ProtocolAnalyzer(s)
|
||||
pa.get_protocol_from_signal()
|
||||
self.assertEqual(len(pa.messages), 1)
|
||||
self.assertEqual(pa.messages[0].plain_bits_str, bits)
|
187
Software/Universal Radio Hacker/tests/cli/test_cli_parsing.py
Normal file
187
Software/Universal Radio Hacker/tests/cli/test_cli_parsing.py
Normal file
@ -0,0 +1,187 @@
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
from tests.QtTestCase import QtTestCase
|
||||
from urh.cli import urh_cli
|
||||
from urh.dev.BackendHandler import Backends
|
||||
from urh.dev.VirtualDevice import Mode
|
||||
|
||||
|
||||
class TestCLIParsing(QtTestCase):
|
||||
def setUp(self):
|
||||
self.parser = urh_cli.create_parser()
|
||||
|
||||
def test_build_modulator_from_args(self):
|
||||
args = self.parser.parse_args("--device HackRF --frequency 433.92e6 --sample-rate 2e6 --raw".split())
|
||||
self.assertIsNone(urh_cli.build_modulator_from_args(args))
|
||||
|
||||
args = self.parser.parse_args("--device HackRF --frequency 433.92e6 --sample-rate 2e6".split())
|
||||
with self.assertRaises(ValueError):
|
||||
urh_cli.build_modulator_from_args(args)
|
||||
|
||||
args = self.parser.parse_args("--device HackRF --frequency 433.92e6 --sample-rate 2e6 -p0 0".split())
|
||||
with self.assertRaises(ValueError):
|
||||
urh_cli.build_modulator_from_args(args)
|
||||
|
||||
args = self.parser.parse_args("--device HackRF --frequency 433.92e6 --sample-rate 2e6"
|
||||
" -pm 0 1 -mo ASK -cf 1337e3 -ca 0.9 -sps 24 -cp 30".split())
|
||||
modulator = urh_cli.build_modulator_from_args(args)
|
||||
self.assertEqual(modulator.modulation_type, "ASK")
|
||||
self.assertEqual(modulator.sample_rate, 2e6)
|
||||
self.assertEqual(modulator.samples_per_symbol, 24)
|
||||
self.assertEqual(modulator.parameters[0], 0)
|
||||
self.assertEqual(modulator.parameters[1], 100)
|
||||
self.assertEqual(modulator.carrier_freq_hz, 1337e3)
|
||||
self.assertEqual(modulator.carrier_amplitude, 0.9)
|
||||
self.assertEqual(modulator.carrier_phase_deg, 30)
|
||||
|
||||
args = self.parser.parse_args("--device HackRF --frequency 433.92e6 --sample-rate 2e6"
|
||||
" -pm 10% 20% -mo ASK -cf 1337e3 -ca 0.9 -sps 24 -cp 30".split())
|
||||
modulator = urh_cli.build_modulator_from_args(args)
|
||||
self.assertEqual(modulator.parameters[0], 10)
|
||||
self.assertEqual(modulator.parameters[1], 20)
|
||||
|
||||
args = self.parser.parse_args("--device HackRF --frequency 433.92e6 --sample-rate 2e6"
|
||||
" -pm 20e3 -20000 -mo FSK -cf 1337e3 -ca 0.9 -sps 24 -cp 30".split())
|
||||
modulator = urh_cli.build_modulator_from_args(args)
|
||||
self.assertEqual(modulator.modulation_type, "FSK")
|
||||
self.assertEqual(modulator.parameters[0], 20e3)
|
||||
self.assertEqual(modulator.parameters[1], -20e3)
|
||||
|
||||
def test_build_backend_handler_from_args(self):
|
||||
args = self.parser.parse_args("--device USRP --frequency 433.92e6 --sample-rate 2e6".split())
|
||||
bh = urh_cli.build_backend_handler_from_args(args)
|
||||
self.assertEqual(bh.device_backends["usrp"].selected_backend, Backends.native)
|
||||
|
||||
args = self.parser.parse_args("--device HackRF --frequency 433.92e6 --sample-rate 2e6"
|
||||
" --device-backend native".split())
|
||||
bh = urh_cli.build_backend_handler_from_args(args)
|
||||
self.assertEqual(bh.device_backends["hackrf"].selected_backend, Backends.native)
|
||||
|
||||
args = self.parser.parse_args("--device RTL-SDR --frequency 433.92e6 --sample-rate 2e6"
|
||||
" --device-backend gnuradio".split())
|
||||
bh = urh_cli.build_backend_handler_from_args(args)
|
||||
self.assertEqual(bh.device_backends["rtl-sdr"].selected_backend, Backends.grc)
|
||||
|
||||
def test_build_device_from_args(self):
|
||||
args = self.parser.parse_args("--device HackRF --frequency 133.7e6 --sample-rate 2.5e6 -rx "
|
||||
"-if 24 -bb 30 -g 0 --device-identifier abcde".split())
|
||||
device = urh_cli.build_device_from_args(args)
|
||||
self.assertEqual(device.sample_rate, 2.5e6)
|
||||
self.assertEqual(device.bandwidth, 2.5e6)
|
||||
self.assertEqual(device.name, "HackRF")
|
||||
self.assertEqual(device.backend, Backends.native)
|
||||
self.assertEqual(device.frequency, 133.7e6)
|
||||
self.assertEqual(device.mode, Mode.receive)
|
||||
self.assertEqual(device.if_gain, 24)
|
||||
self.assertEqual(device.gain, 0)
|
||||
self.assertEqual(device.baseband_gain, 30)
|
||||
self.assertEqual(device.device_serial, "abcde")
|
||||
|
||||
args = self.parser.parse_args("--device RTL-SDR --frequency 133.7e6 --sample-rate 1e6 "
|
||||
"-rx -db native --device-identifier 42".split())
|
||||
device = urh_cli.build_device_from_args(args)
|
||||
self.assertEqual(device.sample_rate, 1e6)
|
||||
self.assertEqual(device.name, "RTL-SDR")
|
||||
self.assertEqual(device.backend, Backends.native)
|
||||
self.assertEqual(device.frequency, 133.7e6)
|
||||
self.assertEqual(device.mode, Mode.receive)
|
||||
self.assertEqual(device.device_number, 42)
|
||||
|
||||
args = self.parser.parse_args("--device HackRF --frequency 133.7e6 --sample-rate 2.5e6 --bandwidth 5e6 "
|
||||
"-tx -db native".split())
|
||||
device = urh_cli.build_device_from_args(args)
|
||||
self.assertEqual(device.sample_rate, 2.5e6)
|
||||
self.assertEqual(device.bandwidth, 5e6)
|
||||
self.assertEqual(device.name, "HackRF")
|
||||
self.assertEqual(device.backend, Backends.native)
|
||||
self.assertEqual(device.frequency, 133.7e6)
|
||||
self.assertEqual(device.mode, Mode.send)
|
||||
|
||||
def test_build_protocol_sniffer_from_args(self):
|
||||
args = self.parser.parse_args("--device HackRF --frequency 50e3 --sample-rate 2.5e6 -rx "
|
||||
"-if 24 -bb 30 -g 0 --device-identifier abcde "
|
||||
"-sps 1337 --center 0.5 --noise 0.1234 --tolerance 42 "
|
||||
"-cs 0.42 -bps 4".split())
|
||||
sniffer = urh_cli.build_protocol_sniffer_from_args(args)
|
||||
self.assertEqual(sniffer.rcv_device.frequency, 50e3)
|
||||
self.assertEqual(sniffer.rcv_device.sample_rate, 2.5e6)
|
||||
self.assertEqual(sniffer.rcv_device.bandwidth, 2.5e6)
|
||||
self.assertEqual(sniffer.rcv_device.name, "hackrf")
|
||||
self.assertEqual(sniffer.rcv_device.backend, Backends.native)
|
||||
self.assertEqual(sniffer.rcv_device.mode, Mode.receive)
|
||||
self.assertEqual(sniffer.rcv_device.if_gain, 24)
|
||||
self.assertEqual(sniffer.rcv_device.gain, 0)
|
||||
self.assertEqual(sniffer.rcv_device.baseband_gain, 30)
|
||||
self.assertEqual(sniffer.rcv_device.device_serial, "abcde")
|
||||
self.assertEqual(sniffer.signal.samples_per_symbol, 1337)
|
||||
self.assertEqual(sniffer.signal.bits_per_symbol, 4)
|
||||
self.assertEqual(sniffer.signal.center_spacing, 0.42)
|
||||
self.assertEqual(sniffer.signal.noise_threshold, 0.1234)
|
||||
self.assertEqual(sniffer.signal.center, 0.5)
|
||||
self.assertEqual(sniffer.signal.tolerance, 42)
|
||||
|
||||
def test_build_encoding_from_args(self):
|
||||
args = self.parser.parse_args('--device HackRF --frequency 50e3 --sample-rate 2.5e6 -e "Test,Invert"'.split())
|
||||
encoding = urh_cli.build_encoding_from_args(args)
|
||||
self.assertEqual(len(encoding.chain), 2)
|
||||
|
||||
def test_read_messages_to_send(self):
|
||||
args = self.parser.parse_args('--device HackRF --frequency 50e3 --sample-rate 2e6 -rx'.split())
|
||||
self.assertIsNone(urh_cli.read_messages_to_send(args))
|
||||
|
||||
args = self.parser.parse_args('--device HackRF --frequency 50e3 --sample-rate 2e6 -tx'.split())
|
||||
with self.assertRaises(SystemExit):
|
||||
urh_cli.read_messages_to_send(args)
|
||||
|
||||
args = self.parser.parse_args('--device HackRF --frequency 50e3 --sample-rate 2e6 -tx '
|
||||
'-file /tmp/test -m 1111'.split())
|
||||
with self.assertRaises(SystemExit):
|
||||
urh_cli.read_messages_to_send(args)
|
||||
|
||||
test_messages = ["101010/1s", "10000/50ms", "00001111/100.5µs", "111010101/500ns", "1111001", "111110000/2000"]
|
||||
args = self.parser.parse_args(('--device HackRF --frequency 50e3 --sample-rate 2e6 -tx --pause 1337 '
|
||||
'-m ' + " ".join(test_messages)).split())
|
||||
messages = urh_cli.read_messages_to_send(args)
|
||||
self.assertEqual(len(messages), len(test_messages))
|
||||
self.assertEqual(messages[0].decoded_bits_str, "101010")
|
||||
self.assertEqual(messages[0].pause, 2e6)
|
||||
|
||||
self.assertEqual(messages[1].decoded_bits_str, "10000")
|
||||
self.assertEqual(messages[1].pause, 100e3)
|
||||
|
||||
self.assertEqual(messages[2].decoded_bits_str, "00001111")
|
||||
self.assertEqual(messages[2].pause, 201)
|
||||
|
||||
self.assertEqual(messages[3].decoded_bits_str, "111010101")
|
||||
self.assertEqual(messages[3].pause, 1)
|
||||
|
||||
self.assertEqual(messages[4].decoded_bits_str, "1111001")
|
||||
self.assertEqual(messages[4].pause, 1337)
|
||||
|
||||
self.assertEqual(messages[5].decoded_bits_str, "111110000")
|
||||
self.assertEqual(messages[5].pause, 2000)
|
||||
|
||||
test_messages = ["aabb/2s"]
|
||||
filepath = tempfile.mktemp()
|
||||
with open(filepath, "w") as f:
|
||||
f.write("\n".join(test_messages))
|
||||
|
||||
args = self.parser.parse_args(('--device HackRF --frequency 50e3 --sample-rate 2e6 -tx --pause 1337 --hex '
|
||||
'-file ' + filepath).split())
|
||||
messages = urh_cli.read_messages_to_send(args)
|
||||
self.assertEqual(len(messages), len(test_messages))
|
||||
self.assertEqual(messages[0].decoded_bits_str, "1010101010111011")
|
||||
self.assertEqual(messages[0].pause, 4e6)
|
||||
|
||||
def test_parse_project_file(self):
|
||||
f = os.readlink(__file__) if os.path.islink(__file__) else __file__
|
||||
path = os.path.realpath(os.path.join(f, ".."))
|
||||
|
||||
project_file = os.path.realpath(os.path.join(path, "..", "data", "TestProjectForCLI.xml"))
|
||||
tmp_project_file = os.path.join(tempfile.mkdtemp(), "URHProject.xml")
|
||||
shutil.copy(project_file, tmp_project_file)
|
||||
|
||||
project_params = urh_cli.parse_project_file(tmp_project_file)
|
||||
self.assertGreater(len(project_params), 0)
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="dead" color_index="0" id="37ce3f54-5962-4e59-b903-cec587838f6c" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="beef" color_index="0" id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000000001110001110111111010110111111010110100101000110100111000100010001" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.356909"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010000000101110111000101011011010010111010000000110011110111110001011100010111110101100011101100011101000111101111101010010011010110100010110101111110000100110001101000010001000100110011000100000101110000110011001111111100101100100101111101000000100011001000010110110001100101100101010110011000100010010010100101011000000100001000101100110000101110010010110101110001011000011001000111010100100000001110100111110001110010101010010101100000100101100000011011101110111010101111101010000110101010100001101010111101000111110000" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3573802"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000000100101010010011000111000001010101110011001010101001101110010110110" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3575044"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010000001111010111010000111001110111100010101011101010000100110110011110000101001000010010100001001001010001101011011001011100110101001111010110100110001110000001100100000111000101111100011100011011000010111110011001000010100001000011111011100001010010110001010011100011000111110001111010100010000001010000010011100110101010100110100110010100100001111111100000000001111111110001110000100100011110101100101010001111110111101000000100001110010110000001101110000110110100011001010101000011000010011000000000110001011101100011" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3579493"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000001000011011011001111100101010001111111010110011001010111011110010011" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.358067"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010000010110011000110011011010100010111111111110110000011010000100010011000101010010011010101101001010000110111010110000010010101110110110110111111011111010110000001110000101001110010110101000101111010100000110100101101101110000010111011101111110010011010111000011111000110101010101001101110101110011000001001011001010100010111101100011100000110110010011001000011011000001001011011010000000110110110110101000011101101101110100000001111100101000111111111000010110101110110001001111001001100010100001111001110100100000111000" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3585658"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000001100111010101110101110001010111011110100101011010100000100001110000" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3586884"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010000011100000011110111011000010011001000111011100111110100001000000111001001101001011110010000011011111011000101110000011101000001110001011100000101000000101011010011110110111110110001010100011110101111101101001111000110010100000010110011111111011010101000010111100100010001100000011100000011001110111011010101010111010111000000010010100001111111011101010000000001010000101000001101110101001001001011110111010011100010001100000100101110100001010110101101101000001010101001101100110001110110001000101000101110101100100110" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3591452"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000010000000010000101000110001110010000110110001000001111100011001110001" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3592691"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010000100101101110111010011011011010000011000101100011001100100000001010101111010101010111011000000000001000100101000111011000011100011000011011001000011011101011000010110101000000111100110001111110001101111011100101111110100110010010010100100111011111101100001111010010101101010001111101001010111110010010101101000000110010100101000011000011111110001011110011110101110000111110010110100000111111100111010010001101001101111101110000110111011100100010101110110011101001110001011011000111100101101010011111100100011100001011" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3597312"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000010101100000100110001111011000010010011111100100011101010110011110101" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3598483"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010000101110111110010110111110100001111001101010110000100101111100001100000001110101110001111101101010000101110010100001000010000110110011111000111110110110111100001011101101100111100111110110101011101110000101100110000111010000000111101011011000010011001000111110101100100110110111000111110010111111011100100001100010011010001101000011000001110010100101100110111100000010011101000001110101010011001111010010100001010111000001100000100111100110110011000001100001000001001010010100010110100000010101010111011011010001000000" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3603067"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000011000100110111100000101111111001110110101111011000101001000101101101" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3604224"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010000110100000001100110111111111101010010010100011010001101010010001010101111100101000011110011001000000000101011000011010010100000010001010001001000111110100101010110010011111100100011010111101000000110010110101111110010000101110001101011010001101111010010000001000100000100101100100101000010110100101000000110001010000001001001011000000101100011010110011010010001010111000110001001101100111001101100000010000010000001011000100101000011000011011110111100001001000110011011101101010010111100001111001011011110001010000110" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3608832"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000011101001001000111001111101100000101000100100110011101101111001110111" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3610005"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010000111101100000001100010110001010001010000100101000100110111011110101001111000000011001010100001000111011001100111010010001001110000100110000111100011110010010100111000101011110110000100101000100000010101001011111010001100011010110011100010011010110010010110110010010000111111100011110000010101000110111101110011100101111110110010001001000010001110111100011010001110100000110000110111011010010000001100001111010100100000110010000100101001100001111010001001000010010100100000100011100001110111000111000110101100010001110" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.361449"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000100000100101100101100101101000101000001010111001000010010100011110011" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3615682"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010001000111011101101001111010110101001010001111000010100100110101001110010100111000110100001001010101100110010101001011010000001111101001110100110101001011110110001011001111111110000000101001110101101100101101111011001001001110110111100110011000010010000100110110010101100111010001001000100000001101111001010010010100001011001101101011000001110011110110110110110010001110000100000111101011001011000110000111011001110011100001010100001000100000011011000101110010110100111101111101101111101010101010101110100100010111100101" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3620253"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000100101101001010101110111101000111101101101100010001101111011000110111" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3621418"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010001001111110000011011000101110000101111111100101011100001001011001001010001110000111111000101001011011110010110101010001011011111111101111011011001111100100101001000111001100110110011001111001001110010101111110110111000011001101110111000011110111110111001100101111101000110101011110000011111100101110011110001111001111010111100110101011111100100010001010100011100111010110000100111000001101010111000000000001101110010001111101100111100000001010011100010000010100110100011011001010101001000110011110001001000101001111111" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3625915"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000101000111011111000010110100100111000000010100111000100101110001010010" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3627083"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010001010101011011101000001010101110010011100000101011101111100100110110000110000100100011110111101000101110001111000111010010011000110010011010000000010101001001110110000100001011100001111000011110010011110001110110101001000101011111000111011111011110001111000010001101010000001101100011000011100001100000000000001011111100000101110001011001011010000100001101011101100101000000001101101100110010011101101011110000011110111101000111011101101100111000010010111011100101011101111101100010001000101001111101010110110010000010" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.363152"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000101101101010110100111111110001101110000110000000010110000000011001000" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3632681"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010001011101110110101110010010010010111101011110101111110110100010000101101101100000000010110111110011010000010011000011110000100110100000110001010010110010111110011111011010100000100001001000111101001001011110011110101010001000111110100010000001011010010001100011110111100100101111010110100100100000100010000010000110010101000100100101110010111011111101010100110010011001011111111101101011001011001100000000001011010000100000100110010001001111000101000001101001100111101100101110110110011100111110101111100100011010100001" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3637214"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000110001000111111000001100100110010101100100001000011100000110001110110" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3638372"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010001100101000000000110010111000100101010110010001000000110100100000011010010110010111011100100000111000110111011101111000101011110110000101011111000010100101111010001100101110000110110000100100111000000000111011011111101111000110100101001100001011010111100001111000100111111100011110000001111010111011001101110010011011010110110100111010110100100110100110000110111001111000011100110100010110001111101101011101111001010101100111010111000111010110101100111110111100011011001101100010011001011001111000000000100100001000101" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3642983"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000110100011100011100000110111110010010111111111010101010000001001010000" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.364427"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010001101100011001101001010000111100001011101011111101110111101001101001100100001100100000001001001001011010101000001010100011110111011111011011010001111110110100110111111001010001010111111101100010101110000111110101011011001100001000010010111011110010011101101111001110001101111001000001000111101011010010001000010110000011110011100110010110011101110111101100001001101110010100111101101100101011010111110001101111001001010010011101001101011011010101000010011100111011100010110010011111001110010001000101100001001011111010" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.364874"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000111001011011110000110100110100010110101001100000010111000011111111000" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3649895"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010001110101100111111100110000101111001010100000000111111110001101110011110000101100000011010111010010011100011000100000001010000110001001001111001010111010000011001111001100000100101110101110100000110000111110011001011011000101100000100101000001011011101100111111000101110010110001100010010011011000110100011011100111011000001001001001000000110101110111111011000011100101110101001010011010100100001111011010100011111010111101011000011101111011100001011100001000100000111111010110001010101101110111100101001011111010100010" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3654513"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111000111101111100000001100101110010001110101010100010001101110011010111001" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3655696"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010001111110011110010101111011010001010100101111111101000010100001100011111001001100110111101000000101000110111001011101001011101110010000011101111110100110010110001011110000011001111010010001011101000001111101110111011011101110100001010110111111100011100101100110110000000000110000010010000100000011100100100011110111000000110001110000111110011000101111110011111000111110010011100001010111110110100011001001001010001111010011100111110100000111100101111111011110111010110000101001101010011000111000100011001010000010000001" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3660169"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111001000000111010000000111001110111010111000101101101000111101101001010000" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3661318"/>
|
||||
<message bits="10101010000100110011011101000110101111101110111111011110101011010010000101010011010010001111001001010011000000010100111100011011000101101001010010101010100011110000101100000101100000111011000100010100101100101111010000101011001010011111011011111011100000001101110010101010011011011101001101110001011000010001101001000111000000011101100011001100101111001100010111110000010001001101101100001101001110011111100100011001011101001010010101010010100011010111110101111111011110110001100011110110101000100010001111111001101000011100000001000001111001000000100000011010010011101100111010000011" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="5a5999ec-dcc3-408b-b88f-158606c8eb8a" pause="0" timestamp="1555834796.3665833"/>
|
||||
<message bits="1010101000010011001101110000111011011110101011011011111011101111001000101101110010010110000111110000010001100111000100011101010010100001" message_type_id="4453e167-1974-409e-b3c4-6a9b25c464ea" modulator_index="0" participant_id="37ce3f54-5962-4e59-b903-cec587838f6c" pause="0" timestamp="1555834796.3666987"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="4453e167-1974-409e-b3c4-6a9b25c464ea" name="protocol_with_one_message_type">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="24" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="32" fuzz_me="2" fuzz_values="" name="length" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="48" fuzz_me="2" fuzz_values="" name="source address" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="48"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="72" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="64"/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
BIN
Software/Universal Radio Hacker/tests/data/ASK_mod.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/ASK_mod.complex
Normal file
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/FSK10.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/FSK10.complex
Normal file
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/FSK15.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/FSK15.complex
Normal file
Binary file not shown.
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" ?>
|
||||
<UniversalRadioHackerProject broadcast_address_hex="ffff" collapse_project_tabs="0" description="" modulation_was_edited="0">
|
||||
<modulators>
|
||||
<modulator carrier_amplitude="1" carrier_freq_hz="40000" carrier_phase_deg="0" gauss_bt="0.5" gauss_filter_width="1" index="0" modulation_type="0" name="Modulator" param_for_one="100" param_for_zero="0" sample_rate="None" samples_per_bit="100"/>
|
||||
</modulators>
|
||||
<device_conf>
|
||||
<bandwidth>1000000.0</bandwidth>
|
||||
<frequency>433920000.0</frequency>
|
||||
<gain>20</gain>
|
||||
<name>USRP</name>
|
||||
<sample_rate>1000000.0</sample_rate>
|
||||
</device_conf>
|
||||
<group id="0" name="New Group"/>
|
||||
<protocol>
|
||||
<decodings>
|
||||
<decoding>'Non Return To Zero (NRZ)', </decoding>
|
||||
<decoding>'Non Return To Zero Inverted (NRZ-I)', 'Invert', </decoding>
|
||||
<decoding>'Manchester I', 'Edge Trigger', </decoding>
|
||||
<decoding>'Manchester II', 'Edge Trigger', 'Invert', </decoding>
|
||||
<decoding>'Differential Manchester', 'Edge Trigger', 'Differential Encoding', </decoding>
|
||||
</decodings>
|
||||
<participants>
|
||||
<participant address_hex="" color_index="0" id="4ace88f5-1680-4ff6-ae2c-aebbfca912cb" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="" color_index="1" id="b615a02a-39e0-49af-a34b-00642b314da3" name="Bob" relative_rssi="1" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages/>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="22fd0cf0-99f9-41a6-9385-f2c2f8bf6aa5" name="default">
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
||||
</UniversalRadioHackerProject>
|
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings>
|
||||
<decoding>'Non Return To Zero (NRZ)', </decoding>
|
||||
<decoding>'Non Return To Zero Inverted (NRZ-I)', 'Invert', </decoding>
|
||||
<decoding>'Manchester I', 'Edge Trigger', </decoding>
|
||||
<decoding>'Manchester II', 'Edge Trigger', 'Invert', </decoding>
|
||||
<decoding>'Differential Manchester', 'Edge Trigger', 'Differential Encoding', </decoding>
|
||||
<decoding>'WSP', 'Wireless Short Packet (WSP)', </decoding>
|
||||
<decoding>'Nexa', 'Substitution', '100000:0;', 'Substitution', '10:1;', </decoding>
|
||||
</decodings>
|
||||
<participants>
|
||||
<participant address_hex="1337" color_index="0" id="0864c5a6-b020-4459-a8bf-457fc589303e" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="4711" color_index="0" id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111010001110001000100010110001110001100001101100001100101011011100000100010100111000101011011100101" decoding_index="0" message_type_id="e4c8f60b-b72c-4cb2-9206-43c6d6cd9ae8" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.1973796"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.1974692"/>
|
||||
<message bits="101010101010101010011010011111010100011101000111000100010001001100110111011110110110000010110110000001110000010100100100010000111110000011101001101110011111001011010001000111011110000100110101111000111110100011100010011010000010110000011101001111101011110101011011001101100101010001011110111100001111110111101101011010110101011110000110010001011110011001111101110101110001101010110110010101111111100001111000111100010100100001110011110110110110000111111000110011011111001000010000001111011010011001001101011110001010101011000000001111110011000100000100011100001100110101100101110101111101011011101010" decoding_index="0" message_type_id="0e697750-c73f-4992-854a-2074c0b273ac" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.1979609"/>
|
||||
<message bits="101010101010101010011010011111010000010101000111000100011001110000100100" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.1980429"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111010001110001000111111111101111001010011001000010100001011011110010010100010100100010100111100111" decoding_index="0" message_type_id="e4c8f60b-b72c-4cb2-9206-43c6d6cd9ae8" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.198185"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.198258"/>
|
||||
<message bits="101010101010101010011010011111010100011101000111000100010001001100110111011011000011000000010100011010010101001000001011110111111011001011010010001110111110110001100110110110100010001101111010011010110011001110000110010110000000101101111001101110100101111100010000100101000100100011111111010110110110101101001111100110010101011101101110010010000011011100001001011110010110111110110100000110000111111001110010111000101111011010001110101110101001001101011110100100100110010110011100101110100011001010100001100010010110101111010111010000011100011011001000001010010011011010100110010110101000100010110101" decoding_index="0" message_type_id="0e697750-c73f-4992-854a-2074c0b273ac" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.198747"/>
|
||||
<message bits="101010101010101010011010011111010000010101000111000100011001110000100100" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.1988373"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111010001110001000100111110000101000000101001110000111100011110101001000000110111111101111000010001" decoding_index="0" message_type_id="e4c8f60b-b72c-4cb2-9206-43c6d6cd9ae8" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.1989856"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.1990578"/>
|
||||
<message bits="101010101010101010011010011111010100011101000111000100010001001100110111111101110101001100100000001100111110101001001101111001010010010101010101010011111110001001010100111010010000110010011110111110100101010011011101000100000100011011111100110110111000001010000011000001110111001111101001001101111011110011010100001101001110011100110110000000100001010101011111111100100101100100001011101111000001011101011000100011111110001010101110110100101101101100001100110011001101010011111110110100111011101011101111001011011111110110111001111110101011111000100110101110110011111101100001011001111001001000101001" decoding_index="0" message_type_id="0e697750-c73f-4992-854a-2074c0b273ac" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.1997647"/>
|
||||
<message bits="101010101010101010011010011111010000010101000111000100011001110000100100" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.1998444"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111010001110001000110110010101010100000010101000110111001100011101101000110110011101011111101000010" decoding_index="0" message_type_id="e4c8f60b-b72c-4cb2-9206-43c6d6cd9ae8" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.1999872"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.2000594"/>
|
||||
<message bits="101010101010101010011010011111010100011101000111000100010001001100110111111010110001011101011010110101100010010110000110011100100111001100010110110010000000011101100100101010101111101101100101001000000000110001000001000110001011001110111001001000011110010101011001010010010111001000001010011100001001101010101000011100011101100101001011100000010110111101011000101100101100001101000101100100111001010111000001010000100100011101000011111000010111110101010101000010101100000001100011100101000111010011110100101110111110001101110001101111100100000101001111101100100100100111110010101011111100111010011001" decoding_index="0" message_type_id="0e697750-c73f-4992-854a-2074c0b273ac" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.2005653"/>
|
||||
<message bits="101010101010101010011010011111010000010101000111000100011001110000100100" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.200646"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111010001110001000100100001010110100010000101110000101010001111010111111010010010100100011001111101" decoding_index="0" message_type_id="e4c8f60b-b72c-4cb2-9206-43c6d6cd9ae8" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.2007873"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.2008598"/>
|
||||
<message bits="101010101010101010011010011111010100011101000111000100010001001100110111100001110010010001010001000110011001111100111111011011111010111011010010101010001010010011000110001111101111010100110011111101111000011100001000111000000110111000100011000001001000001110001000100100001000000110000000011011000010000101101000000000110101001000111000100101111011001010010001111010011110101011011111001111011011110010011100110111101010110101001000110010111110110110001110100111110000111100011011100011001011111001001100011010111110100000011000101001011110011011100000100010111001110010101110010000101110110010101110" decoding_index="0" message_type_id="0e697750-c73f-4992-854a-2074c0b273ac" modulator_index="0" participant_id="8e61e60d-89b8-42b3-ab43-0b3b225242f3" pause="0" timestamp="1555432607.201344"/>
|
||||
<message bits="101010101010101010011010011111010000010101000111000100011001110000100100" decoding_index="0" message_type_id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" modulator_index="0" participant_id="0864c5a6-b020-4459-a8bf-457fc589303e" pause="0" timestamp="1555432607.2014205"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="016735db-059a-4798-a6ad-ef13b2f62db2" name="Default">
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="e4c8f60b-b72c-4cb2-9206-43c6d6cd9ae8" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="56" fuzz_me="2" fuzz_values="" name="source address" show="2" start="40"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="72" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="56"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="136" fuzz_me="2" fuzz_values="" name="data" show="2" start="72"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="6" data_ranges="[(32, 136)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="152" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="136">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="0e697750-c73f-4992-854a-2074c0b273ac" name="data2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="56" fuzz_me="2" fuzz_values="" name="source address" show="2" start="40"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="72" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="56"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="584" fuzz_me="2" fuzz_values="" name="data" show="2" start="72"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="6" data_ranges="[(32, 584)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="600" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="584">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="f3856ff3-9fe7-48f9-a287-a03a784b33d6" name="ack">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="56" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="40"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="4" data_ranges="[(32, 56)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="72" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="56">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
BIN
Software/Universal Radio Hacker/tests/data/ask.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/ask.complex
Normal file
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/ask50.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/ask50.complex
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><04><><EFBFBD><0C><><EFBFBD><0C><><EFBFBD>$<24><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƾ<EFBFBD><C6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꾯<EFBFBD><EABEAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2BEAFAE><EFBFBD><EFBFBD><EFBFBD><F2BEB3B2><EFBFBD><EFBFBD><EFBFBD><EEBEB3><EFBFBD><EFBFBD><EFBFBD>꾷<EFBFBD><EABEB7><EFBFBD><EFBFBD><EFBFBD>澿<EFBFBD><E6BEBF><EFBFBD><EFBFBD><EFBFBD>⾿<EFBFBD><E2BEBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEBE>¾<EFBFBD><C2BE>ھ<EFBFBD><DABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⾳<EFBFBD><E2BEB3><EFBFBD><EFBFBD><EFBFBD>⾏<EFBFBD><E2BE8F><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>d<EFBFBD><64><EFBFBD>¾<EFBFBD><C2BE>ؽ<EFBFBD><D8BD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD>;<3B><>P<EFBFBD><50><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><0C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>$<24><><EFBFBD><0C><><EFBFBD>ƾ<EFBFBD><C6BE>$<24><><EFBFBD>־<EFBFBD><D6BE>\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T<EFBFBD><54><EFBFBD><01><><EFBFBD>T<EFBFBD><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T<EFBFBD><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T<EFBFBD><54><EFBFBD><01><><EFBFBD>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><<3C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><14><><EFBFBD><EFBFBD><DEBE>ؽ<EFBFBD><D8BD>ʾ<EFBFBD><CABE>0<EFBFBD><30><EFBFBD>$<24><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD><70><EFBFBD>@<<3C><><EFBFBD><<3C><>@<<3C><><EFBFBD><<3C><><EFBFBD>;<3B><>=<3D><>@<<3C><><EFBFBD><<3C><>@<<3C><><EFBFBD><<3C><>@<<3C><><EFBFBD><<3C><><EFBFBD><<3C><><EFBFBD><<3C><>@<<3C><><EFBFBD><<3C><>@<<3C><><EFBFBD><<3C><>@<<3C><>=<3D><>@<<3C><>=<3D><>0<EFBFBD><30><EFBFBD><EFBFBD><<3C><>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<40><><EFBFBD><1C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><10><><EFBFBD>־<EFBFBD><D6BE>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><03><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><03><><EFBFBD><10><><EFBFBD><05><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><05><><EFBFBD>Ƚ<EFBFBD><C8BD><03><><EFBFBD>ؽ<EFBFBD><D8BD><01><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><01><><EFBFBD><0C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><0C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><01><><EFBFBD>0<EFBFBD><30><EFBFBD>ھ<EFBFBD><DABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƾ<EFBFBD><C6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><0C><><EFBFBD><EFBFBD>;<3B><><10><><EFBFBD><EFBFBD><<3C><>P=<3D><><EFBFBD><<3C><>p=<3D><><EFBFBD><<3C><>P=<3D><><EFBFBD><<3C><>p=<3D><><EFBFBD><<3C><>p=<3D><><EFBFBD><<3C><>P=<3D><><EFBFBD><<3C><>p=<3D><><EFBFBD><<3C><>p=<3D><><EFBFBD><<3C><>P=<3D><><EFBFBD><<3C><>p=<3D><><EFBFBD><<3C><>P=<3D><><10><><EFBFBD>=<3D><>@<<3C><>ؽ<EFBFBD><D8BD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>P=<3D><>ʾ<EFBFBD><CABE><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><<3C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>P=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD>=<3D><>ξ<EFBFBD><CEBE><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0=<3D><>ؽ<EFBFBD><D8BD><EFBFBD><<3C><>@<40><><EFBFBD><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><><EFBFBD><<3C><><EFBFBD>=<3D><>@<<3C><><EFBFBD>=<3D><><10><><EFBFBD>p=<3D><>0=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD>
|
@ -0,0 +1,21 @@
|
||||
1010101010101010101010101010101010011010011111011001101001111101001011011000000001110000111000000000000000000011000110110110000000110011000000000000000100000000010000000011000000010100111101110100100010011100010110010100010100000000000000000000111111001001101101100000000000000001000000000000000000000000000000100000000100000100000101110000000000000010000000010000001010001100001111010111011100000000110110111011101101111011100110000000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000001100001101101100000001100110111100011100010100010010000000000000000
|
||||
10101010101010101010101010101010100110100111110110011010011111010011001000000000011100000001101101100000001100110111100011100010100010011100000000000001000001000000001000000110011100100100100110010111111110101010000011011101011011110000111101010111101010001001010010000111111101010111100101011010101001110111011011111110010101111100111000100100110100001111101111001011111001011000100010101011011001110001111010110101111100100110011001010011111011111011010101100111011010000000000000000000
|
||||
1010101010101010101010101010101010011010011111011001101001111101000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000000101001000011011110100110001001011001101110000110011000000000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100000111001100110101001001000110001101101000011000111110011111110110100011111001110111100100011101110101011100001011000010000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000001010110110100111000100100010001011010101101010011100001100000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100000111100111010000110001010100101011000010001101001000000010100101100011110011100010001000011000001001010000010000100110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000010101011111011101010110000010001110000110000011110000001110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001010000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100001000010011100100000101001100001010000001111001101001011110010111001000000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000011110000010100111010111110000000011011011111011111010011010000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001010000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100001000110010011100100111011000011111110001110100011111011110100000000010000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001011101100000011100000111100011100010100010010001101101100000001100110000000000000000000000000000010010011111101101101111001010101100111100000101101000011101001010110110000111100110000000110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
BIN
Software/Universal Radio Hacker/tests/data/cc1101.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/cc1101.complex
Normal file
Binary file not shown.
14
Software/Universal Radio Hacker/tests/data/code.py
Normal file
14
Software/Universal Radio Hacker/tests/data/code.py
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
|
||||
from subprocess import call
|
||||
|
||||
cur_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
if sys.argv[1] == "e":
|
||||
call(sys.executable + ' "' + os.path.join(cur_dir, "encode.py") + '"' + " " + sys.argv[2], shell=True)
|
||||
elif sys.argv[1] == "d":
|
||||
call(sys.executable + ' "' + os.path.join(cur_dir, "decode.py") + '"' + " " + sys.argv[2], shell=True)
|
||||
else:
|
||||
print("Unknown")
|
@ -0,0 +1,4 @@
|
||||
1010101010101010101010101010101010011011001111101100110100111110100101101100000000111000101111010101011110000111000000000000000000011000110110110000000110011000000000000000100000000010000000011000000010100111101110100100010011100010110010100010100000000000000000000111111001001101101100000000000000001000000000000000000000000000000100000000100000100000101110000000000000010000000010000001010001100001111010111011100000000110110111011101101111011100110000000000000000000
|
||||
1010101010101010101010101010101001100111101101000011001110110100000000110000110110111000101111010101011100000001100110111100011100010100010010000000000000000
|
||||
10101010101010101010101010101010100110110011111011001101001111101001100100000000001110001011110101010111100000001101101100000001100110111100011100010100010011100000000000001000001000000001000000110011100100100100110010111111110101010000011011101011011110000111101010111101010001001010010000111111101010111100101011010101001110111011011111110010101111100111000100100110100001111101111001011111001011000100010101011011001110001111010110101111100100110011001010011111011111011010101100111011010000000000000000000
|
||||
1010101010101010101010101010101010011011001111101100110100111110100000011011110001111000101111010101011100010100010010000000000000000
|
105
Software/Universal Radio Hacker/tests/data/csvtest.csv
Normal file
105
Software/Universal Radio Hacker/tests/data/csvtest.csv
Normal file
@ -0,0 +1,105 @@
|
||||
; CSV, generated by libsigrok4DSL 0.2.0 on Wed Nov 1 21:19:30 2017
|
||||
; Channels (2/2)
|
||||
; Sample rate: 100 MHz
|
||||
; Sample count: 1 M Samples
|
||||
0 (Unit: mV), 1 (Unit: V)
|
||||
0.23,-10.07
|
||||
0.23,-10.07
|
||||
-0.56,-10.07
|
||||
-2.13,-10.26
|
||||
-2.13,-10.26
|
||||
-2.13,-10.07
|
||||
-5.26,-10.07
|
||||
-4.48,-10.07
|
||||
-3.69,-10.07
|
||||
-5.26,-10.07
|
||||
-3.69,-10.07
|
||||
-2.91,-10.07
|
||||
-2.91,-10.07
|
||||
-2.13,-10.07
|
||||
-2.13,-10.26
|
||||
-2.13,-10.07
|
||||
-0.56,-10.07
|
||||
-0.56,-10.07
|
||||
0.23,-10.07
|
||||
0.23,-10.26
|
||||
1.01,-10.26
|
||||
2.58,-10.26
|
||||
2.58,-10.26
|
||||
4.15,-10.07
|
||||
4.93,-10.07
|
||||
4.93,-10.07
|
||||
4.15,-10.07
|
||||
5.72,-10.07
|
||||
4.15,-10.07
|
||||
5.72,-10.07
|
||||
4.15,-10.07
|
||||
4.15,-10.07
|
||||
4.15,-10.07
|
||||
3.36,-10.26
|
||||
2.58,-10.26
|
||||
3.36,-10.07
|
||||
2.58,-10.07
|
||||
1.80,-10.07
|
||||
1.01,-10.26
|
||||
1.01,-10.26
|
||||
0.23,-10.07
|
||||
-0.56,-10.07
|
||||
-2.13,-10.07
|
||||
-2.13,-10.26
|
||||
-2.91,-10.07
|
||||
-2.13,-10.26
|
||||
-2.13,-10.26
|
||||
-2.91,-10.07
|
||||
-2.91,-10.26
|
||||
-2.13,-10.26
|
||||
-2.91,-10.07
|
||||
-2.13,-10.26
|
||||
-2.13,-10.26
|
||||
-2.91,-10.07
|
||||
-2.91,-10.07
|
||||
-2.13,-10.07
|
||||
-2.91,-10.26
|
||||
-2.13,-10.07
|
||||
-0.56,-10.26
|
||||
-0.56,-10.07
|
||||
1.01,-10.07
|
||||
3.36,-10.07
|
||||
3.36,-10.07
|
||||
3.36,-10.07
|
||||
3.36,-10.26
|
||||
4.15,-10.26
|
||||
3.36,-10.07
|
||||
3.36,-10.07
|
||||
4.15,-10.07
|
||||
2.58,-10.26
|
||||
3.36,-10.26
|
||||
3.36,-10.07
|
||||
3.36,-10.07
|
||||
3.36,-10.07
|
||||
3.36,-10.07
|
||||
2.58,-10.26
|
||||
2.58,-10.07
|
||||
1.80,-10.07
|
||||
1.01,-10.07
|
||||
1.80,-10.07
|
||||
2.58,-10.07
|
||||
0.23,-10.07
|
||||
0.23,-10.26
|
||||
0.23,-10.07
|
||||
-1.34,-10.26
|
||||
-2.13,-10.07
|
||||
-0.56,-10.07
|
||||
-2.13,-10.07
|
||||
-2.13,-10.26
|
||||
-2.13,-10.07
|
||||
-1.34,-10.07
|
||||
-0.56,-10.07
|
||||
0.23,-10.07
|
||||
0.23,-10.26
|
||||
0.23,-10.26
|
||||
1.01,-10.07
|
||||
1.01,-10.26
|
||||
0.23,-10.26
|
||||
1.01,-10.07
|
||||
1.01,-10.07
|
|
9
Software/Universal Radio Hacker/tests/data/decode.py
Normal file
9
Software/Universal Radio Hacker/tests/data/decode.py
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Simple example external decoding
|
||||
Simply removes every second bit
|
||||
"""
|
||||
|
||||
import sys
|
||||
bits = sys.argv[1]
|
||||
print("".join(b for b in bits[::2]))
|
42
Software/Universal Radio Hacker/tests/data/decoded_bits.txt
Normal file
42
Software/Universal Radio Hacker/tests/data/decoded_bits.txt
Normal file
@ -0,0 +1,42 @@
|
||||
1010101010101010101010101010101010011010011111011001101001111101001011011000000001110000111000000000000000000011000110110110000000110011000000000000000100000000010000000011000000010100111101110100100010011100010110010100010100000000000000000000111111001001101101100000000000000001000000000000000000000000000000100000000100000100000101110000000000000010000000010000001010001100001111010111011100000000110110111011101101111011100110000000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000001100001101101100000001100110111100011100010100010010000000000000000
|
||||
10101010101010101010101010101010100110100111110110011010011111010011001000000000011100000001101101100000001100110111100011100010100010011100000000000001000001000000001000000110011100100100100110010111111110101010000011011101011011110000111101010111101010001001010010000111111101010111100101011010101001110111011011111110010101111100111000100100110100001111101111001011111001011000100010101011011001110001111010110101111100100110011001010011111011111011010101100111011010000000000000000000
|
||||
1010101010101010101010101010101010011010011111011001101001111101000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000000101001000011011110100110001001011001101110000110011000000000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100000111001100110101001001000110001101101000011000111110011111110110100011111001110111100100011101110101011100001011000010000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000001010110110100111000100100010001011010101101010011100001100000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100000111100111010000110001010100101011000010001101001000000010100101100011110011100010001000011000001001010000010000100110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000010101011111011101010110000010001110000110000011110000001110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001010000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100001000010011100100000101001100001010000001111001101001011110010111001000000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000011110000010100111010111110000000011011011111011111010011010000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001010000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100001000110010011100100111011000011111110001110100011111011110100000000010000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001011101100000011100000111100011100010100010010001101101100000001100110000000000000000000000000000010010011111101101101111001010101100111100000101101000011101001010110110000111100110000000110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100110000000000000000
|
||||
1010101010101010101010101010101010011010011111011001101001111101001011011000000001110000111000000000000000000011000010000100111101111110000000000000000100000000010000000011000000010100111101110100100010011100010110010100010100000000000000000000111111001001101101100000000000000001000000000000000000000000000000100000000100000100000101110000000000000010000000010000001011000101111011110000000000000000011100100100111010011101001010000000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000001100000100001001111011111100111100011100010100010010000000000000000
|
||||
10101010101010101010101010101010100110100111110110011010011111010011001000000000011100000000100001001111011111100111100011100010100010011100000000000001000001000000001010100011011001010110110111111101100010111110100111010010001101011111100010111010111000000111100001101000110111001110101110101011101110011100010011110001011000011111010010001000010100000001111101100110100011100010111111011101110010111110111001111001100111000111011100100111100011100101111101100111011010000000000000000000
|
||||
1010101010101010101010101010101010011010011111011001101001111101000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100001000010011110111111000000000000000000000000100000000111001011011001011101000011000110111111101101010010101100000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110000100001001111011111100000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000000100001001111011111100111100011100010100010010000000000001101000001100001100110000111100100100101010110101011110100011000101110001011111110111001011000000000110100001001100101001010010001110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100001000010011110111111000000000000000000000000100000001101111011111100101011101001000000000101001011111101011110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110000100001001111011111100000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000000100001001111011111100111100011100010100010010000000000001101000001100001101010101011000011011000111010001100100111111100110011000010011101110111011000100011010000000111111010011111111010100000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100001000010011110111111000000000000000000000000100000010111101110001001001101101011110101100010111100000001100100000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110000100001001111011111100000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001010000100000011100000000100001001111011111100111100011100010100010010000000000001101000001100001101100101011100101110110010100100101011111010111010100010011100010100000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010000000000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100001000010011110111111000000000000000000000000100000011001010110011011111000111110000100111001011101110010010110000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110000100001001111011111100000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001010000100000011100000000100001001111011111100111100011100010100010010000000000001101000001100001110011111110011001000000111101001111001100100110000110010111101010000000000000000000
|
||||
10101010101010101010101010101010011001110110100001100111011010000001011101100000011100000111100011100010100010010000100001001111011111100000000000000000000000010000010000001110000101111000100010010100111101111011000101101000011110001011011000110110100010100000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110000100001001111011111100000000000000000
|
@ -0,0 +1,7 @@
|
||||
101010101010101010101010101010101001101001111101100110100111110100101101100000000111000011100000000000000000001100001001010100110110110100000000000000010000000001000000001100000001010011110111010010001001110001011001111110111100000000000000000000010111001011100100000000000000000100000000000000000000000000001000000001000000010000011000000000000000000100000010000000100111111101010010010111000011000100110001101001000101000111110101010011001111101110
|
||||
1010101010101010101010101010101001100111011010000110011101101000000001100000100101010011011011010111100011100010100010010000000000000000
|
||||
1010101010101010101010101010101001100111011010000110011101101000000101000010000001110000101111010111001110011011011110001110001010001001000000000000110101010101101110100101001100110010010000010001110111110100000011000111001010010010000011100001111010
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000
|
||||
101010101010101010101010101010100110011101101000011001110110100000000011101111010111001110011011101010111000110111
|
||||
101010101010101010101010101010101001101001111101100110100111110100110010000000000111000000001001010100110110110101111000111000101000100111000000000000010000010000000010100011010110111110001000101101100100101001011000110101111111011101000111111011100010110100011010111101101110001010001010110111101010101011100011001000010011100010010111100100000001110001111110111101011000101101101111001110000110010111111011101001101111000001010111011010001000100110001110011001110110100010110100000010111
|
||||
10101010101010101010101010101010100110100111110110011010011111010000001101111000111000101000100100001010111000000
|
BIN
Software/Universal Radio Hacker/tests/data/demodulated.wav
Normal file
BIN
Software/Universal Radio Hacker/tests/data/demodulated.wav
Normal file
Binary file not shown.
Binary file not shown.
9
Software/Universal Radio Hacker/tests/data/encode.py
Normal file
9
Software/Universal Radio Hacker/tests/data/encode.py
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Simple example external encoding
|
||||
Simply doubles each bit of the input
|
||||
"""
|
||||
|
||||
import sys
|
||||
bits = sys.argv[1]
|
||||
print("".join(b+b for b in bits))
|
File diff suppressed because one or more lines are too long
12
Software/Universal Radio Hacker/tests/data/enocean_bits.txt
Normal file
12
Software/Universal Radio Hacker/tests/data/enocean_bits.txt
Normal file
@ -0,0 +1,12 @@
|
||||
1010101010010110000101010000000000101100000111000000001010011011
|
||||
1010101010010110000101010000000000101100000111000000001010011011
|
||||
1010101010010110000101010000000000101100000111000000001010011011
|
||||
1010101010010101000000000000000000101100000111000000001000101011
|
||||
1010101010010101000000000000000000101100000111000000001000101011
|
||||
1010101010010101000000000000000000101100000111000000001000101011
|
||||
1010101010010110000100000000000000101100000111000000001001001011
|
||||
1010101010010110000100000000000000101100000111000000001001001011
|
||||
1010101010010110000100000000000000101100000111000000001001001011
|
||||
1010101010010101000000000000000000101100000111000000001000101011
|
||||
1010101010010101000000000000000000101100000111000000001000101011
|
||||
1010101010010101000000000000000000101100000111000000001000101011
|
BIN
Software/Universal Radio Hacker/tests/data/esaver.complex16s
Normal file
BIN
Software/Universal Radio Hacker/tests/data/esaver.complex16s
Normal file
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
messages = sys.stdin.readlines()
|
||||
|
||||
# we get something like
|
||||
# ->1010100000111111
|
||||
# <-1000001111000000
|
||||
|
||||
message = messages[0]
|
||||
direction = message[0:2]
|
||||
|
||||
if direction == "->":
|
||||
result = "10" * int(sys.argv[1])
|
||||
else:
|
||||
result = "01" * int(sys.argv[1])
|
||||
|
||||
print(result, end="")
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="24" color_index="0" id="720a8177-37e0-41be-950f-dd8dc30b6494" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="ff" color_index="0" id="5a9e3f21-ae65-4330-94dc-500439c19f8e" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10001110100010000000101100100100000011001101101001010111101001111011011001111010000001110100000000010010" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="720a8177-37e0-41be-950f-dd8dc30b6494" pause="0" timestamp="1555746507.8864236"/>
|
||||
<message bits="100011101000100001000011111111110000000101010111001001011111000010101010010011100110000101101101100001101101001101111000111000101111111011100001101000011101000100010011100100100101110110011111001000000110010000111100001011010100111100100111111011100110101111000100110000100010111100101010101001010111001010010011001110001001010110111110000011100010110111011011001111000111111010010111001000011001111001110010111011111001010110100111110101100010110000010110111101110100000110100010100100011101011010101101001010011000100011010101101011100001000011101101" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="5a9e3f21-ae65-4330-94dc-500439c19f8e" pause="0" timestamp="1555746507.8868656"/>
|
||||
<message bits="10001110100010000000101000110101110100010011010100100001110111111000110101110001100000001000101011010001" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="720a8177-37e0-41be-950f-dd8dc30b6494" pause="0" timestamp="1555746507.8869712"/>
|
||||
<message bits="100011101000100001000011111111110000001110110010100101111011010100101100001010010111010010100101100000001111110000000110000100110000100101000110000000110000011000111111010111000010000100101000010100110000000001010100000101111100101000101011011001101001111111111110101100000111011010111100101001110101001111000110111110111100000111111101100110110011100100000010000100101010100111110001110100000011110100011010101001101011010000111110100100100010010001110011000101011101010111001100101010110111110110000101111001110100000110011100010101011101111101011000" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="5a9e3f21-ae65-4330-94dc-500439c19f8e" pause="0" timestamp="1555746507.8874078"/>
|
||||
<message bits="10001110100010000000101100100100000001000010001101101000010001011001010100010010010011001001111110110000" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="720a8177-37e0-41be-950f-dd8dc30b6494" pause="0" timestamp="1555746507.8875117"/>
|
||||
<message bits="100011101000100001000011111111110000010110100000111010011011001111100110010110111101000111010101111100100011101010100100010110000011011010001010001001010111100011111000110000110011011000001101010111001101110110001000100001101011100010110111001011000001101011001010111110110011110100101110100101001000000111111100111001001000101000100000011100110010000000011011111110000100100101000111000111010101011011110010110100011011010001101000000100111010000100111001011001011101001110100110110101100011011001110011001011011101011111111101110010100010101110101011" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="5a9e3f21-ae65-4330-94dc-500439c19f8e" pause="0" timestamp="1555746507.8879437"/>
|
||||
<message bits="10001110100010000000101100100100000001101111000001011110011010100001000111110000010101010010011010111111" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="720a8177-37e0-41be-950f-dd8dc30b6494" pause="0" timestamp="1555746507.8880446"/>
|
||||
<message bits="100011101000100001000011111111110000011100011010000001101011011011101110011000111011110011011000111000011101000001101101100110011100101110101010100001100010001100101100001100000001010101110111001100010011111100011110111011010110110110110010001101111001011100101001010001010101100001111001000101010010000111111111101111110010010000001110111100101110101101101001011010010101010111101110000100000110010011100110110001011000100100001101011010111111010100101010011111010100100111111101001010000110110111000110100010111011001011001110101110100001001011111110" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="5a9e3f21-ae65-4330-94dc-500439c19f8e" pause="0" timestamp="1555746507.8884826"/>
|
||||
<message bits="10001110100010000000101100100100000010001011001011011110011000101111010100010110001011100100111001010111" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="720a8177-37e0-41be-950f-dd8dc30b6494" pause="0" timestamp="1555746507.8885853"/>
|
||||
<message bits="100011101000100001000011111111110000100111101011001101010010101111110011001000010110101111100010100101010000101101100001001101111011010100011000100110000000100110001010000111100110110000011001100111011101110111111011101011010010100011101100010100110110110110101101000011111000001011111001011001100110001000101110110100100111100100000011001101101010101100100100011101011001000111001001100100100101110100011011011011011000010010101011111110101110111001011111000100001101011101110101001001110010100001010101000101010111000001101110011111000001111101100110" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="5a9e3f21-ae65-4330-94dc-500439c19f8e" pause="0" timestamp="1555746507.889015"/>
|
||||
<message bits="10001110100010000000101100100100000010101000101110101001100010110011010000100011111111010000000111010100" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="720a8177-37e0-41be-950f-dd8dc30b6494" pause="0" timestamp="1555746507.889118"/>
|
||||
<message bits="100011101000100001000011111111110000101110111111011100000001000101011101001001010010101000000101011100011010101000011101101000100101111010000110010010001100000101010110011101000110100000000000010011001111000100001101001000110011000110111110110011000111001000110100100011011010001110111111001000010011111010110111001101100100000111101101100000011111100010000010111000011011111011000110101101100100010100001101001110110011111111111100110110001000001011110000000011010001001000101101001010100001111001000110010011110000001101010101010101100000000111011001" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="5a9e3f21-ae65-4330-94dc-500439c19f8e" pause="0" timestamp="1555746507.8895638"/>
|
||||
<message bits="10001110100010000000101100100100000011000000101111111011101110100011111011011100100110111100110011100101" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="720a8177-37e0-41be-950f-dd8dc30b6494" pause="0" timestamp="1555746507.8896673"/>
|
||||
<message bits="100011101000100001000011111111110000110101010111101101111010111110000011101100001001000000110000011001111101100001110000000010111110011101001001011100111110110110111100110101001100010010110101000111001100111101001000100101101100100100110001111011000110101011110000001110010011100110111011110001111100110011110001111100100111000111000001010010001110000011000101111110010110111001111111001000001111010010001010110101010100010011110011011101001110011010111110100011001100011001101000111111101111111001001000001100101001111000100110110101011100100101010000" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="5a9e3f21-ae65-4330-94dc-500439c19f8e" pause="0" timestamp="1555746507.8900971"/>
|
||||
<message bits="10001110100010000000101100100100000011100001110011110001011000100000100011011111101011110101110010011001" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="720a8177-37e0-41be-950f-dd8dc30b6494" pause="0" timestamp="1555746507.890198"/>
|
||||
<message bits="100011101000100001000011111111110000111100001010010111111111001010001001011000100000010111010010001101100011111110001010100010110100101001010101100110000101100100000001100111010011100100111000000011011010100011111111100000011000010000001001011110110100011100000010001001011110110101000100000011011101000010101100010000000010000111010101100000001101010100110001011101001111111100100011001101110000000100010110000110000111100100000001000100011101001000101001100110101111110001100000101100110111001100010010110111100010110000110111101001111111011011011010" message_type_id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" modulator_index="0" participant_id="5a9e3f21-ae65-4330-94dc-500439c19f8e" pause="0" timestamp="1555746507.8906255"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="6f0186c2-2bc9-44f7-9b85-bda62e88c8dd" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="24" fuzz_me="2" fuzz_values="" name="length" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="source address" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="32"/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="313370" color_index="0" id="2578de59-87e2-4545-8b81-292751355445" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="031337" color_index="0" id="7e3df95a-3351-4587-bae1-63aa68c777a8" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
<participant address_hex="110000" color_index="0" id="6949072a-7077-4218-8abe-e558c89871b8" name="Charly" relative_rssi="0" shortname="C" simulate="0"/>
|
||||
<participant address_hex="001100" color_index="0" id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" name="Daniel" relative_rssi="0" shortname="D" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10101010101010100000010000100000000101010000001100010011001101110011000100110011011100000000000000000000000000000000000001110100000001110011101110101110001011011010001111011010010100001010011111000000" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7447739"/>
|
||||
<message bits="1010101000100010001000100011000100110011011100000010011011110111" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7448528"/>
|
||||
<message bits="1010101010101010101010100110011101100111000100010000000000000000000000110001001100110111010100110100100011110010010100110000000101001111000110110001011010010100101010101000111100001011000001011000001110110001000101001011001011110100001010110010100111110110111110111000000011011100101010100110110111010011011100010110000100011010010001110000000111011000110011001011110011000101111100000100010011011011000011010011100111111001000110010111010010100101010100101000110101111101011111110111101100011000111101101010001000100011111110011010000111000000010000011110010000001000000110100100111011001110100000111111000101101110" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7453322"/>
|
||||
<message bits="1010101000100010001000100000001100010011001101111110010010001101" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.745404"/>
|
||||
<message bits="10101010101010100000010000100000000101010000000000010001000000000001000100000000000000000000000000000000000000000000000111011100100101100001111100000100011001110001000111010100101000010011010010011100" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.745555"/>
|
||||
<message bits="1010101000100010001000100001000100000000000000001000111101010111" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7456198"/>
|
||||
<message bits="1010101010101010101010100110011101100111001100010011001101110000000000000001000100000000110011010111101011101000010101011101010100011100101010101111111111010100101000111010010110100101001000110000110000110000111101110011000110101100010001010000111011010100000001101011110011101100110111010101011011111010000110101010101101101001101111001100100100100010001000101010000111101111000111000111110110011111001001001000101111101000010010010111110101011011110001111100001000010000001100110111100101101010100100100001001000011001011011001100010010011110110010001000111101010000101110111110011011111111110111101101110101010101" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7460933"/>
|
||||
<message bits="1010101000100010001000100000000000010001000000001110100000000011" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7461617"/>
|
||||
<message bits="10101010101010100000010000100000000101010000001100010011001101110011000100110011011100000000000000000000000000000000001010010101000111010101100011111100011110010100010100000000110101110111000100101001" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7463086"/>
|
||||
<message bits="1010101000100010001000100011000100110011011100000010011011110111" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7463715"/>
|
||||
<message bits="1010101010101010101010100110011101100111000100010000000000000000000000110001001100110111111011001101010011010000011110010010001001010110100101100001110101011000111000010000000001100001110111100101010111001101000010000111010111010100100011101100111100101111000101000000011011000011101111011010111011101010001111100000111000011001100101010101110011111101000101111011100111011100000101001010100001110001001101010100011001011111111101000000101100111100001101011010111111110010101100010100001000011010101111100010000101000011101011101100100001111010011001011110001011001001000101101110001111110110100101101111101111001100" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7468488"/>
|
||||
<message bits="1010101000100010001000100000001100010011001101111110010010001101" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.7469163"/>
|
||||
<message bits="10101010101010100000010000100000000101010000000000010001000000000001000100000000000000000000000000000000000000000000001110111010000110001001001111000011111010001110100100101100010101000000111001111110" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.747066"/>
|
||||
<message bits="1010101000100010001000100001000100000000000000001000111101010111" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7471309"/>
|
||||
<message bits="1010101010101010101010100110011101100111001100010011001101110000000000000001000100000000111101110100001000011110000110100101001000001111110110101100101101010110010001101100110101110001101000101110001000101100011001100101010010111000010110101011010100011111011110110010011001001101010101000111100101010000110000100000110011100011011101110100001111110100110111111010110101010000000110101001000101110000010000101100011010001001111101000110010100110101111011000100111101010111110110001001111101010001101011110100111111100001111010100111100000001011100011001011101101011011001101111110011010111111101001001000011111100011" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7476048"/>
|
||||
<message bits="1010101000100010001000100000000000010001000000001110100000000011" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7476716"/>
|
||||
<message bits="10101010101010100000010000100000000101010000001100010011001101110011000100110011011100000000000000000000000000000000010011000110101000011110111010001111000001010011001111101010110010000010111000001001" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7478194"/>
|
||||
<message bits="1010101000100010001000100011000100110011011100000010011011110111" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7478826"/>
|
||||
<message bits="1010101010101010101010100110011101100111000100010000000000000000000000110001001100110111111101000011010111010010011001010000100100100011011100011010011010110111001000111111100101100110110101011000111010000100111100110100110011111000100101111010001000011111100101011010111101011001111111011001111000101000101100010011101000010010100101010110010000010001111011000100000000100110010011011101111100111010010010010110101100001011110011101001101001001101010101011100011011001100111001101011001110110101101011000011110111011001000001100100011100010101110000111100100000111011000100110101100000010111000110001011100101010001" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.748354"/>
|
||||
<message bits="1010101000100010001000100000001100010011001101111110010010001101" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.748421"/>
|
||||
<message bits="10101010101010100000010000100000000101010000000000010001000000000001000100000000000000000000000000000000000000000000010100000000101101101111110001101011011010100001000110011100100001111000001001101101" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.7485673"/>
|
||||
<message bits="1010101000100010001000100001000100000000000000001000111101010111" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7486312"/>
|
||||
<message bits="1010101010101010101010100110011101100111001100010011001101110000000000000001000100000000110110100000101010111011101101100011000111101100011110110001011011111101101100010001010011110001001101110001100011110010100110111111000001100111111100110100000010101100110110000111100110001110011000100011110010000100100100100010011010001101100011001110111101010100110111100001001101001111110110001101000001110100010110001110000101100010011000010100110110001100000100101010100000011111101000000110001111110001010010101010110000100011001000010000110111011001101110111000000001111110000001110100110100101011000110111100001010110010" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7491055"/>
|
||||
<message bits="1010101000100010001000100000000000010001000000001110100000000011" message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.749173"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="40"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="source address" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="120" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="184" fuzz_me="2" fuzz_values="" name="data" show="2" start="120"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="7" data_ranges="[(32, 184)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="200" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="184">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="6479c599-6f89-488f-ae56-8fae07b0d9b0" name="ack">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="24" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="48" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="24"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="3" data_ranges="[(24, 48)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="48">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" name="kex">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="24" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="40" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="40"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="source address" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="600" fuzz_me="2" fuzz_values="" name="data" show="2" start="88"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="5" data_ranges="[(40, 600)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="616" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="600">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
BIN
Software/Universal Radio Hacker/tests/data/fsk.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/fsk.complex
Normal file
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/fsk_live.coco
Normal file
BIN
Software/Universal Radio Hacker/tests/data/fsk_live.coco
Normal file
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/homematic.complex32s
Normal file
BIN
Software/Universal Radio Hacker/tests/data/homematic.complex32s
Normal file
Binary file not shown.
153
Software/Universal Radio Hacker/tests/data/homematic.proto.xml
Normal file
153
Software/Universal Radio Hacker/tests/data/homematic.proto.xml
Normal file
@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings>
|
||||
<decoding>'Non Return To Zero (NRZ)', </decoding>
|
||||
<decoding>'Non Return To Zero Inverted (NRZ-I)', 'Invert', </decoding>
|
||||
<decoding>'Manchester I', 'Edge Trigger', </decoding>
|
||||
<decoding>'Manchester II', 'Edge Trigger', 'Invert', </decoding>
|
||||
</decodings>
|
||||
<participants>
|
||||
<participant address_hex="3927cc" color_index="3" id="af97bec6-d417-47d8-a112-94c0015e1d73" name="CCU" relative_rssi="0" shortname="C" simulate="0"/>
|
||||
<participant address_hex="4ca2f9" color_index="0" id="23f35303-fb89-408f-88b3-f0ec87b863fc" name="Fernbedienung" relative_rssi="1" shortname="F" simulate="1"/>
|
||||
<participant address_hex="3101cc" color_index="2" id="25bc0d02-ce8e-478e-a4d0-b22cfbab004a" name="Schalter" relative_rssi="2" shortname="S" simulate="1"/>
|
||||
<participant address_hex="" color_index="19" id="a293bffc-118c-4bd2-89d8-af9a893808fd" name="Attacker" relative_rssi="3" shortname="A" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100000101100100100101001100100000000111001001001111100110000110001000000011100110000000010000100011100001000000011" decoding_index="0" message_type_id="fe1be813-fc18-44bc-8931-40a35cab9c8c" modulator_index="0" participant_id="af97bec6-d417-47d8-a112-94c0015e1d73" pause="219927" timestamp="1521474143.9854395"/>
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100001000100100100101000000000001000110001000000011100110000111001001001111100110000000100001111110100011100110101001011010110000110100001000000101111011111011000" decoding_index="0" message_type_id="7880a7fd-7ea0-44bb-8016-ddaee5df84ec" modulator_index="0" participant_id="25bc0d02-ce8e-478e-a4d0-b22cfbab004a" pause="203067" timestamp="1521474143.985474"/>
|
||||
<message bits="101010101010101010101010101010101110100111001010111010011100101000011001001001001010000000000011001110010010011111001100001100010000000111001100101100001100010100111010111100100011000110111010010111011111110001011011010101000001110000100000001101011101111111000000000100101100010010000010" decoding_index="0" message_type_id="e66e6119-d636-4165-b3b3-30e32c0ce8c5" modulator_index="0" participant_id="af97bec6-d417-47d8-a112-94c0015e1d73" pause="198793" timestamp="1521474143.9855015"/>
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100000111000100100100000000000001000110001000000011100110000111001001001111100110000000000100010011001010000110010111000011110011100010111" decoding_index="0" message_type_id="bd3a5291-0677-4b35-b821-4bd366a57592" modulator_index="0" participant_id="25bc0d02-ce8e-478e-a4d0-b22cfbab004a" pause="846702" timestamp="1521474143.9855273"/>
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100000101100100101101001100100000000111001001001111100110000110001000000011100110000000001000010010101110100010000" decoding_index="0" message_type_id="fe1be813-fc18-44bc-8931-40a35cab9c8c" modulator_index="0" participant_id="af97bec6-d417-47d8-a112-94c0015e1d73" pause="219416" timestamp="1521474143.9855523"/>
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100001000100100101101000000000001000110001000000011100110000111001001001111100110000000100000111001111011001000000010000100100000101010001000000101101000111000001" decoding_index="0" message_type_id="7880a7fd-7ea0-44bb-8016-ddaee5df84ec" modulator_index="0" participant_id="25bc0d02-ce8e-478e-a4d0-b22cfbab004a" pause="203576" timestamp="1521474143.9855769"/>
|
||||
<message bits="101010101010101010101010101010101110100111001010111010011100101000011001001001011010000000000011001110010010011111001100001100010000000111001100100100110010110101100001010001110100100101000001101101001101001001010000000001010001000011010100110110110100001010111110011001001011000010100100" decoding_index="0" message_type_id="e66e6119-d636-4165-b3b3-30e32c0ce8c5" modulator_index="0" participant_id="af97bec6-d417-47d8-a112-94c0015e1d73" pause="198614" timestamp="1521474143.985602"/>
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100000111000100101100000000000001000110001000000011100110000111001001001111100110000000000010011111101100000110011110011101001110100100110" decoding_index="0" message_type_id="bd3a5291-0677-4b35-b821-4bd366a57592" modulator_index="0" participant_id="25bc0d02-ce8e-478e-a4d0-b22cfbab004a" pause="52366" timestamp="1521474143.9856267"/>
|
||||
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100000101100100110101001100100000000111001001001111100110000110001000000011100110000000001000010010110001011010000" decoding_index="0" message_type_id="fe1be813-fc18-44bc-8931-40a35cab9c8c" modulator_index="0" participant_id="af97bec6-d417-47d8-a112-94c0015e1d73" pause="219416" timestamp="1521474143.9855523"/>
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100001000100100110101000000000001000110001000000011100110000111001001001111100110000000100000111001111011001000000010000100100000101010001000000101101101111111101" decoding_index="0" message_type_id="7880a7fd-7ea0-44bb-8016-ddaee5df84ec" modulator_index="0" participant_id="25bc0d02-ce8e-478e-a4d0-b22cfbab004a" pause="203576" timestamp="1521474143.9855769"/>
|
||||
<message bits="101010101010101010101010101010101110100111001010111010011100101000011001001001101010000000000011001110010010011111001100001100010000000111001100100100110010110101100001010001110100100101000001101101001101001001010000000001010001000011010100110110110100001010111110011001000010111101011000" decoding_index="0" message_type_id="e66e6119-d636-4165-b3b3-30e32c0ce8c5" modulator_index="0" participant_id="af97bec6-d417-47d8-a112-94c0015e1d73" pause="198614" timestamp="1521474143.985602"/>
|
||||
<message bits="10101010101010101010101010101010111010011100101011101001110010100000111000100110100000000000001000110001000000011100110000111001001001111100110000000000010011111101100000110011110011101001111000100101" decoding_index="0" message_type_id="bd3a5291-0677-4b35-b821-4bd366a57592" modulator_index="0" participant_id="25bc0d02-ce8e-478e-a4d0-b22cfbab004a" pause="52366" timestamp="1521474143.9856267"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="71c8bbbf-00cd-4e2a-a82d-3e0f7315a7d7" name="default">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="64" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="72" fuzz_me="2" fuzz_values="" name="length" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="3" end="80" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="72"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="control" show="2" start="80"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_format_index="1" end="96" fuzz_me="2" fuzz_values="" name="type" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_format_index="1" end="120" fuzz_me="2" fuzz_values="" name="source address" show="2" start="96"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="7" display_bit_order_index="0" display_format_index="1" end="144" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="120"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="8" display_bit_order_index="0" display_format_index="1" end="160" fuzz_me="2" fuzz_values="" name="command" show="2" start="144"/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="1" id="fe1be813-fc18-44bc-8931-40a35cab9c8c" name="mframe">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="32" fuzz_me="0" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="64" fuzz_me="0" fuzz_values="" name="synchronization" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="72" fuzz_me="0" fuzz_values="" name="length" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="3" end="80" fuzz_me="0" fuzz_values="" name="sequence number" show="2" start="72"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_format_index="1" end="88" fuzz_me="0" fuzz_values="" name="control" show="2" start="80"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_format_index="1" end="96" fuzz_me="0" fuzz_values="" name="type" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_format_index="1" end="120" fuzz_me="0" fuzz_values="" name="source address" show="2" start="96"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="7" display_bit_order_index="0" display_format_index="1" end="144" fuzz_me="0" fuzz_values="" name="destination address" show="2" start="120"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="8" display_bit_order_index="0" display_format_index="1" end="160" fuzz_me="2" fuzz_values="" name="command" show="2" start="144"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="9" data_ranges="[[64, 160]]" display_bit_order_index="0" display_format_index="1" end="176" fuzz_me="0" fuzz_values="" name="crc" show="2" start="160">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0">
|
||||
<rule _Rule__end="18" _Rule__start="16" _Rule__value_type="1" operator="=" target_value="0b"/>
|
||||
</ruleset>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="1" id="7880a7fd-7ea0-44bb-8016-ddaee5df84ec" name="cframe">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="64" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="72" fuzz_me="2" fuzz_values="" name="length" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="3" end="80" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="72"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="control" show="2" start="80"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_format_index="1" end="96" fuzz_me="2" fuzz_values="" name="type" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_format_index="1" end="120" fuzz_me="2" fuzz_values="" name="source address" show="2" start="96"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="7" display_bit_order_index="0" display_format_index="1" end="144" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="120"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="1" end="152" fuzz_me="2" fuzz_values="" name="command" show="2" start="144"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="8" display_bit_order_index="0" display_format_index="1" end="200" fuzz_me="2" fuzz_values="" name="challenge" show="2" start="152"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="21" display_bit_order_index="0" display_format_index="1" end="208" fuzz_me="2" fuzz_values="" name="magic" show="2" start="200"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="9" data_ranges="[[64, 208]]" display_bit_order_index="0" display_format_index="1" end="224" fuzz_me="2" fuzz_values="" name="crc" show="2" start="208">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0">
|
||||
<rule _Rule__end="18" _Rule__start="16" _Rule__value_type="1" operator="=" target_value="11"/>
|
||||
</ruleset>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="1" id="e66e6119-d636-4165-b3b3-30e32c0ce8c5" name="rframe">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="32" fuzz_me="0" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="64" fuzz_me="0" fuzz_values="" name="synchronization" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="72" fuzz_me="0" fuzz_values="" name="length" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="3" end="80" fuzz_me="0" fuzz_values="" name="sequence number" show="2" start="72"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_format_index="1" end="88" fuzz_me="0" fuzz_values="" name="control" show="2" start="80"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_format_index="1" end="96" fuzz_me="0" fuzz_values="" name="type" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_format_index="1" end="120" fuzz_me="0" fuzz_values="" name="source address" show="2" start="96"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="7" display_bit_order_index="0" display_format_index="1" end="144" fuzz_me="0" fuzz_values="" name="destination address" show="2" start="120"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="8" display_bit_order_index="0" display_format_index="1" end="272" fuzz_me="0" fuzz_values="" name="cipher" show="2" start="144"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="9" data_ranges="[[64, 272]]" display_bit_order_index="0" display_format_index="1" end="288" fuzz_me="0" fuzz_values="" name="crc" show="2" start="272">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0">
|
||||
<rule _Rule__end="18" _Rule__start="16" _Rule__value_type="1" operator="=" target_value="19"/>
|
||||
</ruleset>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="1" id="bd3a5291-0677-4b35-b821-4bd366a57592" name="aframe">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="64" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="72" fuzz_me="2" fuzz_values="" name="length" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="3" end="80" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="72"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="control" show="2" start="80"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_format_index="1" end="96" fuzz_me="2" fuzz_values="" name="type" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_format_index="1" end="120" fuzz_me="2" fuzz_values="" name="source address" show="2" start="96"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="7" display_bit_order_index="0" display_format_index="1" end="144" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="120"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="8" display_bit_order_index="0" display_format_index="1" end="152" fuzz_me="2" fuzz_values="" name="command" show="2" start="144"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="19" display_bit_order_index="0" display_format_index="1" end="184" fuzz_me="2" fuzz_values="" name="auth" show="2" start="152"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="9" data_ranges="[[64, 184]]" display_bit_order_index="0" display_format_index="1" end="200" fuzz_me="2" fuzz_values="" name="crc" show="2" start="184">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0">
|
||||
<rule _Rule__end="18" _Rule__start="16" _Rule__value_type="1" operator="=" target_value="0e"/>
|
||||
</ruleset>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="260c8eb1-0be0-45e6-b97a-63a2fb6ddcbe" name="test">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="64" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="72" fuzz_me="2" fuzz_values="" name="length" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="3" end="80" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="72"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="control" show="2" start="80"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_format_index="1" end="96" fuzz_me="2" fuzz_values="" name="type" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_format_index="1" end="120" fuzz_me="2" fuzz_values="" name="source address" show="2" start="96"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="7" display_bit_order_index="0" display_format_index="1" end="144" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="120"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="8" display_bit_order_index="0" display_format_index="1" end="160" fuzz_me="2" fuzz_values="" name="command" show="2" start="144"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="10" data_ranges="[[64, 184]]" display_bit_order_index="0" display_format_index="1" end="200" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="184">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="11" data_ranges="[[64, 200]]" display_bit_order_index="0" display_format_index="1" end="216" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="200">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="9" data_ranges="[[64, 208]]" display_bit_order_index="0" display_format_index="1" end="224" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="208">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="1" id="4b6f81f6-e792-4a49-9c64-f84869042d35" name="m2frame">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="64" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="72" fuzz_me="2" fuzz_values="" name="length" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="3" end="80" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="72"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="control" show="2" start="80"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_format_index="1" end="96" fuzz_me="2" fuzz_values="" name="type" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_format_index="1" end="120" fuzz_me="2" fuzz_values="" name="source address" show="2" start="96"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="7" display_bit_order_index="0" display_format_index="1" end="144" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="120"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="8" display_bit_order_index="0" display_format_index="1" end="176" fuzz_me="2" fuzz_values="" name="command (c800 = an/0000 = aus)" show="2" start="144"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="9" data_ranges="[[64, 176]]" display_bit_order_index="0" display_format_index="1" end="192" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="176">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0">
|
||||
<rule _Rule__end="18" _Rule__start="16" _Rule__value_type="1" operator="=" target_value="0d"/>
|
||||
</ruleset>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
16
Software/Universal Radio Hacker/tests/data/misaligned.txt
Normal file
16
Software/Universal Radio Hacker/tests/data/misaligned.txt
Normal file
@ -0,0 +1,16 @@
|
||||
101010101010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111
|
||||
1010101010101010101010101010101010101010011001110110100001100111011010000001101000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100000111001100110101001001000110001101101000011000111110011111110110100011111001110111100100011101110101011100001011000011011000001010111
|
||||
101010101010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010111010101111110
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000001010110110100111000100100010001011010101101010011100001100100011011110101
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111
|
||||
10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100000111100111010000110001010100101011000010001101001000000010100101100011110011100010001000011000001001010000010000100111010010010110101
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010111010101111110
|
||||
101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000010101011111011101010110000010001110000110000011110000001110101101011001001
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111
|
||||
10101010101010101010101010101010101010101010011001110110100001100111011010000001010000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100001000010011100100000101001100001010000001111001101001011110010111001000100001010011101
|
||||
1010101010101010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010111010101111110
|
||||
101010101010101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000011110000010100111010111110000000011011011111011111010011010011011011110100
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111
|
||||
1010101010101010101010101010101010101010011001110110100001100111011010000001010000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100001000110010011100100111011000011111110001110100011111011110100000000010011011000011001
|
||||
1010101010101010101010101010101010101010011001110110100001100111011010000001011101100000011100000111100011100010100010010001101101100000001100110000000000000000000000000000010010011111101101101111001010101100111100000101101000011101001010110110000111100110000000111100010000100111
|
||||
1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111
|
Binary file not shown.
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="24" color_index="0" id="620a1554-6165-4c39-a70f-4589f1cbb676" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="ff" color_index="0" id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10001110100010000000101100100100000000000010001001101111100111001100111000100111101011010000101110110100" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2445836"/>
|
||||
<message bits="100011101000100001000011111111110000000111010110001000001101000110111100001111110100111100001101011011100101011100000110101001100100001111110000100110000000101101111011100000000100001011110010101101001011101010101010101000001101111100011010110001110100101111000010101110110100101110000100111111010001010110001101111111111001101110011100011001111010011010101000000110101010101010011011011000110000000001111011011011011111110010101010110010110111111000100100010001100010100001001100110111010100111011011001010110111000000011101111100000100100100100111011" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.2450266"/>
|
||||
<message bits="10001110100010000000101100100100000000100110100010000011000000001010111111110100000110000001001010111011" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2451315"/>
|
||||
<message bits="100011101000100001000011111111110000001101110110010000001101010101000000100001001110011000011010010111101010111000000010011111101000110100101100010101100011000101100111010100001010001000100110101111100111000100100111000011110000100011000101111001000010111000001000010000101111100111101011101100011011000111001010001010001111011111011110011010110010001100100001111001010110010100111000111010000001001000000111011100000001100011101001100001001000010101000000101000011001000011110010110001110011010110111100010111001010111101011111011011011101100101100010" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.2455661"/>
|
||||
<message bits="10001110100010000000101100100100000001000010010001010000101100111111010000001110111110101001000110000010" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2456713"/>
|
||||
<message bits="100011101000100001000011111111110000010111010110101011101000101010011000001011001011010100001100010100010110111001000100011011000110111011101010101000110001010111110011101101010001010101001010011101110001001010001110011011100000101001101011000001001011101101011110000100110010001101011001111111101001001011100111101001010111100000101010010011000010000000011011001001011011011100110100000100011000111101011000110001000010101100001010110011100100011110100010101101111001110111001001011011001010010110110011110101000110100000010101000010010110000011110010" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.2461102"/>
|
||||
<message bits="10001110100010000000101100100100000001100100110100110011011101011001000001110011000111110011010111111110" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2462142"/>
|
||||
<message bits="100011101000100001000011111111110000011100001100111100101100000010010001000001101011000111100011110000110101111001001011111001001011011011101100001110101100000011101000100111001010100001100000100111101000111110001001111001111001100001000010000101000110100100110101110110000010100111100101010010000000101101100000001011010100011001110101110000100000000010000011010110001110000111010000101100111101001101001100110001111001110000001010011011101100000100111111000001001001100110101000101001101011001010000100001110101110001110011001101100001010110001000101" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.246646"/>
|
||||
<message bits="10001110100010000000101100100100000010001011110110111011001111011100011010011110010000110110011000100001" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.246749"/>
|
||||
<message bits="100011101000100001000011111111110000100110011000010011101111100000100111010010010110001111001001010100011010101100010110101111010000001100101010000011000101010100000110011011110011100100010111010100011101001100111011101100110110010111101010110101100111101001111110111001011111011011000110111000011011110000110110010110000011111011100000011101111011110011001100101010011110101110010100010100101001100011111010111001011100001001111010100000100101101100011111010100001011010100100000000011001011001111001011011001101010101110010111001100010101100100110011" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.247183"/>
|
||||
<message bits="10001110100010000000101100100100000010101101111001000001010001101111001000011010011000101101100100000111" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2472858"/>
|
||||
<message bits="100011101000100001000011111111110000101111110000011000010100110111101110111001010110100100010101100001101100001010111000011100010100110001001100010000101100011001010000111010010110100100000101100111101110101100100110000111010101100010000010101000011100001101110011100010110010001011001100111011111110010011011100111111111101101000011110000110101011100001101110111010011100100001100100101101110011000000011001011001010000010100100001011011001111000100100010110010110111101110111101111100101111011101000111001100111110011100100110101101101001011111100100" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.2477283"/>
|
||||
<message bits="10001110100010000000101100100100000011000001100010100001101010001100110101011111001001100110011010101100" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.247833"/>
|
||||
<message bits="100011101000100001000011111111110000110110111111011001101001111010010101010111011010011100101100001011001010011110100110100100101001010001010110111001110111100100111101001100111111101111110011111110100000111010010100010100010011011010000011111010000000101111111001010000011111101001111101000011000111100100010111001000100000101110110101110100100010110100101010011011111111100011100111001100111010010010100100001100000001111100101001001110110101011001010111111010000011101101110010001101110001011101110100001100011000101110100001101110100111100001110011" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.2482684"/>
|
||||
<message bits="10001110100010000000101100100100000011101110000100001011101001111011110100001111101001000011010111100001" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.248369"/>
|
||||
<message bits="100011101000100001000011111111110000111110011110010000100110001110110101100001111100101101001011010110111111110001101110011010000101000000101011100001100101110010110111101101011110001101000011001000000110100011111101100100010111110110001100101000100110101110000010000011011000001001001111110000111001001010011000111110001110111100100011110101110100110000011111101011010110010101111000011111010110011110110000001000111010010001111011001010000100101100010001101001110011010011010000000101000101100100111000110100011001111110001100100011111110110111011111" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.248802"/>
|
||||
<message bits="10001110100010000000101100100100000100000011000110011100010001100011001110110010000110100101000101111111" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2489023"/>
|
||||
<message bits="100011101000100001000011111111110001000101110111001000011000101001100111101100111110101011100110110001110111111100000110101001000001110001001011101011010100000100000111110000000000100100000001110110000000110110000001001100101100001110100000111001001110010110001110010111001011011100011011011010000000101110011010101011000011111001010001010110100011010111100000001100101011010110111011001110011110000000011101110000011000110011010001010111000001110111111110001011111000000111011011111111110000100010000001010011010110001111110010111010011101101111000000" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.2493317"/>
|
||||
<message bits="10001110100010000000101100100100000100101001101000100010010001111111101010110000011111001101001000010110" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2494464"/>
|
||||
<message bits="100011101000100001000011111111110001001101111011000001001101001001001111111011000100111101010111010101010110111000010110110010111110010000010011101101011110010111100001011110111001101110111101101010000110001101101011100111001011111011011011110110011001110011001011111100001111111101110110001111110000001111101010001101000011000001101111011001111010111110110000000000100111111111000000010100001110100101000100100010111110111101110101101100110010100101000110101011011010000010010010111000110000010010001000100010100010100101100101111111101100111000101101" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.249895"/>
|
||||
<message bits="10001110100010000000101100100100000101001100001111001111010100110100111001110010111100011001111111010001" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2500026"/>
|
||||
<message bits="100011101000100001000011111111110001010111111101011000010111011010000100101111110100010001011001110010011000101001111101110100011010001111000111000011101011110100011100011111011001110110101110001110010011111101000011000010111000011000111111010101110001101010110001001110110001001111110110000100001100010000100001000001110011011101101011111111110100001010001111000111011110000110100010011111010101110100001001011101000111000110010101111100100010000001111110010001000001001011101110000110000001110011110100110100100001001011110010110011110101110101000100" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.250436"/>
|
||||
<message bits="10001110100010000000101100100100000101100110100111110010101011010100111101100111010010011110000000000011" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="620a1554-6165-4c39-a70f-4589f1cbb676" pause="0" timestamp="1555689161.2505386"/>
|
||||
<message bits="100011101000100001000011111111110001011111000111101100100011001111011110000111000001010101111110011101011000110010011111101110110110101111110110011010001011111100111110000000011001110010001101100011110000110101010000000101010001011111100010110110000011011011001000011010000100100101100000010010110001011010010100010110011011100101110100011111111110101001100110000111010111001010011100110010011110010010001101101110010101011001100010010000111010001111101100111101111111110000000101001000110010111111101101001010011111111100010111100000011010001101110101" message_type_id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" modulator_index="0" participant_id="4aecf437-af22-4807-bd16-2f0c3ce89dd9" pause="0" timestamp="1555689161.2509718"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="2233086c-7b73-41c0-a77a-a8fa90d2aac3" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="24" fuzz_me="2" fuzz_values="" name="length" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="source address" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="32"/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
Binary file not shown.
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="24" color_index="0" id="0f2ce9da-0397-4db3-844e-91688e537fc9" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="ff" color_index="0" id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10001110100010000000101100100100000000000110001110100011000001001000110111000011001000111001000100010000" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.1550896"/>
|
||||
<message bits="100011101000100001000011111111110000000101001011010101011101001100010101000101110100110110000011100100111000011100011011110001111011110010010010011100110110001111010001100111011111000000101100100100001010001110111100100011100000010111101101000110110111001010010100101010100000011101111110010011100101010100111110101001000101110010011101110010110100110101000100110101100101011101100100010001110000001010010110010111111001110110010100100111111100110011011101111110000110110100110110111101010001001101100100011101011001001100010010000000011010001110111000" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" pause="0" timestamp="1555669475.1555722"/>
|
||||
<message bits="10001110100010000000101100100100000000101010110011111110011100001001001101100010010101111011111011110100" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.1556861"/>
|
||||
<message bits="100011101000100001000011111111110000001110101101000100110001001100010110010010101111101101110100100111011100101101101001011001010111000100011011011101000100110111101101101110010101001111101000111001000110000010010111111010100100000111010000010110001101111011001010000101111011011010001100000101110011101111001010000010111110101111000100001111010010001011010001110101100011000101011111111101101100110101101000111011100100110100001100100111110010100110010110110100111010010000110111110111001000001101010000010100011001010001100010010001010111011000101111" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" pause="0" timestamp="1555669475.1561267"/>
|
||||
<message bits="10001110100010000000101100100100000001001000000100011101000001101000111100100001100010011101110011100001" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.156232"/>
|
||||
<message bits="100011101000100001000011111111110000010101001000110101000111111100010100001101101111110100110001011111011010101000000010110011011001100011010001110010101111011000110111101111101111110010100010101000010110011000001000001100100111010001001010011110101001001111111111010100101100001111011000000011000100101101010000010101110010100110101010011011010101110001110001011000100011011011110111110000100001111010101000000011111010100110010000010001010000111010000000000010001000100100001111100010000101001000100001001100110001110110100111001111111110010110111100" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" pause="0" timestamp="1555669475.1566684"/>
|
||||
<message bits="10001110100010000000101100100100000001100001001010001011011110111101001011100101010101111011011101101100" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.1567736"/>
|
||||
<message bits="100011101000100001000011111111110000011110000010000001101001000111001110111011110100111011101010110010101110010110011100001101000000101010000101110100110110011101111100110101011000011100110100110111000111001010101010101011110000111110110110010101010110001001110110000000001010100011100111001010110011001101001101111000100010010111000001000001111010000001001001111111000010111000100101000100111101110111001111000110000001010110100111110011111000010010011101011010000000000010010110111000111010011111011001001001001111111111000000001001011111111010000111" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" pause="0" timestamp="1555669475.1572134"/>
|
||||
<message bits="10001110100010000000101100100100000010000001010010001111100000000101001110110101000010111011111001010110" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.157318"/>
|
||||
<message bits="100011101000100001000011111111110000100111111101110001111000100100100101101100100001000011100010011000011010111110001010101010111010100001100111010110100000000110011001111010011111111011111110000111001000001100010111101001011100101100001110010000011111011011100110001101101100001101100111001100111010110011110110100100110111001001011100101110101011011101101010011010000100001100000111000010100000110011000000101011000001010111100110010101000110001011100110110000010010110110111101111001100000010101111100111001011101001011000011011010100100111001110100" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" pause="0" timestamp="1555669475.1577613"/>
|
||||
<message bits="10001110100010000000101100100100000010101100100100000011000110001000010001111010111100000110011100110010" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.1578667"/>
|
||||
<message bits="100011101000100001000011111111110000101110111101011111111010101110000111110011010010000010100000001010001000101110001001001101001101101010010010010010000110001110001010010000111000000110111100110010111110101100001010100011100100101100101110001100101011001100010111100101100100010001010110111010001010111110011010010110111001100011010001000010100010000100000110010100101110101000110001000110110001101110001011001011001100001010000101110000100011000110011111111101000111001111000001001100000100011010000110001010101011010011010101000010101001011110011111" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" pause="0" timestamp="1555669475.1583233"/>
|
||||
<message bits="10001110100010000000101100100100000011000010101101110000111101110010101100011000111011110011100110010111" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.158428"/>
|
||||
<message bits="100011101000100001000011111111110000110111001111000010100001110000110001001101010100111111111001001101010101110110110001111010100011001011001100101100101100111100000010100000110010011101110001101100110010001011011001111001001000000010000010010110011001001010010110010000101100110110111101101101011000111111101111110010111001000001010000100110101100110100000111110111110100101000100001010111111111100111110110100001111010001101110001000110111000011111110101010010000100010110010100111000001110111000110111100001100101010101110110101000000000011101111101" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" pause="0" timestamp="1555669475.1588635"/>
|
||||
<message bits="10001110100010000000101100100100000011101110110011101011000100000001010101011111110010101011000000110011" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.1589677"/>
|
||||
<message bits="100011101000100001000011111111110000111111010010100110000110011111011010110000101000000010101111100110110101110101000100011100001111111100101101110011101011111001011111110001100101101110011010111010101000000111101101101010011101101100101110001101000110111101010101010100101100010111010011001111110100100011101101100101001000100101100000010001000010111010110001101110011001010001010000100111101111110011010101100001011110101100100101000010100100000111010111011000101001000110011010111000101110111010011010110101010010001001000001101010000001111000001001" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="51fab56e-162a-4ce5-97e9-e8ba7b3fadaa" pause="0" timestamp="1555669475.1594067"/>
|
||||
<message bits="10001110100010000000101100100100000100001100001110010000010101110001100111100100001101001010000100101101" message_type_id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" modulator_index="0" participant_id="0f2ce9da-0397-4db3-844e-91688e537fc9" pause="0" timestamp="1555669475.1595085"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="2cdbaa88-1320-45ee-a1de-b081b60c4d65" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="24" fuzz_me="2" fuzz_values="" name="length" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="source address" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="32"/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="24" color_index="0" id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="ff" color_index="0" id="87ae00cf-824c-4def-ad35-e5b99088cb78" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10001110100010000000101100100100000000001101110100110001011000011110001011111110001110101100111100110001" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" pause="0" timestamp="1555666943.0740108"/>
|
||||
<message bits="100011101000100001000011111111110000000101001011010011111101001000110011111111001101100001111101110001010010100100101000011011010011100110010011100010001011011011010000001000111101011101111001101111110000011100110111011011110100001011100000101010100001111110010100001001100011110100010001100111111100111111100111101101000111110000001010110101101111001111010110010011101000110011110011011001101101000110101001101110000001000111101010000000000101101111110001111110110100111010101110000001111111001100100001100101010000011001010001101111111101110001111111" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="87ae00cf-824c-4def-ad35-e5b99088cb78" pause="0" timestamp="1555666943.0744684"/>
|
||||
<message bits="10001110100010000000101100100100000000100100100110000110111001100010111010001111010000000110111100111000" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" pause="0" timestamp="1555666943.0745783"/>
|
||||
<message bits="100011101000100001000011111111110000001101100100000111101101000110100010000001100011000011001101100010100000011110101100100011100100100100010111100100101000000001000001001011010100110110100010100101000000111101010011111001010000110010011111110001001101101000111110101000111011110101111000010100101010100101111111000100100011111000110110110101001110011100100001001111110000110111000101110100111001011100110010010101011101010111001101111000010101111101110100000110111111110101101110010010110001110111100100010100111101100101011000110001101101001111011101" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="87ae00cf-824c-4def-ad35-e5b99088cb78" pause="0" timestamp="1555666943.0750256"/>
|
||||
<message bits="10001110100010000000101100100100000001001100000110110010011010001010011101001100001011001101011110110010" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" pause="0" timestamp="1555666943.0751328"/>
|
||||
<message bits="100011101000100001000011111111110000010110100111111110011000101011011001110001000101101111100100110100101111000100111000111101011111110000000000101111110100100010101100010011101001111000110111001010110111110111010110100011010101010111011100001001100010000010110010010100100010100010001100010100010000110011100111011010001100101111010110011111110011100010011001100101010110001111001010110110110111011110000100110100111100011110010010011000100111000101000000100011101100101011101101000000001110100101001110111010001100010100010110101110000011100011001110" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="87ae00cf-824c-4def-ad35-e5b99088cb78" pause="0" timestamp="1555666943.0755692"/>
|
||||
<message bits="10001110100010000000101100100100000001100000101000101010011110111110101001111110100110100100000000000011" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" pause="0" timestamp="1555666943.0756724"/>
|
||||
<message bits="100011101000100001000011111111110000011110011011101111110000101000100011101001011000011001101101001111101000111110011011011101010001111110111111011100001101011111110101111001011001000011010001101010000000001000111011000110111111110011111010011010010100101000101100111100010011111010110010000110111011011100001011111011100101101100001011010000101111101010010011010001001100100101010000010011100110111110001110101101101110101110101100000111010010011101110101000110110100010111010010000001011101010010001110111001011001011001110100111010010000000011101101" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="87ae00cf-824c-4def-ad35-e5b99088cb78" pause="0" timestamp="1555666943.076105"/>
|
||||
<message bits="10001110100010000000101100100100000010001011111000100011000010011111010100001001000001110101000100000110" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" pause="0" timestamp="1555666943.076208"/>
|
||||
<message bits="100011101000100001000011111111110000100110011101000000010011000110110100101111101001010000110111100110100111010011111010011111100110101101011110110011111100011000111111011000110001011101000011011000100101101101111111001101111001011010001101011111100000010000100011101001100010101100101010000011000110000011101001100111101011101011100100111101011010010100111110011101000110001001000100000001101111000011111111100111000111100000100010011001111111000011111010110101101011110001101000111001010101000000011100010000011111100111000101001000101111010011010001" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="87ae00cf-824c-4def-ad35-e5b99088cb78" pause="0" timestamp="1555666943.0766418"/>
|
||||
<message bits="10001110100010000000101100100100000010100101101100010111111110111000110010101111110011011111011001011100" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" pause="0" timestamp="1555666943.0767453"/>
|
||||
<message bits="100011101000100001000011111111110000101101000110100000111001010000011101110011101011001011101100011110100111001110100001010101011111010100100110111110110100001010001001000111110101100110011111000001001010101110111100001110101111010111011111000100001101100100011101010100101111011110110100011000100010110010100101001000010000100000010011011011101101011110010001010110101000111001110100110000110111111010110100000110110000100000010011000110010100100101010000111010110000101100101011110111111001111111101101001000010110101011010010110010000000101011000001" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="87ae00cf-824c-4def-ad35-e5b99088cb78" pause="0" timestamp="1555666943.0771825"/>
|
||||
<message bits="10001110100010000000101100100100000011001000011111111011000100010110001110010011001111110001011111000100" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" pause="0" timestamp="1555666943.0772855"/>
|
||||
<message bits="100011101000100001000011111111110000110110011001001000110110101010010100000000100111101101111100111010011110100100000001101110010111000100010111000100000110001110001010001110001010000000001000110111000101100110001110100010111000100000101111100100000000100111001110101100110001110101010001100101101000011010100100001100101110101010111110111010000011111101001110110110111000000100101000010010010010010011100100010100000101101010111001100100110010100000010000111111000110000100110000110000110010010110010001110111010001000011100010010011010101000011000000" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="87ae00cf-824c-4def-ad35-e5b99088cb78" pause="0" timestamp="1555666943.0777206"/>
|
||||
<message bits="10001110100010000000101100100100000011101000110001100111011110011010000101100010100001101101001010110110" message_type_id="231583ad-85a9-4a03-9193-fed2a099dd06" modulator_index="0" participant_id="a72bad89-ba8e-4215-a38c-64fc3caf6d9f" pause="0" timestamp="1555666943.0778227"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="231583ad-85a9-4a03-9193-fed2a099dd06" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="24" fuzz_me="2" fuzz_values="" name="length" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="source address" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="32"/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings>
|
||||
<decoding>'Non Return To Zero (NRZ)', </decoding>
|
||||
<decoding>'Non Return To Zero Inverted (NRZ-I)', 'Invert', </decoding>
|
||||
<decoding>'Manchester I', 'Edge Trigger', </decoding>
|
||||
<decoding>'Manchester II', 'Edge Trigger', 'Invert', </decoding>
|
||||
<decoding>'Differential Manchester', 'Edge Trigger', 'Differential Encoding', </decoding>
|
||||
</decodings>
|
||||
<participants>
|
||||
<participant address_hex="" color_index="8" id="Pu4tJaGpthNRHzjOIhxUftgnuKcpiUkL0Bz7NIryKX3ZYhxoQZ" name="Device A" relative_rssi="0" shortname="A"/>
|
||||
<participant address_hex="" color_index="1" id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" name="Device B" relative_rssi="1" shortname="B"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000111011000100100100001101011010101110110110000100001010000100010011011001011110101101000001101101011100000101110111010010001100000000101010010001111100110100110100011001010000000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="Pu4tJaGpthNRHzjOIhxUftgnuKcpiUkL0Bz7NIryKX3ZYhxoQZ" pause="127665"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100011101100110000010110110110000001100011011011011001001011110001100110001101111010110111101000100011110100011011111101010110100111000110000000011101100011001110111011010000001000000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="9253"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100011111100100110011111111100010011100110001111101110" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="Pu4tJaGpthNRHzjOIhxUftgnuKcpiUkL0Bz7NIryKX3ZYhxoQZ" pause="71541"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100011100101110000010110110110110001111100111000111101001011110001100110001101111010110111101000100011110101100010100000000101110001100011111111000101110100101001011110010100000100101111000100000001101010011101101111000001101111010110111000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="Pu4tJaGpthNRHzjOIhxUftgnuKcpiUkL0Bz7NIryKX3ZYhxoQZ" pause="17763"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000111111001001100111111111000100111001100011111011100" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="36602"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100011101100110000010110110111100010000011110000110000011000001110101110000001111010110100100011100101110001000001110110001111100011010111110001100010010111010111010011001101101001100" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="13076"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010001111110011001010000000111001000010010111100000011000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="20755"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000111001011100000101101101101100011111001110001111010010111100011001100011011110101101111010001000111101100111101011000100111110001111111110010011010101100100110110010101011001010100000001011010010001101100001011110000001111010100111111000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="Pu4tJaGpthNRHzjOIhxUftgnuKcpiUkL0Bz7NIryKX3ZYhxoQZ" pause="9491"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000111111001001100111111111000100111001100011111011100" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="44785"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100011101100110000010110110111100010000011110000110000011000001110101110000001111010110100100011100101110010101100110001110110010101000011101001100010110111010111000110010111010101100" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="Pu4tJaGpthNRHzjOIhxUftgnuKcpiUkL0Bz7NIryKX3ZYhxoQZ" pause="12532"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010001111110011001010000000111001000010010111100000011000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="14183"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100011101011110000010110110110110001111100111000111101001011110001100110001101111010110111101000100011110111110010010001100100111000010001010001100010011000011000001110101101110001110101011000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="15954"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010001111110010011001111111110001001110011000111110111100" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="31231"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100011101100110000010110110111100010000011110000110000011000001110101110000001111010110100100011100101110011111111001000011000010100110101010111011000111000011000100011100100111001100" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="Pu4tJaGpthNRHzjOIhxUftgnuKcpiUkL0Bz7NIryKX3ZYhxoQZ" pause="13264"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010001111110011001010000000111001000010010111100000011000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="35081"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010001110101111000001011011011011000111110011100011110100101111000110011000110111101011011110100010001111100000110100110000101001000010000010110110101010011011101110110100110011100100000010000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="13511"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010001110100010000001011011011110001000001111000011000001100000111010111000000111101011010010001110010111010000111100100101110010101010001000110110101100000000111110110000001001010111111000110111010110011010111011100" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="13072"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100011111100110010100000001110010000100101111000000110000" decoding_index="0" message_type_id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" modulator_index="0" participant_id="2oSTQqYue1LthyW6VYxYuG5ZEWY0DlkSyJkhzEqMflsQ8lN3i3" pause="186057"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="vNDKarFPQ2iPTSFgXDWyOgCX5acPWrLlQIAqFEtC1AEUxm2s7F" name="Default">
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings>
|
||||
<decoding>'Non Return To Zero (NRZ)', </decoding>
|
||||
<decoding>'Non Return To Zero Inverted (NRZ-I)', 'Invert', </decoding>
|
||||
<decoding>'Manchester I', 'Edge Trigger', </decoding>
|
||||
<decoding>'Manchester II', 'Edge Trigger', 'Invert', </decoding>
|
||||
<decoding>'Differential Manchester', 'Edge Trigger', 'Differential Encoding', </decoding>
|
||||
<decoding>'enOcean', 'Wireless Short Packet (WSP)', </decoding>
|
||||
<decoding>'WSP', 'Wireless Short Packet (WSP)', </decoding>
|
||||
</decodings>
|
||||
<participants/>
|
||||
<messages>
|
||||
<message bits="10101010110100111100010111011101110111011100110001011101010001011101110110111010101" decoding_index="6" message_type_id="xJu8iU6iRvpZ08q8KCNUmhi1gI0pPzWS0i51sYqsrTt5uTGFmF" modulator_index="0" pause="14759"/>
|
||||
<message bits="10101010110100111100010111011101110111011100110001011101010001011101110110111010101" decoding_index="6" message_type_id="xJu8iU6iRvpZ08q8KCNUmhi1gI0pPzWS0i51sYqsrTt5uTGFmF" modulator_index="0" pause="107253"/>
|
||||
<message bits="10101010110100111100010111011101110111011100110001011101010001011101110110111010101" decoding_index="6" message_type_id="xJu8iU6iRvpZ08q8KCNUmhi1gI0pPzWS0i51sYqsrTt5uTGFmF" modulator_index="0" pause="1077892"/>
|
||||
<message bits="10101010110101001101110111011101110111011100110001011101010001011101110110111100101" decoding_index="6" message_type_id="xJu8iU6iRvpZ08q8KCNUmhi1gI0pPzWS0i51sYqsrTt5uTGFmF" modulator_index="0" pause="14763"/>
|
||||
<message bits="10101010110101001101110111011101110111011100110001011101010001011101110110111100101" decoding_index="6" message_type_id="xJu8iU6iRvpZ08q8KCNUmhi1gI0pPzWS0i51sYqsrTt5uTGFmF" modulator_index="0" pause="107219"/>
|
||||
<message bits="10101010110101001101110111011101110111011100110001011101010001011101110110111100101" decoding_index="6" message_type_id="xJu8iU6iRvpZ08q8KCNUmhi1gI0pPzWS0i51sYqsrTt5uTGFmF" modulator_index="0" pause="7285368"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="xJu8iU6iRvpZ08q8KCNUmhi1gI0pPzWS0i51sYqsrTt5uTGFmF" name="default">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" index="-1" name="preamble" show="2" start="0" type_id="1e1260c9-c66d-4295-85f0-df4e6a653943"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" index="-1" name="synchronization" show="2" start="8" type_id="907b411d-0bad-4c1d-9131-8add551cd57f"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" index="-1" name="RORG" show="2" start="12" type_id=""/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_format_index="0" end="20" fuzz_me="2" fuzz_values="" index="-1" name="DATA" show="2" start="16" type_id=""/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="7" display_format_index="1" end="52" fuzz_me="2" fuzz_values="" index="-1" name="source address" show="2" start="28" type_id="5972badc-dd7c-47bd-b50a-1a3d58a61a9c"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_format_index="0" end="56" fuzz_me="2" fuzz_values="" index="-1" name="status" show="2" start="52" type_id=""/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="wsp" color_index="4" data_ranges="[[12, -4]]" display_format_index="1" end="60" fuzz_me="2" fuzz_values="" index="-1" name="checksum" show="2" start="56" type_id="00ad72f0-a31a-4532-bd3e-e6813d64619d">
|
||||
<wsp_checksum mode="auto"/>
|
||||
</checksum_label>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_format_index="0" end="64" fuzz_me="2" fuzz_values="" index="-1" name="EoF" show="2" start="60" type_id=""/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
BIN
Software/Universal Radio Hacker/tests/data/psk_gen_noisy.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/psk_gen_noisy.complex
Normal file
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/psk_generated.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/psk_generated.complex
Normal file
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/pwm.complex16s
Normal file
BIN
Software/Universal Radio Hacker/tests/data/pwm.complex16s
Normal file
Binary file not shown.
36
Software/Universal Radio Hacker/tests/data/rwe.proto.xml
Normal file
36
Software/Universal Radio Hacker/tests/data/rwe.proto.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="" color_index="0" id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="" color_index="0" id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="1010101010101010101010101010101010011010011111011001101001111101001011011000000001110000111000000000000000000011000110110110000000110011000000000000000100000000010000000011000000010100111101110100100010011100010110010100010100000000000000000000111111001001101101100000000000000001000000000000000000000000000000100000000100000100000101110000000000000010000000010000001010001100001111010111011100000000110110111011101101111011100110001100111010001111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0564606"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000001100001101101100000001100110111100011100010100010010011001000101011" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0565019"/>
|
||||
<message bits="10101010101010101010101010101010100110100111110110011010011111010011001000000000011100000001101101100000001100110111100011100010100010011100000000000001000001000000001000000110011100100100100110010111111110101010000011011101011011110000111101010111101010001001010010000111111101010111100101011010101001110111011011111110010101111100111000100100110100001111101111001011111001011000100010101011011001110001111010110101111100100110011001010011111011111011010101100111011010000011101010011101" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0565794"/>
|
||||
<message bits="1010101010101010101010101010101010011010011111011001101001111101000000110111100011100010100010010111010101111110" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0566103"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000000101001000011011110100110001001011001101110000110011000001101110100000111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0566554"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.056684"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100000111001100110101001001000110001101101000011000111110011111110110100011111001110111100100011101110101011100001011000011011000001010111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0567355"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010111010101111110" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0567644"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000001010110110100111000100100010001011010101101010011100001100100011011110101" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0568085"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0568366"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010000001101000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100000111100111010000110001010100101011000010001101001000000010100101100011110011100010001000011000001001010000010000100111010010010110101" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0568879"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010111010101111110" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0569162"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000010101011111011101010110000010001110000110000011110000001110101101011001001" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0569596"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0569878"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010000001010000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100001000010011100100000101001100001010000001111001101001011110010111001000100001010011101" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0570323"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000000110111100011100010100010010111010101111110" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0570602"/>
|
||||
<message bits="101010101010101010101010101010100110011101101000011001110110100000010011001000000111000001111000111000101000100100011011011000000011001100000000000000000000000000000011110000010100111010111110000000011011011111011111010011010011011011110100" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0571043"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0571327"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010000001010000100000011100000001101101100000001100110111100011100010100010010000000000001100011000100001000110010011100100111011000011111110001110100011111011110100000000010011011000011001" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0571775"/>
|
||||
<message bits="10101010101010101010101010101010011001110110100001100111011010000001011101100000011100000111100011100010100010010001101101100000001100110000000000000000000000000000010010011111101101101111001010101100111100000101101000011101001010110110000111100110000000111100010000100111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="35ccf7f6-73ac-4beb-820b-77ec63bd1d22" pause="0" timestamp="1555932101.0572255"/>
|
||||
<message bits="1010101010101010101010101010101001100111011010000110011101101000000000110001101101100000001100111111110101010111" message_type_id="8c5fc93f-217a-4623-b886-774164a66499" modulator_index="0" participant_id="cbee06c0-bda5-4082-bb32-11ed0fd3e94e" pause="0" timestamp="1555932101.0572596"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="8c5fc93f-217a-4623-b886-774164a66499" name="Default">
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
Binary file not shown.
220
Software/Universal Radio Hacker/tests/data/testprofile.sim.xml
Normal file
220
Software/Universal Radio Hacker/tests/data/testprofile.sim.xml
Normal file
@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" ?>
|
||||
<simulator_config>
|
||||
<modulators>
|
||||
<modulator carrier_amplitude="1" carrier_freq_hz="40000" carrier_phase_deg="0" gauss_bt="0.5" gauss_filter_width="1" index="0" modulation_type="0" name="Modulator" param_for_one="100" param_for_zero="0" sample_rate="None" samples_per_bit="100"/>
|
||||
</modulators>
|
||||
<decodings>
|
||||
<decoding>'Non Return To Zero (NRZ)', </decoding>
|
||||
<decoding>'Non Return To Zero Inverted (NRZ-I)', 'Invert', </decoding>
|
||||
<decoding>'Manchester I', 'Edge Trigger', </decoding>
|
||||
<decoding>'Manchester II', 'Edge Trigger', 'Invert', </decoding>
|
||||
<decoding>'Differential Manchester', 'Edge Trigger', 'Differential Encoding', </decoding>
|
||||
<decoding>'Wireless Short Packet', 'Wireless Short Packet (WSP)', </decoding>
|
||||
</decodings>
|
||||
<participants>
|
||||
<participant address_hex="" color_index="0" id="775c6cf4-b0ee-41ef-b553-8c5f2f1ab342" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="" color_index="1" id="199c0701-71ca-4d22-be82-44fad73bb39f" name="Bob" relative_rssi="1" shortname="B" simulate="2"/>
|
||||
</participants>
|
||||
<simulator_rx_conf/>
|
||||
<simulator_tx_conf/>
|
||||
<items>
|
||||
<simulator_message destination_id="199c0701-71ca-4d22-be82-44fad73bb39f" repeat="1">
|
||||
<message bits="10101010100100000000110011011110" decoding_index="0" message_type_id="3b04d811-c4a7-4dd7-8541-90440b544646" modulator_index="0" participant_id="775c6cf4-b0ee-41ef-b553-8c5f2f1ab342" pause="0" timestamp="1517668630.7451081">
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="3b04d811-c4a7-4dd7-8541-90440b544646" name="default">
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="1">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="0" end="28" fuzz_me="2" fuzz_values="" name="data" show="2" start="20"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="4" data_ranges="[[12, 28]]" display_bit_order_index="0" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="28">
|
||||
<crc final_xor="0000" polynomial="11110" start_value="0000"/>
|
||||
</checksum_label>
|
||||
</simulator_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="1">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="0" end="28" fuzz_me="2" fuzz_values="" name="data" show="2" start="20"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="4" data_ranges="[[12, 28]]" display_bit_order_index="0" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="28">
|
||||
<crc final_xor="0000" polynomial="11110" start_value="0000"/>
|
||||
</checksum_label>
|
||||
</simulator_label>
|
||||
</simulator_message>
|
||||
<simulator_message destination_id="775c6cf4-b0ee-41ef-b553-8c5f2f1ab342" repeat="1">
|
||||
<message bits="10101010100100000000" decoding_index="0" message_type_id="08e4c3a5-1708-4c1b-963c-7e19858607d3" modulator_index="0" participant_id="199c0701-71ca-4d22-be82-44fad73bb39f" pause="0" timestamp="1517668630.7474947">
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="08e4c3a5-1708-4c1b-963c-7e19858607d3" name="answer">
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item1.sequence_number + 1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item1.sequence_number + 1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
</simulator_message>
|
||||
<simulator_message destination_id="199c0701-71ca-4d22-be82-44fad73bb39f" repeat="1">
|
||||
<message bits="10101010100100000000110011011110" decoding_index="0" message_type_id="a1c4ad66-50dd-4d63-8c99-bfd1e87ed2c4" modulator_index="0" participant_id="775c6cf4-b0ee-41ef-b553-8c5f2f1ab342" pause="0" timestamp="1517668630.7486885">
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="a1c4ad66-50dd-4d63-8c99-bfd1e87ed2c4" name="default">
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item2.sequence_number+1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item1.data" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="0" end="28" fuzz_me="2" fuzz_values="" name="data" show="2" start="20"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="4" data_ranges="[[12, 28]]" display_bit_order_index="0" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="28">
|
||||
<crc final_xor="0000" polynomial="11110" start_value="0000"/>
|
||||
</checksum_label>
|
||||
</simulator_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item2.sequence_number+1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item1.data" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="0" end="28" fuzz_me="2" fuzz_values="" name="data" show="2" start="20"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="4" data_ranges="[[12, 28]]" display_bit_order_index="0" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="28">
|
||||
<crc final_xor="0000" polynomial="11110" start_value="0000"/>
|
||||
</checksum_label>
|
||||
</simulator_label>
|
||||
</simulator_message>
|
||||
<simulator_message destination_id="775c6cf4-b0ee-41ef-b553-8c5f2f1ab342" repeat="1">
|
||||
<message bits="10101010100100000000" decoding_index="0" message_type_id="a2b053db-03a5-48ef-a021-6493e5d3701c" modulator_index="0" participant_id="199c0701-71ca-4d22-be82-44fad73bb39f" pause="0" timestamp="1517668630.7507493">
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="a2b053db-03a5-48ef-a021-6493e5d3701c" name="answer">
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item3.sequence_number+1" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item3.sequence_number+1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item3.sequence_number+1" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item3.sequence_number+1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
</simulator_message>
|
||||
<simulator_message destination_id="199c0701-71ca-4d22-be82-44fad73bb39f" repeat="1">
|
||||
<message bits="10101010100100000000110011011110" decoding_index="0" message_type_id="f2aa4325-daeb-4548-8dc8-05aacb468606" modulator_index="0" participant_id="775c6cf4-b0ee-41ef-b553-8c5f2f1ab342" pause="0" timestamp="1517668630.7519305">
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="f2aa4325-daeb-4548-8dc8-05aacb468606" name="default">
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item4.sequence_number+1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="0" end="28" fuzz_me="2" fuzz_values="" name="data" show="2" start="20"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="4" data_ranges="[[12, 28]]" display_bit_order_index="0" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="28">
|
||||
<crc final_xor="0000" polynomial="11110" start_value="0000"/>
|
||||
</checksum_label>
|
||||
</simulator_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item4.sequence_number+1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_format_index="0" end="28" fuzz_me="2" fuzz_values="" name="data" show="2" start="20"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="4" data_ranges="[[12, 28]]" display_bit_order_index="0" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="28">
|
||||
<crc final_xor="0000" polynomial="11110" start_value="0000"/>
|
||||
</checksum_label>
|
||||
</simulator_label>
|
||||
</simulator_message>
|
||||
<simulator_message destination_id="775c6cf4-b0ee-41ef-b553-8c5f2f1ab342" repeat="1">
|
||||
<message bits="10101010100100000000" decoding_index="0" message_type_id="b94e8b81-cd97-4de6-b17c-8c45adc95023" modulator_index="0" participant_id="199c0701-71ca-4d22-be82-44fad73bb39f" pause="1000000" timestamp="1517668697.3872755">
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="b94e8b81-cd97-4de6-b17c-8c45adc95023" name="answer">
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item5.sequence_number+1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message>
|
||||
<simulator_label external_program="" formula="" random_max="255" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="" random_max="15" random_min="0" value_type_index="0">
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_format_index="0" end="12" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
</simulator_label>
|
||||
<simulator_label external_program="" formula="item5.sequence_number+1" random_max="255" random_min="0" value_type_index="2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_format_index="3" end="20" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="12"/>
|
||||
</simulator_label>
|
||||
</simulator_message>
|
||||
</items>
|
||||
</simulator_config>
|
Binary file not shown.
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="313370" color_index="0" id="ca651944-2c08-409d-9645-ee7dcad4a6f9" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="031337" color_index="0" id="c521b246-34e7-464d-81ae-3d134878aa9b" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
<participant address_hex="110000" color_index="0" id="dad420b6-8dfa-4b23-92d7-76052a17049a" name="Charly" relative_rssi="0" shortname="C" simulate="0"/>
|
||||
<participant address_hex="001100" color_index="0" id="6a4b83d4-5b8e-430a-b3c8-fff6679e819e" name="Daniel" relative_rssi="0" shortname="D" simulate="0"/>
|
||||
<participant address_hex="100100" color_index="0" id="2059e6f0-4a33-42d4-a51a-aa26c0b83ce1" name="Emy" relative_rssi="0" shortname="E" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10101010101010100000010000100000000101010000001100010011001101110011000100110011011100000000000000000000000000000000000000111100110100011010000110011001000110011101000000111001101110001001101011111010" message_type_id="0fc912a8-2798-4f64-bbb4-2199d9121ba0" modulator_index="0" participant_id="ca651944-2c08-409d-9645-ee7dcad4a6f9" pause="0" timestamp="1555659574.379962"/>
|
||||
<message bits="1010101000100010001000100011000100110011011100000010011011110111" message_type_id="55209b62-9eb6-4cec-8c86-d17436bd3866" modulator_index="0" participant_id="c521b246-34e7-464d-81ae-3d134878aa9b" pause="0" timestamp="1555659574.380043"/>
|
||||
<message bits="1010101010101010101010100110011101100111000100010000000000000000000000110001001100110111011010000001100000101100000101100100000111010010100110110110100100110011101011100110100111100000011001010010001001011010100000000111001111000100001001110010001101010101001011110001001011011000100001001111111011010110000001011111000001011110011000011100011100010001110011000000111111000110110111001111010010001000011111111000011100001100010111100100010111010001111110100000100010100011001001011111011001000010001010010111000111000010111010001111011111110111110100100100111110011111100010000011111000110101110011011100100000100011" message_type_id="7a3d3afd-3c8b-45d1-ad26-98fa7aa323e4" modulator_index="0" participant_id="c521b246-34e7-464d-81ae-3d134878aa9b" pause="0" timestamp="1555659574.3805306"/>
|
||||
<message bits="1010101000100010001000100000001100010011001101111110010010001101" message_type_id="55209b62-9eb6-4cec-8c86-d17436bd3866" modulator_index="0" participant_id="dad420b6-8dfa-4b23-92d7-76052a17049a" pause="0" timestamp="1555659574.380608"/>
|
||||
<message bits="10101010101010100000010000100000000101010000000000010001000000000001000100000000000000000000000000000000000000000000000101001111101101001111010000011000101101110111110110100000011101010001011100001110" message_type_id="0fc912a8-2798-4f64-bbb4-2199d9121ba0" modulator_index="0" participant_id="dad420b6-8dfa-4b23-92d7-76052a17049a" pause="0" timestamp="1555659574.380769"/>
|
||||
<message bits="1010101000100010001000100001000100000000000000001000111101010111" message_type_id="55209b62-9eb6-4cec-8c86-d17436bd3866" modulator_index="0" participant_id="6a4b83d4-5b8e-430a-b3c8-fff6679e819e" pause="0" timestamp="1555659574.3808384"/>
|
||||
<message bits="1010101010101010101010100110011101100111000100000000000100000000000000000001000100000000100011000000000110011110011001001101111011000101011001101100010111100000010001011110011101011111001011001111000000101110010000000100100100101100000111110000001111001100100000010101001011010110010100101011010011001100001001000010101000110100110010010011110110001001010111101000100100001011110101011010001110000100101110011000001111010000100000101110011100001011000010100000010000110001111000100110100101100010110001010111001000101010011111000111100010010111000010010011101100100011010101100100101010111110001010010001000110000111" message_type_id="7a3d3afd-3c8b-45d1-ad26-98fa7aa323e4" modulator_index="0" participant_id="6a4b83d4-5b8e-430a-b3c8-fff6679e819e" pause="0" timestamp="1555659574.3813257"/>
|
||||
<message bits="1010101000100010001000100000000000010001000000001110100000000011" message_type_id="55209b62-9eb6-4cec-8c86-d17436bd3866" modulator_index="0" participant_id="2059e6f0-4a33-42d4-a51a-aa26c0b83ce1" pause="0" timestamp="1555659574.3813984"/>
|
||||
<message bits="10101010101010100000010000100000000101010011000100110011011100000001000000000001000000000000000000000000000000000000001010100111111101000101100010010110001000110001111010000011001011110010000110000001" message_type_id="0fc912a8-2798-4f64-bbb4-2199d9121ba0" modulator_index="0" participant_id="2059e6f0-4a33-42d4-a51a-aa26c0b83ce1" pause="0" timestamp="1555659574.381552"/>
|
||||
<message bits="1010101000100010001000100001000000000001000000001000100101000011" message_type_id="55209b62-9eb6-4cec-8c86-d17436bd3866" modulator_index="0" participant_id="ca651944-2c08-409d-9645-ee7dcad4a6f9" pause="0" timestamp="1555659574.3816187"/>
|
||||
<message bits="1010101010101010101010100110011101100111000000110001001100110111001100010011001101110000011111110111010010100101100111010111001100101100000011100110101111100110000000000100000001001011101010111110101000011111001111001000101100101011101000001110100110101111100110000000110100101110010110011101010100101101011000010011111001011011100101100011110100000101110001000110001111011101001100110010010100000010101111111000000010111011001110101101100101100000110010010000000011001011100010011111000001000101110110001010001101000010010101101110101101110010101001000111111101111110000101111001100010101110110101111101110110011111" message_type_id="7a3d3afd-3c8b-45d1-ad26-98fa7aa323e4" modulator_index="0" participant_id="ca651944-2c08-409d-9645-ee7dcad4a6f9" pause="0" timestamp="1555659574.3821049"/>
|
||||
<message bits="1010101000100010001000100011000100110011011100000010011011110111" message_type_id="55209b62-9eb6-4cec-8c86-d17436bd3866" modulator_index="0" participant_id="c521b246-34e7-464d-81ae-3d134878aa9b" pause="0" timestamp="1555659574.3821757"/>
|
||||
<message bits="10101010101010100000010000100000000101010001000100000000000000000000001100010011001101110000000000000000000000000000001100101110110010110010010001110101110100100110011100101101010011011100111101100110" message_type_id="0fc912a8-2798-4f64-bbb4-2199d9121ba0" modulator_index="0" participant_id="c521b246-34e7-464d-81ae-3d134878aa9b" pause="0" timestamp="1555659574.3823378"/>
|
||||
<message bits="1010101000100010001000100000001100010011001101111110010010001101" message_type_id="55209b62-9eb6-4cec-8c86-d17436bd3866" modulator_index="0" participant_id="dad420b6-8dfa-4b23-92d7-76052a17049a" pause="0" timestamp="1555659574.3824053"/>
|
||||
<message bits="1010101010101010101010100110011101100111000000000001000100000000000100010000000000000000100111010101001100110001000101000100111111001111011001101101100101010010110100100001110100110010111011001000001010101000100000001010100000110011110011111000011000110101110100110001000110010000111011101000011000010001001000110110010000101010001001001000111110101101101101100101010110100010111001001001001010010000101101101111101010101100100011110110011101110111011110011011001110000001010001100000110001000011011011111101110101000000010011100000000110101101110011011010111010101111100111101111011000111011011100111110100011011101" message_type_id="7a3d3afd-3c8b-45d1-ad26-98fa7aa323e4" modulator_index="0" participant_id="dad420b6-8dfa-4b23-92d7-76052a17049a" pause="0" timestamp="1555659574.38289"/>
|
||||
<message bits="1010101000100010001000100001000100000000000000001000111101010111" message_type_id="55209b62-9eb6-4cec-8c86-d17436bd3866" modulator_index="0" participant_id="6a4b83d4-5b8e-430a-b3c8-fff6679e819e" pause="0" timestamp="1555659574.3829634"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="0fc912a8-2798-4f64-bbb4-2199d9121ba0" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="40"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="source address" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="120" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="88"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="184" fuzz_me="2" fuzz_values="" name="data" show="2" start="120"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="7" data_ranges="[(32, 184)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="200" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="184">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="55209b62-9eb6-4cec-8c86-d17436bd3866" name="ack">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="24" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="48" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="24"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="3" data_ranges="[(24, 48)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="48">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="7a3d3afd-3c8b-45d1-ad26-98fa7aa323e4" name="kex">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="24" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="40" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="40"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="source address" show="2" start="64"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="600" fuzz_me="2" fuzz_values="" name="data" show="2" start="88"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="5" data_ranges="[(40, 600)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="616" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="600">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/unaveraged.coco
Normal file
BIN
Software/Universal Radio Hacker/tests/data/unaveraged.coco
Normal file
Binary file not shown.
42
Software/Universal Radio Hacker/tests/data/undecoded.txt
Normal file
42
Software/Universal Radio Hacker/tests/data/undecoded.txt
Normal file
@ -0,0 +1,42 @@
|
||||
1010101010101010101010101010101010011010011111011001101001111101110100100110000101101101011110101110110110000110001010000100010011011001011110101101001100111001001100001010011101000011111111010001110011100001011101001001110101101101000011011011010101000110110100010101100111000110101000101011111100110100110010000001100100110100010001001001001111011101100100111110111000101011001010001111110111011100001011110011110100101110110101101101011010101110011
|
||||
10101010101010101010101010101010011001110110100001100111011010001111100111111010011111011010100110010101011001111011101000010110110000011
|
||||
101010101010101010101010101010101001101001111101100110100111110111001101111000010110110110000001100011011011011001001011110001100110001110111010110100110011110101110010100100010010010101000011110000111000011110001101000001010000001000000010111011010010011111110011110111100011001011011011111001011001001110111100111001100110011110011101101101110000111101101001001001110100001010011101001000011011101111101010001100111010011100101000010010111100111011110101101000111010110011101111010110111
|
||||
10101010101010101010101010101010100110100111110110011010011111011111110010011001111111110001001110011000111110111
|
||||
1010101010101010101010101010101001100111011010000110011101101000111011001100000101101101111000100000111100001100001010000100010011011001011110101101001000111001011100000011001101100000101011000111000111100110101010111011100010110000000010100
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011111010011111011010100100010000110100100
|
||||
101010101010101010101010101010100110011101101000011001110110100011100101110000010110110110000001100011011011011001001011110001100110001101111010110111100101101101111110111100011111001110000110001110010111000101010001001001101011110011111110000001100000000110001101101110001010011000010010111010000
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110010011001111111110001001110011000111110111
|
||||
1010101010101010101010101010101001100111011010000110011101101000111011001100000101101101111000100000111100001100001010000100010011011001011110101101001000111001011100011100110000011001001011100001000111010110011111100101111000101011111110000111
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011111010011111011010100100010000110100100
|
||||
101010101010101010101010101010100110011101101000011001110110100011100101110000010110110110000001100011011011011001001011110001100110001101111010110111100101101101111111101011010100111110100011000011000011101110111101110011001101110011101010101010111000001101110101110110111101010000000110000010100
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110010011001111111110001001110011000111110111
|
||||
101010101010101010101010101010100110011101101000011001110110100011101100110000010110110111100010000011110000110000101000010001001101100101111010110100100011100101110010001110001110110110111010000100110111000100110011110111110011011111000100001
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011111010011111011010100100010000110100100
|
||||
101010101010101010101010101010100110011101101000011001110110100011101011110000010110110110000001100011011011011001001011110001100110001101111010110111100101101101100000000010111101010110010010000001000100000111111111001010101000100101001111001001111
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110010011001111111110001001110011000111110111
|
||||
1010101010101010101010101010101001100111011010000110011101101000111011001100000101101101111000100000111100001100001010000100010011011001011110101101001000111001011100110101011000011001101101000101010111001010111100101001010101011011111110011111
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011111010011111011010100100010000110100100
|
||||
101010101010101010101010101010100110011101101000011001110110100011101011110000010110110110000001100011011011011001001011110001100110001101111010110111100101101101100001000001001100010010111010101010100100011100010011001011000110110000111011101000111
|
||||
101010101010101010101010101010100110011101101000011001110110100011101000100000010110110111100010000011110000110000101000010001001101100101111010110100100011100101110100000010001110000111111000111110001000110101110111110001010100011001101100010111001000110010100011011111100111
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011111010011111011010100100010000110100100
|
||||
10101010101010101010101010101010100110100111110110011010011111011101001001100001011011010111101011101101100001100011101101101011100101000111101011010011001110010011000010100111010000111111110100011100111000010111010010011101011011010000110110110101010001101101000101011001110001101010001010111111001101001100100000011001001101000100010010010011110111011001001111101110011000101111101010001010110111001000011011001000110010000110011011001001101110100
|
||||
10101010101010101010101010101010011001110110100001100111011010001111100111101001010100101110010010010101011001111011101001110111011001100
|
||||
101010101010101010101010101010101001101001111101100110100111110111001101111000010110110110010010101000101111101101001011110001100110001110111010110100110011110101110010001101000011001001100111101010011111011011000100000010100101100011110101000000000110111100011111001100010001101101001001000101001000110100001110111010010101000110100111000110111000111110001101100010100010100100111010010101110001011100011010111111111100100100111001001111111010111100011111101000111010110010010110010010011
|
||||
101010101010101010101010101010101001101001111101100110100111110111111100100110011111111100010011100110001111101111
|
||||
101010101010101010101010101010100110011101101000011001110110100011101100110000010110110111100010000011110000110000111011011010111001010001111010110100100011100001110000011100101110010111100010001101110000001001000111100011100101011001110011111
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011101001010100101110010011110010000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100011100101110000010110110110010010101000101111101101001011110001100110001101111010110111110011111101101001000100001100010101011111111111111010110010100110010100111001011010011011101110100101111111111110000100111000000001011100100010011
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110010011001111111110001001110011000111110111111
|
||||
1010101010101010101010101010101001100111011010000110011101101000111011001100000101101101111000100000111100001100001110110110101110010100011110101101001000111000011100010010101010101110010101110111010001110111011100100111011111100000001011111111
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011101001010100101110010011110010000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100011100101110000010110110110010010101000101111101101001011110001100110001101111010110111110011111101101010001111000101101010000100110110001110001011100001000110100001101001111011100110011100111100011001110001100010110110001011010001111
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110010011001111111110001001110011000111110111111
|
||||
10101010101010101010101010101010011001110110100001100111011010001110110011000001011011011110001000001111000011000011101101101011100101000111101011010010001110000111001001100000010001010110011100101110101110001100110111101010100110000111000111
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011101001010100101110010011110010000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100011101011110000010110110110010010101000101111101101001011110001100110001101111010110111110011111101101011101111001100000001101111011100010000000001011000110010111110011110100101010111100
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110010011001111111110001001110011000111110111111
|
||||
1010101010101010101010101010101001100111011010000110011101101000111011001100000101101101111000100000111100001100001110110110101110010100011110101101001000111000011100111011110001100000110011011001011000001111110000111001001100111101001011000
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011101001010100101110010011110010000000000
|
||||
101010101010101010101010101010100110011101101000011001110110100011101011110000010110110110010010101000101111101101001011110001100110001101111010110111110011111101101100011010010011001100000101000110110100111101001100010011111100010101101111000010011
|
||||
1010101010101010101010101010101001100111011010000110011101101000111010001000000101101101111000100000111100001100001110110110101110010100011110101101001000111000011101001001100101000000100000101100000010001010100111001011000000010101101110111000110000000101001000111101100001
|
||||
10101010101010101010101010101010011001110110100001100111011010001111110011101001010100101110010011110010000000000
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="1337" color_index="0" id="8a0e525e-a83c-4801-abd3-76c90cbe6468" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="dead" color_index="0" id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111110111101010110110011100000000110110100101010110010011000001010110101001111100000110100011110000" message_type_id="f174bbd6-730d-4345-a96e-8c64426aab38" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4818068"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4818964"/>
|
||||
<message bits="101010101010101010011010011111010100011111011110101011010001001100110111010011100100011111010011101010110011001111010101101011000010000001011010001010111110010000000111111111101110110000101011010100111101110100010010110101101111100110110001100001110101111110101001000001001010101001101011000001110001110100001010111011000000100110001011011110111101000000110101101110000111001100010110110010110001011000101011100111110100111011001111110001110001011110000101010111011001111001011010000101101101001001101110110000111111110011011000101100011100010110001001101010110110000001110001000110000101001011110111" message_type_id="ebb5bfbc-0520-48c5-9be5-b027926c40aa" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.482383"/>
|
||||
<message bits="101010101010101010011010011111010000010111011110101011010100100110100101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4824667"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111110111101010110111110011010101111110011101100011110011111100011000100001110011101001001110010111" message_type_id="f174bbd6-730d-4345-a96e-8c64426aab38" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.482614"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4826882"/>
|
||||
<message bits="101010101010101010011010011111010100011111011110101011010001001100110111010001001000100101100110100000011010111100100010111000001101110010000100111001011001010000000011111111110000010000010110010010000010010011001001111111011010000010011101111001100111101011000110100000110000111010000000101010110010111110110100101011110101011011011101000011101001111100010111111001001110000010011100010011111101010111110100110111111100001001000111110111001010101001010100111000011000010001001010100011001001100000111101111111010000110010111000000010110110100111000011101001101100000100101110101111001000101111100111" message_type_id="ebb5bfbc-0520-48c5-9be5-b027926c40aa" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4831657"/>
|
||||
<message bits="101010101010101010011010011111010000010111011110101011010100100110100101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4832435"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111110111101010110100100010010101101000110010101010000010101111011101010111110000110001101001000110" message_type_id="f174bbd6-730d-4345-a96e-8c64426aab38" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4833822"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4834535"/>
|
||||
<message bits="101010101010101010011010011111010100011111011110101011010001001100110111110110100011110010100100011100111101001101001001011101110101110011110001111101000100010111001100010100101000011011001000101001011000011001000000010001011011011111011001100101110110011100010001111111111110101110010111110011110100011001110010110001110100001110101101111000101110011100100001011101111011011010101110010110000110001011000001000111100110111010010000111110001001011000111110011001110110101000000000011110010000101101100100111110010001101111100101000100010101111011110000101111001010011111100110010101111110011111011111" message_type_id="ebb5bfbc-0520-48c5-9be5-b027926c40aa" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4842484"/>
|
||||
<message bits="101010101010101010011010011111010000010111011110101011010100100110100101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4843838"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111110111101010110101110100100101001000100011011011100000001010110000110111101010110000111011100111" message_type_id="f174bbd6-730d-4345-a96e-8c64426aab38" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4846282"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4847457"/>
|
||||
<message bits="101010101010101010011010011111010100011111011110101011010001001100110111001011010100011111000110000010010000101101011000001110010100101100100101010011000100001101100011010010100010001010011100100100101111011000100100010001101000011001101101100010100000001011101100011110000110101000010010010100111100100101011011110011010001101001001110101010010010110100010000011011111101111111001010101001101111011001101011010011111100111011100011100000010011100110010110100001011100001110011101100110101111111011011111111100100100011110110100000000011110111010101001110011011001111001111100000111001001010100111011" message_type_id="ebb5bfbc-0520-48c5-9be5-b027926c40aa" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4856374"/>
|
||||
<message bits="101010101010101010011010011111010000010111011110101011010100100110100101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.48577"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111110111101010110101111001011000000100100010010110101010110110101110011011111100001100001110101101" message_type_id="f174bbd6-730d-4345-a96e-8c64426aab38" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.48602"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4861407"/>
|
||||
<message bits="101010101010101010011010011111010100011111011110101011010001001100110111001101010000110111001100111100100001111001100101010010101111110001111110010100111110111111000101001110011100011000010101101100111010101001100000011011110001010010011000011111100011001000110010111101000001000010011001001011001000101110001011100101111011011000011110100111001010110011010010101110001000011111101111110000000110111100100000011111111100001101001001001011001101110101001000110011100001010100010100001111011100100000111001110101000000100110101011011001000000110000100110001000101000011001100111100000111100001000110010" message_type_id="ebb5bfbc-0520-48c5-9be5-b027926c40aa" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4870408"/>
|
||||
<message bits="101010101010101010011010011111010000010111011110101011010100100110100101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4871705"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111110111101010110100100111000100111101101110100001011000111101010111011001111100001111001000001010" message_type_id="f174bbd6-730d-4345-a96e-8c64426aab38" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.487412"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4875276"/>
|
||||
<message bits="101010101010101010011010011111010100011111011110101011010001001100110111100101100001101111010100001100111111111111111101101010111100001010101010010000111001011111110011110101111010000101100011110100110000001110110011001111101010100101111101010110001101101101010100111011111000101111011001011000110010001111111010111110000000101111110101011001110000100111111100000000000101110000001000011000100000001001000100000010000001000110110000111100100000001111100111110101011010010101010100000101000010000100111100001010000000110011011111101001101001110000100000000000111011110000111110111011111110011111000001" message_type_id="ebb5bfbc-0520-48c5-9be5-b027926c40aa" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4884477"/>
|
||||
<message bits="101010101010101010011010011111010000010111011110101011010100100110100101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4885771"/>
|
||||
<message bits="10101010101010101001101001111101000011110001001100110111110111101010110111000011101000010101110111111001111001000010100101001111101011110001011001011100" message_type_id="f174bbd6-730d-4345-a96e-8c64426aab38" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4888282"/>
|
||||
<message bits="101010101010101010011010011111010000010100010011001101111110010011110101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4889479"/>
|
||||
<message bits="101010101010101010011010011111010100011111011110101011010001001100110111011111110111110111101000001100000101111010100001110111110110000110101111000001011011001100010100110010110101111010010110000111011010111000101111001111000110010110000100101100100000011110100111111000100011111011101011110011000001000001000100010100100111110101110110011000011110100010101011101001001010011101110110001101110110010110110111001010110011100101100010111100011000100011100111010010110100011111110010001100010100000101101101010100101111100010100000111011100011010101001110011000000101101101000001001110101100110001101110" message_type_id="ebb5bfbc-0520-48c5-9be5-b027926c40aa" modulator_index="0" participant_id="9b6ea414-1a46-4c47-99b5-fe64a19b74d3" pause="0" timestamp="1555606689.4898462"/>
|
||||
<message bits="101010101010101010011010011111010000010111011110101011010100100110100101" message_type_id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" modulator_index="0" participant_id="8a0e525e-a83c-4801-abd3-76c90cbe6468" pause="0" timestamp="1555606689.4899817"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="f174bbd6-730d-4345-a96e-8c64426aab38" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="56" fuzz_me="2" fuzz_values="" name="source address" show="2" start="40"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="72" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="56"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="136" fuzz_me="2" fuzz_values="" name="data" show="2" start="72"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="6" data_ranges="[(32, 136)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="152" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="136">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="ebb5bfbc-0520-48c5-9be5-b027926c40aa" name="data2">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="56" fuzz_me="2" fuzz_values="" name="source address" show="2" start="40"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="72" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="56"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="584" fuzz_me="2" fuzz_values="" name="data" show="2" start="72"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="6" data_ranges="[(32, 584)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="600" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="584">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="c69799d8-6d0a-4a52-a4c0-ece4c2c876a3" name="ack">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="56" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="40"/>
|
||||
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="4" data_ranges="[(32, 56)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="72" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="56">
|
||||
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
|
||||
</checksum_label>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="24" color_index="0" id="9e444231-068f-4939-b05b-5aaefd0ecfd2" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="ff" color_index="0" id="a799c999-eed0-4286-b0e6-eded3dc5ceef" name="Broadcast" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10001110100010000000101100100100000000001001010111000001010000100100011101000011111000010111110101010101" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="9e444231-068f-4939-b05b-5aaefd0ecfd2" pause="0" timestamp="1555582589.8818839"/>
|
||||
<message bits="100011101000100001000011111111110000000100001010110000000110001110010100011101001111010010111011111000110111000110111110010000010100111110110010010010011111001010101111001000010101101000100001011100001010100011110101111110100100101010000111001001000101000100011001100111110011111101101111101011101101001010101000101001001100011000111110111101010011001111110111100001110000100011100000011011100010001100000100100000111000100010010000100000011000000001101100001000010110100000000011010100100011100010010111101100101001000111101001111010101101111100111101" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="a799c999-eed0-4286-b0e6-eded3dc5ceef" pause="0" timestamp="1555582589.8823237"/>
|
||||
<message bits="10001110100010000000101100100100000000101011110010011100110111101010110101001000110010111110110110001110" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="9e444231-068f-4939-b05b-5aaefd0ecfd2" pause="0" timestamp="1555582589.882432"/>
|
||||
<message bits="100011101000100001000011111111110000001110011111000011110001101110001100101111100100110001101011111010000001100010100101111001101110000010001011100111001010111001000010111101010101010100101110111110100110101101001110010101011110001011110001101011110011000011011111101111010001111101110000110111001110001110111111010110111111010110100101000110100111000100010001011101110001010110110100101110100000001100111101111100010111000101111101011000111011000111010001111011111010100100110101101000101101011111100001001100011010000100010001001100110001000001011100" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="a799c999-eed0-4286-b0e6-eded3dc5ceef" pause="0" timestamp="1555582589.8828719"/>
|
||||
<message bits="10001110100010000000101100100100000001000011001100111111110010110010010111110100000010001100100001011011" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="9e444231-068f-4939-b05b-5aaefd0ecfd2" pause="0" timestamp="1555582589.8829782"/>
|
||||
<message bits="100011101000100001000011111111110000010100011001011001010101100110001000100100101001010110000001000010001011001100001011100100101101011100010110000110010001110101001000000011101001111100011100101010100101011000001001011000000110111011101110101011111010100001101010101000011010101111010001111100000101010010011000111000001010101110011001010101001101110010110110110101110100001110011101111000101010111010100001001101100111100001010010000100101000010010010100011010110110010111001101010011110101101001100011100000011001000001110001011111000111000110110000" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="a799c999-eed0-4286-b0e6-eded3dc5ceef" pause="0" timestamp="1555582589.883411"/>
|
||||
<message bits="10001110100010000000101100100100000001101011111001100100001010000100001111101110000101001011000101001110" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="9e444231-068f-4939-b05b-5aaefd0ecfd2" pause="0" timestamp="1555582589.883512"/>
|
||||
<message bits="100011101000100001000011111111110000011100110001111100011110101000100000010100000100111001101010101001101001100101001000011111111000000000011111111100011100001001000111101011001010100011111101111010000001000011100101100000011011100001101101000110010101010000110000100110000000001100010111011000110011011011001111100101010001111111010110011001010111011110010011100110001100110110101000101111111111101100000110100001000100110001010100100110101011010010100001101110101100000100101011101101101101111110111110101100000011100001010011100101101010001011110101" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="a799c999-eed0-4286-b0e6-eded3dc5ceef" pause="0" timestamp="1555582589.883943"/>
|
||||
<message bits="10001110100010000000101100100100000010000000011010010110110111000001011101110111111001001101011100001111" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="9e444231-068f-4939-b05b-5aaefd0ecfd2" pause="0" timestamp="1555582589.8840458"/>
|
||||
<message bits="100011101000100001000011111111110000100110001101010101010011011101011100110000010010110010101000101111011000111000001101100100110010000110110000010010110110100000001101101101101010000111011011011101000000011111001010001111111110000101101011101100010011110010011000101000011110011101001000001110000111010101110101110001010111011110100101011010100000100001110000000000111101110110000100110010001110111001111101000010000001110010011010010111100100000110111110110001011100000111010000011100010111000001010000001010110100111101101111101100010101000111101011" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="a799c999-eed0-4286-b0e6-eded3dc5ceef" pause="0" timestamp="1555582589.8844793"/>
|
||||
<message bits="10001110100010000000101100100100000010101110110100111100011001010000001011001111111101101010100001011110" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="9e444231-068f-4939-b05b-5aaefd0ecfd2" pause="0" timestamp="1555582589.8845823"/>
|
||||
<message bits="100011101000100001000011111111110000101101000100011000000111000000110011101110110101010101110101110000000100101000011111110111010100000000010100001010000011011101010010010010111101110100111000100011000001001011101000010101101011011010000010101010011011001100011101100010001010001011101011001001100000010000101000110001110010000110110001000001111100011001110001011011101110100110110110100000110001011000110011001000000010101011110101010101110110000000000010001001010001110110000111000110000110110010000110111010110000101101010000001111001100011111100011" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="a799c999-eed0-4286-b0e6-eded3dc5ceef" pause="0" timestamp="1555582589.8850236"/>
|
||||
<message bits="10001110100010000000101100100100000011000111101110010111111010011001001001010010011101111110110000111101" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="9e444231-068f-4939-b05b-5aaefd0ecfd2" pause="0" timestamp="1555582589.8851268"/>
|
||||
<message bits="100011101000100001000011111111110000110100101011010100011111010010101111100100101011010000001100101001010000110000111111100010111100111101011100001111100101101000001111111001110100100011010011011111011100001101110111001000101011101100111010011100010110110001111001011010100111111001000111000010111100000100110001111011000010010011111100100011101010110011110101101111100101101111101000011110011010101100001001011111000011000000011101011100011111011010100001011100101000010000100001101100111110001111101101101111000010111011011001111001111101101010111011" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="a799c999-eed0-4286-b0e6-eded3dc5ceef" pause="0" timestamp="1555582589.8855832"/>
|
||||
<message bits="10001110100010000000101100100100000011101000010110011000011101000000011110101101100001001100100011111010" message_type_id="db547e71-617c-4b0a-952d-75553f165b0f" modulator_index="0" participant_id="9e444231-068f-4939-b05b-5aaefd0ecfd2" pause="0" timestamp="1555582589.885688"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="db547e71-617c-4b0a-952d-75553f165b0f" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="24" fuzz_me="2" fuzz_values="" name="length" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="source address" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="32"/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" ?>
|
||||
<protocol>
|
||||
<decodings/>
|
||||
<participants>
|
||||
<participant address_hex="24" color_index="0" id="baaadff4-66a0-4340-8921-9437a8892d49" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
|
||||
<participant address_hex="ff" color_index="0" id="aeec0af0-d44f-4dc5-a475-cf7772d83b56" name="Broadcast" relative_rssi="0" shortname="B" simulate="0"/>
|
||||
</participants>
|
||||
<messages>
|
||||
<message bits="10001110100010000000101100100100000000000100001001111000000001101111010001010101010110110011000000000001" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="baaadff4-66a0-4340-8921-9437a8892d49" pause="0" timestamp="1555594861.6524687"/>
|
||||
<message bits="100011101000100001000011111111110000000110100110011101100001011011111010100111100010011101011000100001001001000111111000110111111100101111000100111000101011011010000111000011110101100111001010000010101001110101101001001100110001110111000110111101010111110001001001010111000011101111011101111011100110111110001000011111010000101100101001101000000111110111011110101011001111111010010001110010111000011101001001000111100110011110001000010101000100110111000111000000101010011010000000111111001101101110111101001011000110111111100010110000010011100110011100" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="aeec0af0-d44f-4dc5-a475-cf7772d83b56" pause="0" timestamp="1555594861.6529274"/>
|
||||
<message bits="10001110100010000000101100100100000000101100110101010000001010111100110010100111011110011111100010000101" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="baaadff4-66a0-4340-8921-9437a8892d49" pause="0" timestamp="1555594861.6530368"/>
|
||||
<message bits="100011101000100001000011111111110000001111110110000110010000000111000001100111010111111011001001010101110101011000010001010101000111111000100110110011110111101110100000110000100000000101101100000011111010010011111011011010101101000100010101100100100001011010011100111111000111111101111111010101011010011011001101100100100101110001011010001001111010100111010111100101100101101001011100101110100011010100010111111010011101111111100011111001100011011010101100110101100000110011101111010100111000010101111110001010110100000111101100011110001011111011101001" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="aeec0af0-d44f-4dc5-a475-cf7772d83b56" pause="0" timestamp="1555594861.6534898"/>
|
||||
<message bits="10001110100010000000101100100100000001000011000011110111110100011111000111111000100011000111001000100010" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="baaadff4-66a0-4340-8921-9437a8892d49" pause="0" timestamp="1555594861.653598"/>
|
||||
<message bits="100011101000100001000011111111110000010110010100000010101011001011101010011001100110100010010000000111000001111000010010110110001101111110000111110110010111000110001110010111101100110110001010111100100100001000111010000110100001000101011010111100010110001010100111010101011001111001100010110110100101111010001001001111110010000010101101000010110000101000110100111001000100110101111110110111000111111110110010111100110010111011110010001001110110011100000001011001101010010010101110111000011111100011001011001010110110011111001000001110100100111100011000" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="aeec0af0-d44f-4dc5-a475-cf7772d83b56" pause="0" timestamp="1555594861.654055"/>
|
||||
<message bits="10001110100010000000101100100100000001100111001010000001010101101110101111110101111100100110110000001010" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="baaadff4-66a0-4340-8921-9437a8892d49" pause="0" timestamp="1555594861.6541636"/>
|
||||
<message bits="100011101000100001000011111111110000011111101010011001000101100001010110000011010000100110110100010100010100010101111110110001100000010011110001001100011000101011000000101111111111100000100100100011111001001001001111111011001010010100110011101101101111001101010101000001101000111000110101101000101011011010000011001000110100000011111101110011000100111000110010000101001011000000111010101001101010001110001100111101101110011100000110101011011110001100000101001001101001011010011101010110110011011111110101001001010011001010000011010110111110100110101011" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="aeec0af0-d44f-4dc5-a475-cf7772d83b56" pause="0" timestamp="1555594861.654611"/>
|
||||
<message bits="10001110100010000000101100100100000010001101110111110110011101001111001010111101111110001111000111010011" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="baaadff4-66a0-4340-8921-9437a8892d49" pause="0" timestamp="1555594861.6547167"/>
|
||||
<message bits="100011101000100001000011111111110000100101001010010111101010111101010110100011010010101001100001010110001100101011010111001010001101100100011111011010001001110001011010000000001010101001100011100001100001011101100110000011100110001001011101101110001110110001011011010001110000111100100000010011001001000110100011100000101010011011110100111011100000100100100101110001110011100011000000010101000011110011001010000111011111001011110011111001101011001011010010111001101110011111101010000100011111001000001010001110010010001101001101011001001110001010000010" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="aeec0af0-d44f-4dc5-a475-cf7772d83b56" pause="0" timestamp="1555594861.6551607"/>
|
||||
<message bits="10001110100010000000101100100100000010100010110111111100010110011100100101110011000000101111100010011011" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="baaadff4-66a0-4340-8921-9437a8892d49" pause="0" timestamp="1555594861.655266"/>
|
||||
<message bits="100011101000100001000011111111110000101111111000110110111010000110101111101110001100001001100000010111101000001111011000100100011000111000010111100011000010000000101001110001010111011011110111011001000011111111001101001000101010100101000000000001001000111100001100010010101100001001001011000001100110011001100000101001011100010011101010110011001000011101100110001000000011101110110101011000011000100101110000010101100001010001110001001010111000100000000000010101101001001100100011100011101010001100011110001001010101101111111000100101111101111100101100" message_type_id="d007bc7b-511c-40d7-892b-d25fd14fcdae" modulator_index="0" participant_id="aeec0af0-d44f-4dc5-a475-cf7772d83b56" pause="0" timestamp="1555594861.6557095"/>
|
||||
</messages>
|
||||
<message_types>
|
||||
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="d007bc7b-511c-40d7-892b-d25fd14fcdae" name="data">
|
||||
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="0"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="24" fuzz_me="2" fuzz_values="" name="length" show="2" start="16"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="32" fuzz_me="2" fuzz_values="" name="source address" show="2" start="24"/>
|
||||
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="32"/>
|
||||
<ruleset mode="0"/>
|
||||
</message_type>
|
||||
</message_types>
|
||||
</protocol>
|
BIN
Software/Universal Radio Hacker/tests/data/wsp.complex
Normal file
BIN
Software/Universal Radio Hacker/tests/data/wsp.complex
Normal file
Binary file not shown.
BIN
Software/Universal Radio Hacker/tests/data/xavax.coco
Normal file
BIN
Software/Universal Radio Hacker/tests/data/xavax.coco
Normal file
Binary file not shown.
31
Software/Universal Radio Hacker/tests/debug_tests.py
Normal file
31
Software/Universal Radio Hacker/tests/debug_tests.py
Normal file
@ -0,0 +1,31 @@
|
||||
import datetime
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
RUNS = 2000
|
||||
os.system("mkdir -p /tmp/tests")
|
||||
|
||||
streak = 0
|
||||
longest_streak = 0
|
||||
|
||||
for i in range(RUNS):
|
||||
try:
|
||||
filename = "/tmp/tests/" + str(datetime.datetime.now()).replace(" ", "-")
|
||||
t = time.time()
|
||||
completed = subprocess.run("pytest -s -v ../tests", shell=True, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
duration = time.time() - t
|
||||
if completed.returncode == 0:
|
||||
streak += 1
|
||||
longest_streak = max(streak, longest_streak)
|
||||
print("#{} was successful [{:.2f}s] (Streak: {}/{})".format(i + 1, duration, streak, longest_streak))
|
||||
else:
|
||||
streak = 0
|
||||
print("#{} failed [{:.2f}s]".format(i + 1, duration))
|
||||
with open(filename, "wb") as f:
|
||||
f.write(completed.stdout)
|
||||
print("Written output to file {}".format(filename))
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
130
Software/Universal Radio Hacker/tests/device/HackRFTests.py
Normal file
130
Software/Universal Radio Hacker/tests/device/HackRFTests.py
Normal file
@ -0,0 +1,130 @@
|
||||
import time
|
||||
import unittest
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import numpy as np
|
||||
|
||||
from urh.util import util
|
||||
|
||||
util.set_shared_library_path()
|
||||
|
||||
from urh.dev.native.lib import hackrf
|
||||
from urh.dev.native.HackRF import HackRF
|
||||
|
||||
|
||||
class TestHackRF(unittest.TestCase):
|
||||
def callback_fun(self, buffer):
|
||||
print(buffer)
|
||||
for i in range(0, len(buffer), 4):
|
||||
try:
|
||||
r = np.fromstring(buffer[i:i + 2], dtype=np.float16) / 32767.5
|
||||
i = np.fromstring(buffer[i + 2:i + 4], dtype=np.float16) / 32767.5
|
||||
except ValueError:
|
||||
continue
|
||||
if r and i:
|
||||
print(r, i)
|
||||
# out.append(complex(float(buffer[i:i+1])/32767.5, float(buffer[i+2:i+3])/32767.5))
|
||||
|
||||
return 0
|
||||
|
||||
def test_fromstring(self):
|
||||
buffer = b'\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xff\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfe\xfd\xfe\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfe'
|
||||
r = np.empty(len(buffer) // 2, dtype=np.float32)
|
||||
i = np.empty(len(buffer) // 2, dtype=np.float32)
|
||||
c = np.empty(len(buffer) // 2, dtype=np.complex64)
|
||||
|
||||
# dtype =
|
||||
unpacked = np.frombuffer(buffer, dtype=[('r', np.uint8), ('i', np.uint8)])
|
||||
ru = unpacked['r'] / 128.0
|
||||
iu = unpacked['i'] / 128.0
|
||||
|
||||
# for j in range(0, len(buffer)-1, 2):
|
||||
# r[j//2] = np.frombuffer(buffer[j:j + 1], dtype=np.int8) / 128.0
|
||||
# i[j//2] = np.frombuffer(buffer[j + 1:j + 2], dtype=np.int8) / 128.0
|
||||
# r2 = np.fromstring(buffer[], dtype=np.float16) / 32767.5
|
||||
c.real = ru
|
||||
c.imag = iu
|
||||
print(c)
|
||||
# x,y = np.frombuffer(buffer, dtype=[('x', np.float16), ('y', np.float16)])
|
||||
|
||||
def test_fromstring2(self):
|
||||
buffer = b'\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xff\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfe\xfd\xfe\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfe'
|
||||
c = np.empty(len(buffer) // 2, dtype=np.complex64)
|
||||
|
||||
# dtype =
|
||||
unpacked = np.frombuffer(buffer, dtype="<h") # cast in short
|
||||
print(unpacked)
|
||||
f = 1.0/32767.5
|
||||
for i in range(0, len(unpacked)-1,2):
|
||||
c[i] = complex(float(unpacked[i]*f), float(unpacked[i+1]*f))
|
||||
|
||||
print(c)
|
||||
# x,y = np.frombuffer(buffer, dtype=[('x', np.float16), ('y', np.float16)])
|
||||
|
||||
def test_hackrf_class_recv(self):
|
||||
hfc = HackRF(433.92e6, 1e6, 1e6, 20)
|
||||
hfc.start_rx_mode()
|
||||
i = 0
|
||||
TIME_TOTAL = 5
|
||||
while i <TIME_TOTAL:
|
||||
print("{0}/{1}".format(i+1, TIME_TOTAL))
|
||||
time.sleep(1)
|
||||
i+=1
|
||||
print("{0:,}".format(hfc.current_recv_index))
|
||||
hfc.received_data.tofile(os.path.join(tempfile.gettempdir(), "hackrf.complex"))
|
||||
print("Wrote Data")
|
||||
hfc.stop_rx_mode("Finished test")
|
||||
|
||||
def test_hackrf_class_send(self):
|
||||
hfc = HackRF(433.92e6, 1e6, 1e6, 20)
|
||||
hfc.start_tx_mode(np.fromfile(os.path.join(tempfile.gettempdir(), "hackrf.complex"),
|
||||
dtype=np.complex64), repeats=1)
|
||||
while not hfc.sending_finished:
|
||||
print("Repeat: {0} Current Sample: {1}/{2}".format(hfc.current_sending_repeat+1,
|
||||
hfc.current_sent_sample,
|
||||
len(hfc.samples_to_send)))
|
||||
time.sleep(1)
|
||||
hfc.stop_tx_mode("Test finished")
|
||||
|
||||
def test_hackrf_pack_unpack(self):
|
||||
arr = np.array([-128, -128, -0.5, -0.5, -3, -3, 127, 127], dtype=np.int8)
|
||||
self.assertEqual(arr[0], -128)
|
||||
self.assertEqual(arr[1], -128)
|
||||
self.assertEqual(arr[-1], 127)
|
||||
|
||||
received = arr.tostring()
|
||||
self.assertEqual(len(received), len(arr))
|
||||
self.assertEqual(np.int8(received[0]), -128)
|
||||
self.assertEqual(np.int8(received[1]), -128)
|
||||
unpacked = HackRF.bytes_to_iq(received, len(received) // 2)
|
||||
self.assertEqual(unpacked[0], complex(-1, -1))
|
||||
self.assertAlmostEqual(unpacked[1], complex(0, 0), places=1)
|
||||
self.assertAlmostEqual(unpacked[2], complex(0, 0), places=1)
|
||||
self.assertEqual(unpacked[3], complex(1, 1))
|
||||
|
||||
packed = HackRF.iq_to_bytes(unpacked)
|
||||
self.assertEqual(received, packed)
|
||||
|
||||
def test_c_api(self):
|
||||
def callback(n):
|
||||
print("called")
|
||||
return np.array([1], dtype=np.complex64)
|
||||
|
||||
print("init", hackrf.init())
|
||||
print("open", hackrf.open())
|
||||
|
||||
print("start_tx", hackrf.start_tx_mode(callback))
|
||||
time.sleep(1)
|
||||
|
||||
print("stop_tx", hackrf.stop_tx_mode())
|
||||
|
||||
print("close", hackrf.close())
|
||||
print("exit", hackrf.exit())
|
||||
|
||||
def test_device_list(self):
|
||||
print(hackrf.get_device_list())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
56
Software/Universal Radio Hacker/tests/device/TestAirSpy.py
Normal file
56
Software/Universal Radio Hacker/tests/device/TestAirSpy.py
Normal file
@ -0,0 +1,56 @@
|
||||
import unittest
|
||||
|
||||
import time
|
||||
|
||||
from multiprocessing import Queue, Pipe
|
||||
|
||||
import numpy as np
|
||||
|
||||
from urh.dev.native.lib import airspy
|
||||
|
||||
|
||||
class TestAirSpy(unittest.TestCase):
|
||||
def test_cython_wrapper(self):
|
||||
result = airspy.open()
|
||||
print("Open:", airspy.error_name(result), result)
|
||||
|
||||
sample_rates = airspy.get_sample_rates()
|
||||
print("Samples rates:", sample_rates)
|
||||
|
||||
result = airspy.set_sample_rate(10**6)
|
||||
print("Set sample rate", airspy.error_name(result), result)
|
||||
|
||||
result = airspy.set_center_frequency(int(433.92e6))
|
||||
print("Set center frequency", airspy.error_name(result), result)
|
||||
|
||||
result = airspy.set_if_rx_gain(5)
|
||||
print("Set lna gain", airspy.error_name(result), result)
|
||||
|
||||
result = airspy.set_rf_gain(8)
|
||||
print("Set mixer gain", airspy.error_name(result), result)
|
||||
|
||||
result = airspy.set_baseband_gain(10)
|
||||
print("Set vga gain", airspy.error_name(result), result)
|
||||
|
||||
parent_conn, child_conn = Pipe()
|
||||
|
||||
result = airspy.start_rx(child_conn.send_bytes)
|
||||
print("Set start rx", airspy.error_name(result), result)
|
||||
|
||||
time.sleep(0.01)
|
||||
print(np.fromstring(parent_conn.recv_bytes(8*65536), dtype=np.complex64))
|
||||
|
||||
print("Closing")
|
||||
|
||||
parent_conn.close()
|
||||
child_conn.close()
|
||||
|
||||
result = airspy.stop_rx()
|
||||
print("Set stop rx", airspy.error_name(result), result)
|
||||
|
||||
result = airspy.close()
|
||||
print("Close:", airspy.error_name(result), result)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
69
Software/Universal Radio Hacker/tests/device/TestBladeRF.py
Normal file
69
Software/Universal Radio Hacker/tests/device/TestBladeRF.py
Normal file
@ -0,0 +1,69 @@
|
||||
import time
|
||||
from multiprocessing.connection import Pipe
|
||||
|
||||
import numpy as np
|
||||
import unittest
|
||||
|
||||
from urh.dev.native.BladeRF import BladeRF
|
||||
from urh.util import util
|
||||
|
||||
util.set_shared_library_path()
|
||||
|
||||
from urh.dev.native.lib import bladerf
|
||||
|
||||
class TestBladeRF(unittest.TestCase):
|
||||
def test_version(self):
|
||||
bladerf.get_api_version()
|
||||
|
||||
def test_cython_wrapper(self):
|
||||
serials = bladerf.get_device_list()
|
||||
print("Connected serials", serials)
|
||||
|
||||
bladerf.open()
|
||||
|
||||
bladerf.set_tx(True)
|
||||
bladerf.set_channel(0)
|
||||
print("set gain", bladerf.set_gain(20))
|
||||
print("set gain", bladerf.set_gain(21))
|
||||
|
||||
bladerf.set_tx(False)
|
||||
bladerf.set_channel(1)
|
||||
print("Sample Rate", bladerf.get_sample_rate())
|
||||
print("Set sample rate to 2e6", bladerf.set_sample_rate(int(2e6)))
|
||||
print("sample rate", bladerf.get_sample_rate())
|
||||
print("Set sample rate to 40e6", bladerf.set_sample_rate(int(40e6)))
|
||||
print("sample rate", bladerf.get_sample_rate())
|
||||
print("Set sample rate to 200e6", bladerf.set_sample_rate(int(200e6)))
|
||||
print("sample rate", bladerf.get_sample_rate())
|
||||
|
||||
bladerf.set_tx(True)
|
||||
bladerf.set_channel(1)
|
||||
print("Bandwidth", bladerf.get_bandwidth())
|
||||
print("Set Bandwidth to 2e6", bladerf.set_bandwidth(int(2e6)))
|
||||
print("Bandwidth", bladerf.get_bandwidth())
|
||||
|
||||
bladerf.set_tx(False)
|
||||
bladerf.set_channel(0)
|
||||
print("Frequency", bladerf.get_center_freq())
|
||||
print("Set Frequency to 433.92e6", bladerf.set_center_freq(int(433.92e6)))
|
||||
print("Frequency", bladerf.get_center_freq())
|
||||
|
||||
bladerf.prepare_sync()
|
||||
|
||||
parent_conn, child_conn = Pipe()
|
||||
|
||||
for i in range(3):
|
||||
bladerf.receive_sync(child_conn, 4096)
|
||||
data = parent_conn.recv_bytes()
|
||||
print(data)
|
||||
|
||||
bladerf.close()
|
||||
|
||||
bladerf.open()
|
||||
bladerf.set_tx(True)
|
||||
bladerf.set_channel(0)
|
||||
bladerf.prepare_sync()
|
||||
|
||||
for i in range(10):
|
||||
print("Send", bladerf.send_sync(np.fromstring(data, dtype=np.int16)))
|
||||
bladerf.close()
|
112
Software/Universal Radio Hacker/tests/device/TestLimeSDR.py
Normal file
112
Software/Universal Radio Hacker/tests/device/TestLimeSDR.py
Normal file
@ -0,0 +1,112 @@
|
||||
import unittest
|
||||
import sys
|
||||
|
||||
import os
|
||||
from multiprocessing import Pipe
|
||||
f = os.readlink(__file__) if os.path.islink(__file__) else __file__
|
||||
path = os.path.realpath(os.path.join(f, "..", "..", "src"))
|
||||
|
||||
if path not in sys.path:
|
||||
sys.path.insert(0, path)
|
||||
|
||||
import numpy as np
|
||||
|
||||
from urh.util import util
|
||||
|
||||
util.set_shared_library_path()
|
||||
|
||||
from urh.dev.native.lib import limesdr
|
||||
|
||||
|
||||
class TestLimeSDR(unittest.TestCase):
|
||||
def test_cython_wrapper(self):
|
||||
print("Devices:", limesdr.get_device_list())
|
||||
# print("Open:", limesdr.open("LimeSDR-USB, media=USB 3.0, module=STREAM, addr=1d50:6108, serial=0009060B0049180A"))
|
||||
print("Open:", limesdr.open())
|
||||
print("-" * 20)
|
||||
|
||||
print("Init", limesdr.init())
|
||||
limesdr.set_tx(True)
|
||||
self.assertTrue(limesdr.get_tx())
|
||||
#print(limesdr.IS_TX)
|
||||
print("Num Channels TX:", limesdr.get_num_channels())
|
||||
print("TX antennas", limesdr.get_antenna_list())
|
||||
limesdr.set_tx(False)
|
||||
self.assertFalse(limesdr.get_tx())
|
||||
|
||||
print("Num Channels RX:", limesdr.get_num_channels())
|
||||
limesdr.CHANNEL = 0
|
||||
print("Enable RX Channel 0:", limesdr.enable_channel(True, False, 0))
|
||||
|
||||
#path = os.path.realpath(os.path.join(__file__, "..", "..", "src", "urh", "dev", "native", "lime.ini"))
|
||||
#print(path)
|
||||
#limesdr.load_config(path)
|
||||
#limesdr.save_config("/tmp/lime_test.ini")
|
||||
|
||||
clocks = ["LMS_CLOCK_REF", "LMS_CLOCK_SXR", "LMS_CLOCK_SXT", "LMS_CLOCK_CGEN", "LMS_CLOCK_RXTSP", "LMS_CLOCK_TXTSP"]
|
||||
|
||||
for i, clock in enumerate(clocks):
|
||||
print(clock, limesdr.get_clock_freq(i))
|
||||
|
||||
limesdr.print_last_error()
|
||||
print("RX Sample Rate Range:", limesdr.get_sample_rate_range())
|
||||
print("RX Channel 0 Sample Rate:", limesdr.get_sample_rate())
|
||||
print("Set Sample Rate:", limesdr.set_sample_rate(2e6))
|
||||
print("RX Channel 0 Sample Rate:", limesdr.get_sample_rate())
|
||||
|
||||
limesdr.print_last_error()
|
||||
print("RX Frequency Range:", limesdr.get_center_frequency_range())
|
||||
print("RX 0 center freq:", limesdr.get_center_frequency())
|
||||
print("RX 0 set center freq:", limesdr.set_center_frequency(433.92e6))
|
||||
print("RX 0 center freq:", limesdr.get_center_frequency())
|
||||
|
||||
limesdr.print_last_error()
|
||||
print("RX 0 gain", limesdr.get_normalized_gain())
|
||||
print("RX 0 set gain", limesdr.set_normalized_gain(0.5))
|
||||
print("RX 0 gain", limesdr.get_normalized_gain())
|
||||
|
||||
limesdr.print_last_error()
|
||||
print("RX Bandwidth Range", limesdr.get_lpf_bandwidth_range())
|
||||
print("RX 0 Bandwidth", limesdr.get_lpf_bandwidth())
|
||||
print("RX 0 set Bandwidth", limesdr.set_lpf_bandwidth(20e6))
|
||||
print("RX 0 Bandwidth", limesdr.get_lpf_bandwidth())
|
||||
|
||||
limesdr.print_last_error()
|
||||
print("RX 0 calibrate:", limesdr.calibrate(20e6))
|
||||
|
||||
limesdr.print_last_error()
|
||||
antenna_list = limesdr.get_antenna_list()
|
||||
print("RX 0 antenna list", antenna_list)
|
||||
print("RX 0 current antenna", limesdr.get_antenna(), antenna_list[limesdr.get_antenna()])
|
||||
print("RX 0 current antenna BW", limesdr.get_antenna_bw(limesdr.get_antenna()))
|
||||
|
||||
print("Chip Temperature", limesdr.get_chip_temperature())
|
||||
|
||||
parent_conn, child_conn = Pipe()
|
||||
|
||||
for _ in range(2):
|
||||
limesdr.print_last_error()
|
||||
print("Setup stream", limesdr.setup_stream(1000))
|
||||
print("Start stream", limesdr.start_stream())
|
||||
limesdr.recv_stream(child_conn, 1000, 100)
|
||||
print("Stop stream", limesdr.stop_stream())
|
||||
print("Destroy stream", limesdr.destroy_stream())
|
||||
|
||||
print(parent_conn.recv_bytes())
|
||||
|
||||
limesdr.set_tx(True)
|
||||
self.assertTrue(limesdr.get_tx())
|
||||
samples_to_send = np.ones(32768, dtype=np.complex64)
|
||||
for _ in range(2):
|
||||
limesdr.print_last_error()
|
||||
print("Setup stream", limesdr.setup_stream(4000000000))
|
||||
print("Start stream", limesdr.start_stream())
|
||||
print("Send samples", limesdr.send_stream(samples_to_send.view(np.float32), 100))
|
||||
print("Stop stream", limesdr.stop_stream())
|
||||
print("Destroy stream", limesdr.destroy_stream())
|
||||
|
||||
print("-" * 20)
|
||||
print("Close:", limesdr.close())
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
47
Software/Universal Radio Hacker/tests/device/TestPlutoSDR.py
Normal file
47
Software/Universal Radio Hacker/tests/device/TestPlutoSDR.py
Normal file
@ -0,0 +1,47 @@
|
||||
from multiprocessing import Pipe
|
||||
|
||||
from urh.util import util
|
||||
import numpy as np
|
||||
util.set_shared_library_path()
|
||||
|
||||
from urh.dev.native.lib import plutosdr
|
||||
|
||||
|
||||
def test_cython_wrapper():
|
||||
descs, uris = plutosdr.scan_devices()
|
||||
plutosdr.set_tx(False)
|
||||
print("Devices", descs)
|
||||
print("Open", plutosdr.open(uris[0]))
|
||||
print("Set Freq to 433.92e6", plutosdr.set_center_freq(int(433.92e6)))
|
||||
print("Set Sample Rate to 2M", plutosdr.set_sample_rate(int(2.5e6)))
|
||||
print("Set bandwidth to 4M", plutosdr.set_bandwidth(int(4e6)))
|
||||
print("Set gain to 10", plutosdr.set_rf_gain(10))
|
||||
|
||||
print("prepare rx", plutosdr.setup_rx())
|
||||
|
||||
parent_conn, child_conn = Pipe()
|
||||
|
||||
for i in range(10):
|
||||
plutosdr.receive_sync(child_conn)
|
||||
data = parent_conn.recv_bytes()
|
||||
print(np.frombuffer(data, dtype=np.int16))
|
||||
|
||||
print(plutosdr.get_tx())
|
||||
print("Close", plutosdr.close())
|
||||
|
||||
plutosdr.set_tx(True)
|
||||
|
||||
print("Open", plutosdr.open(uris[0]))
|
||||
print("Setup tx", plutosdr.setup_tx())
|
||||
print("Set Freq to 433.92e6", plutosdr.set_center_freq(int(433.92e6)))
|
||||
print("Set Sample Rate to 2M", plutosdr.set_sample_rate(int(2.5e6)))
|
||||
print("Set bandwidth to 4M", plutosdr.set_bandwidth(int(4e6)))
|
||||
print("Set gain to 10", plutosdr.set_rf_gain(-89))
|
||||
|
||||
print("Send", plutosdr.send_sync(np.zeros(4096, dtype=np.int16)))
|
||||
|
||||
print("Close", plutosdr.close())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_cython_wrapper()
|
84
Software/Universal Radio Hacker/tests/device/TestRTLSDR.py
Normal file
84
Software/Universal Radio Hacker/tests/device/TestRTLSDR.py
Normal file
@ -0,0 +1,84 @@
|
||||
import unittest
|
||||
import sys
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
|
||||
from urh.util import util
|
||||
|
||||
util.set_shared_library_path()
|
||||
|
||||
from urh.dev.native.RTLSDR import RTLSDR
|
||||
from urh.dev.native.lib import rtlsdr
|
||||
|
||||
class TestRTLSDR(unittest.TestCase):
|
||||
def test_cython_wrapper(self):
|
||||
|
||||
print("Device count:", rtlsdr.get_device_count())
|
||||
print("Device name:", rtlsdr.get_device_name(0))
|
||||
manufact, product, serial = rtlsdr.get_device_usb_strings(0)
|
||||
print("Manufacturer:", manufact)
|
||||
print("Product:", product)
|
||||
print("Serial", serial)
|
||||
print("Index by serial", rtlsdr.get_index_by_serial(serial))
|
||||
print("Open:", rtlsdr.open(0))
|
||||
print("Reset Buffer:", rtlsdr.reset_buffer()) # IMPORTANT
|
||||
print("XTAL Freq:", rtlsdr.get_xtal_freq())
|
||||
print("USB device strings", rtlsdr.get_usb_strings())
|
||||
print("Center Freq:", rtlsdr.get_center_freq())
|
||||
print("Set center freq to 433MHz", rtlsdr.set_center_freq(int(433e6)))
|
||||
print("Center Freq:", rtlsdr.get_center_freq())
|
||||
print("Freq Correction", rtlsdr.get_freq_correction())
|
||||
print("Set Freq Correction to 10", rtlsdr.set_freq_correction(10))
|
||||
print("Freq Correction", rtlsdr.get_freq_correction())
|
||||
print("tuner type", rtlsdr.get_tuner_type())
|
||||
print("tuner_gains", rtlsdr.get_tuner_gains())
|
||||
print("set_manual_gain_mode", rtlsdr.set_tuner_gain_mode(1))
|
||||
print("tuner gain", rtlsdr.get_tuner_gain())
|
||||
print("set gain to 338", rtlsdr.set_tuner_gain(338))
|
||||
print("tuner gain", rtlsdr.get_tuner_gain())
|
||||
print("set tuner if gain", rtlsdr.set_tuner_if_gain(1, 10))
|
||||
print("Sample Rate", rtlsdr.get_sample_rate())
|
||||
print("Set Sample Rate to 300k", rtlsdr.set_sample_rate(300 * 10 ** 3))
|
||||
print("Sample Rate", rtlsdr.get_sample_rate())
|
||||
read_samples = rtlsdr.read_sync(1024)
|
||||
print(read_samples)
|
||||
rtlsdr.close()
|
||||
|
||||
def test_receive(self):
|
||||
rtlsdr_class = RTLSDR(433.92e6, 20, 2e6, device_number=0)
|
||||
self.assertEqual(rtlsdr_class.current_recv_index, 0)
|
||||
rtlsdr_class.start_rx_mode()
|
||||
time.sleep(2)
|
||||
rtlsdr_class.stop_rx_mode("Finished")
|
||||
index = rtlsdr_class.current_recv_index
|
||||
print(rtlsdr_class.current_recv_index)
|
||||
self.assertGreater(rtlsdr_class.current_recv_index, 0)
|
||||
time.sleep(2)
|
||||
self.assertEqual(index, rtlsdr_class.current_recv_index)
|
||||
rtlsdr_class.start_rx_mode()
|
||||
time.sleep(1)
|
||||
self.assertGreater(rtlsdr_class.current_recv_index, index)
|
||||
|
||||
def test_bytes_to_iq(self):
|
||||
arr = np.array([0, 0, 127.5, 127.5, 255, 255], dtype=np.uint8)
|
||||
self.assertEqual(arr[0], 0)
|
||||
self.assertEqual(arr[1], 0)
|
||||
self.assertEqual(arr[-1], 255)
|
||||
|
||||
received = arr.tostring()
|
||||
self.assertEqual(len(received), len(arr))
|
||||
self.assertEqual(np.int8(received[0]), 0)
|
||||
self.assertEqual(np.int8(received[1]), 0)
|
||||
unpacked = RTLSDR.bytes_to_iq(received, len(received) // 2)
|
||||
|
||||
self.assertEqual(unpacked[0], complex(-1, -1))
|
||||
self.assertAlmostEqual(unpacked[1], complex(0, 0), places=1)
|
||||
self.assertEqual(unpacked[2], complex(1, 1))
|
||||
|
||||
packed = RTLSDR.iq_to_bytes(unpacked)
|
||||
self.assertEqual(received, packed)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
112
Software/Universal Radio Hacker/tests/device/TestRTLSDRPipe.py
Normal file
112
Software/Universal Radio Hacker/tests/device/TestRTLSDRPipe.py
Normal file
@ -0,0 +1,112 @@
|
||||
import unittest
|
||||
from multiprocessing import Pipe
|
||||
|
||||
from multiprocessing import Process
|
||||
from threading import Thread
|
||||
|
||||
from urh.dev.native.lib import rtlsdr
|
||||
import time
|
||||
|
||||
from urh.util.Logger import logger
|
||||
|
||||
|
||||
def callback_recv(buffer):
|
||||
try:
|
||||
print(len(buffer))
|
||||
except BrokenPipeError:
|
||||
pass
|
||||
return 0
|
||||
|
||||
|
||||
def receive_async(callback, connection):
|
||||
rtlsdr.open(0)
|
||||
rtlsdr.reset_buffer()
|
||||
rtlsdr.read_async(callback, connection)
|
||||
connection.close()
|
||||
|
||||
def receive_sync(connection):
|
||||
rtlsdr.open(0)
|
||||
rtlsdr.reset_buffer()
|
||||
exit_requested = False
|
||||
|
||||
while not exit_requested:
|
||||
while connection.poll():
|
||||
result = process_command(connection.recv())
|
||||
if result == "stop":
|
||||
exit_requested = True
|
||||
break
|
||||
|
||||
if not exit_requested:
|
||||
connection.send_bytes(rtlsdr.read_sync())
|
||||
|
||||
connection.close()
|
||||
|
||||
def process_command(command):
|
||||
if command == "stop":
|
||||
return "stop"
|
||||
|
||||
tag, value = command.split(":")
|
||||
if tag == "center_freq":
|
||||
logger.info("[RTLSDR] setting center freq to {}".format(int(value)))
|
||||
rtlsdr.set_center_freq(int(value))
|
||||
elif tag == "tuner_gain":
|
||||
logger.info("[RTLSDR] setting tuner_gain to {}".format(int(value)))
|
||||
rtlsdr.set_tuner_gain(int(value))
|
||||
elif tag == "sample_rate":
|
||||
logger.info("[RTLSDR] setting sample rate to {}".format(int(value)))
|
||||
rtlsdr.set_sample_rate(int(value))
|
||||
|
||||
def read_connection(connection):
|
||||
while True:
|
||||
try:
|
||||
received_bytes = connection.recv_bytes()
|
||||
print(received_bytes[0:100])
|
||||
except EOFError:
|
||||
break
|
||||
|
||||
def f(child_conn):
|
||||
ctrl_command = b""
|
||||
while ctrl_command != b"stop":
|
||||
child_conn.send_bytes(bytearray([1, 2, 3, 4, 5]))
|
||||
time.sleep(0.1)
|
||||
if child_conn.poll():
|
||||
ctrl_command = child_conn.recv_bytes()
|
||||
print("Got from server", ctrl_command)
|
||||
|
||||
print("Stopping....")
|
||||
child_conn.send("goodbye")
|
||||
child_conn.close()
|
||||
|
||||
|
||||
class TestPipe(unittest.TestCase):
|
||||
def test_multiprocessing_pipe(self):
|
||||
parent_conn, child_conn = Pipe()
|
||||
p = Process(target=f, args=(child_conn,))
|
||||
p.start()
|
||||
for _ in range(5):
|
||||
while parent_conn.poll():
|
||||
print("Got from client", parent_conn.recv_bytes()) # prints "[42, None, 'hello']"
|
||||
time.sleep(1)
|
||||
parent_conn.send_bytes(b"stop")
|
||||
p.join()
|
||||
|
||||
|
||||
def test_rtl_sdr_with_pipe(self):
|
||||
parent_conn, child_conn = Pipe()
|
||||
p = Process(target=receive_sync, args=(child_conn, ))
|
||||
t = Thread(target=read_connection, args=(parent_conn, ))
|
||||
t.daemon = True
|
||||
p.daemon = True
|
||||
t.start()
|
||||
p.start()
|
||||
time.sleep(2)
|
||||
print("Sending set freq command")
|
||||
parent_conn.send("center_freq:{}".format(int(433.92e6)))
|
||||
time.sleep(1)
|
||||
parent_conn.send("tuner_gain:{}".format(int(20)))
|
||||
time.sleep(1)
|
||||
parent_conn.send("sample_rate:{}".format(int(2e6)))
|
||||
print("Sending stop command")
|
||||
parent_conn.send("stop")
|
||||
p.join()
|
||||
time.sleep(2)
|
@ -0,0 +1,29 @@
|
||||
import unittest
|
||||
|
||||
from urh.dev.native.RTLSDRTCP import RTLSDRTCP
|
||||
|
||||
class TestRTLSDRTCP(unittest.TestCase):
|
||||
|
||||
def test_device_communication(self):
|
||||
error = 0
|
||||
sdr = RTLSDRTCP(0, 0, 0, device_number=0)
|
||||
sdr.open(sdr.child_ctrl_conn)
|
||||
if sdr.socket_is_open == False:
|
||||
error += 1
|
||||
if sdr.set_parameter("centerFreq", 927000000, sdr.child_ctrl_conn):
|
||||
error += 1
|
||||
if sdr.set_parameter("sampleRate", 2000000, sdr.child_ctrl_conn):
|
||||
error += 1
|
||||
if sdr.set_parameter("bandwidth", 2000000, sdr.child_ctrl_conn):
|
||||
error += 1
|
||||
if sdr.set_parameter("tunerGain", 200, sdr.child_ctrl_conn):
|
||||
error += 1
|
||||
data = sdr.read_sync()
|
||||
if len(data) < 1:
|
||||
error += 1
|
||||
sdr.close()
|
||||
self.assertEqual(error, 0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
49
Software/Universal Radio Hacker/tests/device/TestSDRPlay.py
Normal file
49
Software/Universal Radio Hacker/tests/device/TestSDRPlay.py
Normal file
@ -0,0 +1,49 @@
|
||||
import unittest
|
||||
|
||||
import time
|
||||
from multiprocessing.connection import Connection, Pipe
|
||||
|
||||
import numpy as np
|
||||
from multiprocessing import Process
|
||||
|
||||
from urh.dev.native.SDRPlay import SDRPlay
|
||||
from urh.util import util
|
||||
import ctypes
|
||||
|
||||
util.set_shared_library_path()
|
||||
|
||||
from urh.dev.native.lib import sdrplay
|
||||
|
||||
def recv(conn: Connection):
|
||||
while True:
|
||||
t = time.time()
|
||||
result = SDRPlay.bytes_to_iq(conn.recv_bytes())
|
||||
print("UNPACK", time.time()-t)
|
||||
|
||||
class TestSDRPlay(unittest.TestCase):
|
||||
def test_c_wrapper(self):
|
||||
def pycallback(data):
|
||||
arr = np.asarray(data)
|
||||
#result = np.empty(len(arr) // 2, dtype=np.complex64)
|
||||
#result.real = (arr[::2] + 0.5) / 32767.5
|
||||
#result.imag = (arr[1::2] + 0.5) / 32767.5
|
||||
|
||||
print(sdrplay.get_api_version())
|
||||
print(sdrplay.get_devices())
|
||||
print(sdrplay.set_device_index(0))
|
||||
|
||||
parent_conn, child_conn = Pipe()
|
||||
p = Process(target=recv, args=(parent_conn,))
|
||||
p.daemon = True
|
||||
p.start()
|
||||
|
||||
null_ptr = ctypes.POINTER(ctypes.c_voidp)()
|
||||
print("Init stream", sdrplay.init_stream(50, 2e6, 433.92e6, 2e6, 500, child_conn))
|
||||
|
||||
time.sleep(2)
|
||||
print("settings sample rate")
|
||||
print("Set sample rate", sdrplay.set_sample_rate(2e6))
|
||||
|
||||
time.sleep(1)
|
||||
p.terminate()
|
||||
p.join()
|
105
Software/Universal Radio Hacker/tests/device/TestSoundCard.py
Normal file
105
Software/Universal Radio Hacker/tests/device/TestSoundCard.py
Normal file
@ -0,0 +1,105 @@
|
||||
import numpy as np
|
||||
|
||||
|
||||
def test_sounddevice_lib():
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
from sounddevice import InputStream, OutputStream, sleep as sd_sleep
|
||||
"""
|
||||
if no portaudio installed:
|
||||
Traceback (most recent call last):
|
||||
File "TestSoundCard.py", line 42, in <module>
|
||||
test_sounddevice_lib()
|
||||
File "TestSoundCard.py", line 5, in test_sounddevice_lib
|
||||
import sounddevice as sd
|
||||
File "/usr/lib/python3.6/site-packages/sounddevice.py", line 64, in <module>
|
||||
raise OSError('PortAudio library not found')
|
||||
OSError: PortAudio library not found
|
||||
|
||||
"""
|
||||
|
||||
duration = 2.5 # seconds
|
||||
|
||||
rx_buffer = np.ones((10 ** 6, 2), dtype=np.float32)
|
||||
global current_rx, current_tx
|
||||
current_rx = 0
|
||||
current_tx = 0
|
||||
|
||||
def rx_callback(indata: np.ndarray, frames: int, time, status):
|
||||
global current_rx
|
||||
if status:
|
||||
print(status)
|
||||
|
||||
rx_buffer[current_rx:current_rx + frames] = indata
|
||||
current_rx += frames
|
||||
|
||||
def tx_callback(outdata: np.ndarray, frames: int, time, status):
|
||||
global current_tx
|
||||
if status:
|
||||
print(status)
|
||||
|
||||
outdata[:] = rx_buffer[current_tx:current_tx + frames]
|
||||
current_tx += frames
|
||||
|
||||
with InputStream(channels=2, callback=rx_callback):
|
||||
sd_sleep(int(duration * 1000))
|
||||
|
||||
print("Current rx", current_rx)
|
||||
|
||||
with OutputStream(channels=2, callback=tx_callback):
|
||||
sd_sleep(int(duration * 1000))
|
||||
|
||||
print("Current tx", current_tx)
|
||||
|
||||
|
||||
def test_pyaudio():
|
||||
import pyaudio
|
||||
|
||||
CHUNK = 1024
|
||||
p = pyaudio.PyAudio()
|
||||
|
||||
stream = p.open(format=pyaudio.paFloat32,
|
||||
channels=2,
|
||||
rate=48000,
|
||||
input=True,
|
||||
frames_per_buffer=CHUNK)
|
||||
|
||||
print("* recording")
|
||||
|
||||
frames = []
|
||||
|
||||
for i in range(0, 100):
|
||||
data = stream.read(CHUNK)
|
||||
frames.append(data)
|
||||
|
||||
print("* done recording")
|
||||
|
||||
stream.stop_stream()
|
||||
stream.close()
|
||||
p.terminate()
|
||||
data = b''.join(frames)
|
||||
|
||||
print("* playing")
|
||||
|
||||
p = pyaudio.PyAudio()
|
||||
stream = p.open(format=pyaudio.paFloat32,
|
||||
channels=2,
|
||||
rate=48000,
|
||||
output=True,
|
||||
)
|
||||
|
||||
for i in range(0, len(data), CHUNK):
|
||||
stream.write(data[i:i+CHUNK])
|
||||
|
||||
stream.stop_stream()
|
||||
stream.close()
|
||||
|
||||
p.terminate()
|
||||
|
||||
print("* done playing")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# test_sounddevice_lib()
|
||||
test_pyaudio()
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user