Skip to content

Commit a2e772d

Browse files
committed
cleaned up the code
1 parent 9a3b8e3 commit a2e772d

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

python_hackrf/pyhackrf_tools/pyhackrf_sweep.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ except ImportError:
3232

3333
from libc.stdint cimport uint32_t, uint64_t
3434
from python_hackrf import pyhackrf
35-
cimport numpy as np
3635
import numpy as np
3736
import datetime
3837
import signal
@@ -73,7 +72,7 @@ def init_signals():
7372
pass
7473

7574

76-
cdef sweep_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[:], buffer_length: int, valid_length: int):
75+
cdef sweep_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[np.uint8_t, 1], buffer_length: int, valid_length: int):
7776
global run_available, device_data
7877

7978
timestamp = datetime.datetime.now()

python_hackrf/pyhackrf_tools/pyhackrf_transfer.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def init_signals():
6666
pass
6767

6868

69-
def rx_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[:], buffer_length: int, valid_length: int):
69+
cdef rx_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[np.uint8_t, 1], buffer_length: int, valid_length: int):
7070
global run_available, device_data
7171

7272
if not run_available[device.serialno]:
@@ -97,7 +97,7 @@ def rx_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[:], buffer_l
9797
return 0
9898

9999

100-
def tx_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[:], buffer_length: int, valid_length: int):
100+
cdef tx_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[np.uint8_t, 1], buffer_length: int, valid_length: int):
101101
global run_available, device_data
102102

103103
current_device_data = device_data[device.serialno]
@@ -205,7 +205,7 @@ def tx_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[:], buffer_l
205205
return 0, buffer, valid_length
206206

207207

208-
def tx_complete_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[:], buffer_length: int, valid_length: int, success: int):
208+
cdef tx_complete_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[np.uint8_t, 1], buffer_length: int, valid_length: int, success: int):
209209
global run_available, device_data
210210

211211
if not success:
@@ -218,7 +218,7 @@ def tx_complete_callback(device: pyhackrf.PyHackrfDevice, buffer: np.ndarray[:],
218218
current_device_data['stream_power'] += np.sum(buffer[:valid_length].view(np.int8).astype(np.uint64, copy=False) ** 2)
219219

220220

221-
def flush_callback(device: pyhackrf.PyHackrfDevice, success: int):
221+
cdef flush_callback(device: pyhackrf.PyHackrfDevice, success: int):
222222
global run_available, device_data
223223

224224
current_device_data = device_data[device.serialno]

python_hackrf/pylibhackrf/pyhackrf.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ from . cimport chackrf
2828

2929

3030
from enum import IntEnum
31-
cimport numpy as np
3231
import numpy as np
3332

3433
PY_BYTES_PER_BLOCK = chackrf.BYTES_PER_BLOCK

python_hackrf/pylibhackrf/pyhackrf_android.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ from libc.stdlib cimport malloc, free
2929

3030

3131
from enum import IntEnum
32-
cimport numpy as np
3332
import numpy as np
34-
import uuid
3533

3634
PY_BYTES_PER_BLOCK = chackrf.BYTES_PER_BLOCK
3735
PY_MAX_SWEEP_RANGES = chackrf.MAX_SWEEP_RANGES

0 commit comments

Comments
 (0)