Skip to content

Commit 5bd64b3

Browse files
author
Chris Poore
committed
Adding bladeRF 2.0 support and applying bladeRF updates
1 parent 0e7c03e commit 5bd64b3

File tree

57 files changed

+15461
-21049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+15461
-21049
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## 2022-09-23
5+
6+
Adding support for bladeRF 2.0 micro and updating existing bladeRF content.
7+
8+
### Added
9+
10+
- bladeRF 2.0 micro support (Dashboard, Hardware Selection GUI, TSI Detector, Inspection flow graphs, IQ record/playback, Archive playback, adding attacks to library)
11+
- adsb_parser block in gr-ainfosec for Python2_maint-3.7, Python3_maint-3.8 branches
12+
- Added more bladeRF firmware support to the installer for: 40, A4, A9
13+
- Guess button functionality for original bladeRF, serial number passed to flow graphs
14+
- Added bladeRF 2.0 micro to hardware list in README
15+
16+
### Changed
17+
18+
- Moved gain variables for osmocom source/sink blocks to IF gain location for bladeRF flow graphs
19+
- Installing bladeRF and gr-osmocom software from source for Python2_maint-3.7 branch to support bladeRF 2.0
20+
- Resized bladeRF probe button window size
21+
22+
### Fixed
23+
24+
- Added missing ".py" for USRP N2xx TSI wideband detector name
25+
- Resized hardware selection GUI for Python2_maint-3.7 branch
26+
- Added missing hardware types in combobox for adding new demodulation flow graphs to library
27+
- Changed bladeRF icon from a bladeRF 2.0 image
28+
429
## 2022-09-18
530

631
USRP2 and USRP N2xx support was added but not tested against real devices. Please report any issues.

Custom_Blocks/maint-3.8/gr-ainfosec/grc/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ install(FILES
2121
ainfosec_adsb_encode.block.yml
2222
ainfosec_UDP_to_Wireshark.block.yml
2323
ainfosec_UDP_to_Wireshark_Async.block.yml
24-
ainfosec_wideband_detector1.block.yml DESTINATION share/gnuradio/grc/blocks
24+
ainfosec_wideband_detector1.block.yml
25+
ainfosec_adsb_parser.block.yml DESTINATION share/gnuradio/grc/blocks
2526
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
id: ainfosec_adsb_parser
2+
label: adsb_parser
3+
category: '[ainfosec]'
4+
5+
templates:
6+
imports: import ainfosec
7+
make: ainfosec.adsb_parser(${port})
8+
9+
parameters:
10+
- id: port
11+
label: Port
12+
dtype: int
13+
default: 55555
14+
15+
inputs:
16+
- label: Decoded PDU
17+
domain: message
18+
dtype: message
19+
vlen: 1
20+
optional: 1
21+
22+
file_format: 1

Custom_Blocks/maint-3.8/gr-ainfosec/python/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ GR_PYTHON_INSTALL(
3434
__init__.py
3535
adsb_encode.py
3636
UDP_to_Wireshark.py
37-
UDP_to_Wireshark_Async.py DESTINATION ${GR_PYTHON_DIR}/ainfosec
37+
UDP_to_Wireshark_Async.py
38+
adsb_parser.py DESTINATION ${GR_PYTHON_DIR}/ainfosec
3839
)
3940

4041
########################################################################

Custom_Blocks/maint-3.8/gr-ainfosec/python/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@
3535
from .adsb_encode import adsb_encode
3636
from .UDP_to_Wireshark import UDP_to_Wireshark
3737
from .UDP_to_Wireshark_Async import UDP_to_Wireshark_Async
38+
from .adsb_parser import adsb_parser
3839
#
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright 2022 gr-ainfosec author.
5+
#
6+
# This is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 3, or (at your option)
9+
# any later version.
10+
#
11+
# This software is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this software; see the file COPYING. If not, write to
18+
# the Free Software Foundation, Inc., 51 Franklin Street,
19+
# Boston, MA 02110-1301, USA.
20+
#
21+
22+
23+
import numpy
24+
from gnuradio import gr
25+
import pmt
26+
import socket
27+
28+
class adsb_parser(gr.basic_block):
29+
"""
30+
docstring for block adsb_parser
31+
"""
32+
def __init__(self, port):
33+
gr.basic_block.__init__(self,
34+
name="adsb_parser",
35+
in_sig=[],
36+
out_sig=[])
37+
38+
# Create UDP Socket
39+
self.udp_port = port
40+
self.udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
41+
42+
self.message_port_register_in(pmt.intern("Decoded PDU"))
43+
self.set_msg_handler(pmt.intern("Decoded PDU"), self.handle_msg)
44+
45+
46+
47+
def handle_msg(self, msg):
48+
""" Converts the PDU of formatted ADS-B bits to bytes.
49+
"""
50+
# Convert PDU to Bytes
51+
print("HANDLE MESSAGE")
52+
#print(msg)
53+
54+
#print(pmt.car(msg)) # ((snr . 20.2942) (df . 17) (icao . a8fc72) (datetime . 2022-09-20 03:21:13.546551 UTC) (timestamp . 1.66364e+09) (num_msgs . 1) (longitude . nan) (latitude . nan) (vertical_rate . nan) (heading . nan) (speed . nan) (altitude . nan) (callsign . UAL599 ))
55+
56+
a = pmt.serialize_str(pmt.cdr(msg)) # bytes
57+
b = str(pmt.serialize_str(pmt.cdr(msg)).hex()) # string
58+
59+
c = b.split('70')[1] # 010001000000010100010100010001000000010101010101000000010101000001000000010000000101000100010001000000000001000001010000010100010001010101000001010101000001010000000000010000000000010001010000010001010001010100000001010101010000
60+
61+
d = c[1::2] # 101000110110101000111111000111001000100011010101000001001100110101111001111001100000100000101100101101110001111100
62+
63+
print(d)
64+
65+
# Add Excess Bits
66+
if len(d) % 8 != 0:
67+
e = d + '0' * (8 - len(d) % 8)
68+
69+
# Print Bytes to Output Port
70+
data_hex = ('%0*X' % (2, int(e, 2))).zfill(len(e) // 4)
71+
72+
73+
# ~ # PDUs
74+
# ~ try:
75+
# ~ cdr = bytes.fromhex(pmt.to_python(msg))
76+
77+
# ~ # Message Bytes ('\x00\xAA\xFF...')
78+
# ~ except:
79+
# ~ print("error")
80+
# ~ cdr = pmt.to_python(msg)
81+
# ~ print(cdr)
82+
83+
# Send Message
84+
self.udp_socket.sendto(bytes.fromhex(data_hex),("127.0.0.1", self.udp_port))

0 commit comments

Comments
 (0)