1## BLE Phy activity dumps
2
3The Physical layer (Phy) can dump all radio activity to files.
4These files will contain all transmissions, receptions and RSSI measurements
5from each device.
6
7The files are stored in `results/<sim_id>/d_2G4_<dev_number>.{Rx|Tx|RSSI}.csv`
8
9These files are formated as comma separated files (csv) with one line heading,
10and, after, one line for each transaction.
11
12This dumps can be converted to other formats other tools can process.
13Check the `dump_post_process/` folder for more info.
14
15The Phy can also be run in "check" mode. In this mode it will compare the
16content of already existing files (for ex. from a previous run) with what it
17would have generated otherwise, and warn when differences are found.
18Run the Phy with `--help` to get more info about this option.
19
20### Tx (v1) format
21
22For each device transmission, these are the columns:
23
24* start_time : microsecond when the first bit of the packet in air starts (1st bit of the preamble)
25* end_time: microsecond when the last bit of the packet ends (last bit of the CRC). Note that a packet may have been aborted before reaching this point.
26* center_freq: As an offset from 2400MHz, in MHz, carrier frequency. Note that frequencies below 0 and above 80 are valid for interferers.
27* phy_address : Physical address / sync word of the packet
28* modulation: Modulation type. One of P2G4_MOD_* : 0x10 = BLE 1 Mbps, 0x20 = BLE 2Mbps
29* power_level: In dBm, transmitted power level (accounting for the device antenna gain)
30* abort_time: When was the packet transmission aborted, or TIME_NEVER (2^64-1) if not aborted.
31* recheck_time: (internal info) When did the device request to reevaluate the possibility to abort the packet last time
32* packet_size: Size of the packet in bytes (not counting preamble or syncword, but counting header, payload, MIC and CRC)
33* packet: Actual packet data (packet_size bytes)
34
35### Rx (v1)
36
37For each device reception attempt, these are the columns:
38
39* start_time: When (in air time) was the receiver opened
40* scan_duration: For how long was the receiver opened attempting to have a physical address match
41* phy_address: Physical address / sync word which was searched for
42* modulation: Type of modulation the receiver is configured to receive. One of P2G4_MOD_*
43* center_freq: As an offset from 2400MHz, in MHz, carrier frequency.
44* antenna_gain: Receiver antenna gain in dB
45* sync_threshold: Reception tolerance: How many errors do we accept before considering the preamble + address sync lost
46* header_threshold: How many errors do we accept in the header before giving a header error (automatically in the phy).
47* pream_and_addr_duration: Duration of the preamble and syncword (for 1Mbps BLE, 40 micros)
48* header_duration:  Duration of the packet header (for 1Mbps BLE, 16 micros)
49* bps : Phy bitrate in bits per second (for 1Mbps 1e6)
50* abort_time: When was the packet reception aborted, or TIME_NEVER (2^64-1) if not aborted.
51* recheck_time: (internal info) When did the device request to reevaluate the possibility to abort the reception last time
52* tx_nbr: Which simulated device number was synchronized to (-1 if none)
53* biterrors: How many bit errors there was during the packet reception
54* sync_end: Last micros (included) in which the address ended (only if there was a sync)
55* header_end: Last micros (included) in which the packet header ended (only if there was a sync)
56* payload_end: Last micros (included) in which the packet (CRC) ended (only if there was a sync)
57* rx_time_stamp: Reception time stamp (last microsecond of the sync word/address)
58* status: Reception status. One of P2G4_RXSTATUS*: 1:Ok, 2: CRC error, 3: Header Error, 4: No sync
59* RSSI: Measured RSSI (Received signal strenght indication) value in dBm
60* packet_size: Size of the packet in bytes (not counting preamble or syncword, but counting header, payload, MIC and CRC)
61* packet: Actual packet data (packet_size bytes), note that this is the actual transmitted packet, without possible bit errors
62
63### RSSI:
64
65For each RSSI measurement (excluding the ones performed automatically in Rx measurements)
66
67* meas_time: microsecond in which the mesaurement was performed
68* modulation: Type of modulation the receiver is configured for during the measurement. One of P2G4_MOD_*
69* center_freq: As an offset from 2400MHz, in MHz.
70* antenna_gain: Receiver antenna gain in dB
71* RSSI: Measured RSSI (Received signal strenght indication) value in dBm
72
73### Tx (v2) format
74
75For each device transmission, these are the columns:
76
77* start_tx_time: microsecond when the transmitter starts emitting
78* end_tx_time: microsecond when the transmitter stopped emitting (note that it may have been aborted)
79* start_packet_time: microsecond when the first bit of the packet in air would start (assuming it is not truncated) (1st bit of the preamble)
80* end_packet_time: microsecond when the last bit of the packet ends (for ex. last bit of the CRC). Note that a packet may have been aborted.
81* center_freq: As an offset from 2400MHz, in MHz, carrier frequency. Note that frequencies below 0 and above 80 are valid for interferers.
82* phy_address : Physical address / sync word of the packet
83* modulation: Modulation type. One of P2G4_MOD_* : 0x10 = BLE 1 Mbps, 0x20 = BLE 2Mbps
84* power_level: In dBm, transmitted power level (accounting for the device antenna gain)
85* abort_time: When was the packet transmission aborted, or TIME_NEVER (2^64-1) if not aborted.
86* recheck_time: (internal info) When did the device request to reevaluate the possibility to abort the packet last time
87* packet_size: Size of the packet in bytes (not counting preamble or syncword, but counting header, payload, MIC and CRC)
88* packet: Actual packet data (packet_size bytes)
89
90### Rx (v2)
91
92For each device reception attempt, these are the columns:
93
94* start_time: When (in air time) was the receiver opened
95* scan_duration: For how long was the receiver opened attempting to have a physical address match
96* n_addr: How many addresses is the receiver trying to search for simultaneously
97* phy_address[]: Array of physical addresses / sync wordes which were searched for
98* modulation: Type of modulation the receiver is configured to receive. One of P2G4_MOD_*
99* center_freq: As an offset from 2400MHz, in MHz, carrier frequency.
100* antenna_gain: Receiver antenna gain in dB
101* acceptable_pre_truncation: Up to how many µs of the preamble may have been missed by the receiver
102* sync_threshold: Reception tolerance: How many errors do we accept before considering the preamble + address sync lost
103* header_threshold: How many errors do we accept in the header before giving a header error (automatically in the phy).
104* pream_and_addr_duration: Duration of the preamble and syncword (for 1Mbps BLE, 40 micros)
105* header_duration:  Duration of the packet header (for 1Mbps BLE, 16 micros)
106* error_calc_rate : Error calculation rate in bits per second (for ex. for 1Mbps 1e6)
107* resp_type: Type of response the receiver wants at the reception end (0 only supported so far)
108* abort_time: When was the packet reception aborted, or TIME_NEVER (2^64-1) if not aborted.
109* recheck_time: (internal info) When did the device request to reevaluate the possibility to abort the reception last time
110* tx_nbr: Which simulated device number was synchronized to (-1 if none)
111* matched_addr: Which phy address was actually matched
112* biterrors: How many bit errors there was during the packet reception
113* sync_end: Last micros (included) in which the address ended (only if there was a sync)
114* header_end: Last micros (included) in which the packet header ended (only if there was a sync)
115* payload_end: Last micros (included) in which the packet (CRC) ended (only if there was a sync)
116* rx_time_stamp: Reception time stamp (last microsecond of the sync word/address)
117* status: Reception status. One of P2G4_RXSTATUS*: 1:Ok, 2: CRC/Payload error, 3: Header Error, 4: No sync
118* RSSI: Measured RSSI (Received signal strenght indication) value in dBm
119* packet_size: Size of the packet in bytes (not counting preamble or syncword, but counting header, payload, MIC and CRC)
120* packet: Actual packet data (packet_size bytes), note that this is the actual transmitted packet, without possible bit errors
121
122### CCA
123
124For each device CCA request attempt, these are the columns:
125
126* start_time: When (in air time) was the measurement started
127* scan_duration: For how long, in µs, is the measurement performed
128* scan_period: How often will the phy re-measure/check
129* modulation: Which modulation is being search for, and which modulation is the receiver opened with for the RSSI measurements
130* center_freq: Center frequency for the search
131* antenna_gain: Receiver antenna gain in dB
132* threshold_mod: Power threshold at which the search may stop, while it detects the expected modulation
133* threshold_rssi: Power threshold at which the search may stop, when it does not detect the expected modulation
134* stop_when_found: Stop when detecting the modulation (and the rx power > threshold_mod) (1), stop when not detecting the modulation (and the rx power > threshold_rssi) (2), or both (3), or neither (0)
135* abort_time: When was the measurement aborted, or TIME_NEVER (2^64-1) if not aborted.
136* recheck_time: (internal info) When did the device request to reevaluate the possibility to abort last time
137* end_time: When did the measurement actually end
138* RSSI_ave: Average measured RSSI value (in dBm)
139* RSSI_max: Maximum measured RSSI value (in dBm)
140* mod_rx_power: Maximum measured power/RSSI when a compatible modulation was heard
141* mod_found: Was a compatible modulation heard over its threshold power or not
142* rssi_overthreshold: Was the rssi value over its threshold power or not