Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cmake-build-debug/
/.idea/
/build/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "airspy"]
path = airspy
url = https://github.com/airspy/airspyone_host
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
project(adsbdec)

cmake_minimum_required(VERSION 3.10)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(FindPackageHandleStandardArgs)

add_library(
adsbdec-lib
demod.c
crc.c
output.c
air.c
valid.c
)

add_subdirectory(airspy)

find_package(LIBUSB REQUIRED)

include_directories(${LIBUSB_INCLUDE_DIR})
include_directories(airspy/libairspy/src)

add_executable(adsbdec main.c)
target_link_libraries(adsbdec-lib m airspy-static ${LIBUSB_LIBRARIES})
target_link_libraries(adsbdec adsbdec-lib)
15 changes: 0 additions & 15 deletions Makefile

This file was deleted.

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ If you need that adsbdec act as server (like dump1090) :
Need libusb and libairspy

Just do
> make
```shell
mkdir build
cd build
cmake ..
make
```
2 changes: 1 addition & 1 deletion air.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <string.h>
#include <fcntl.h>
#include <time.h>
#include <libairspy/airspy.h>
#include <airspy.h>
#include "adsbdec.h"

#define AIR_SAMPLE_RATE 20000000
Expand Down
1 change: 1 addition & 0 deletions airspy
Submodule airspy added at 0bccf3
37 changes: 37 additions & 0 deletions cmake/FindLIBUSB.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# - Try to find the freetype library
# Once done this defines
#
# LIBUSB_FOUND - system has libusb
# LIBUSB_INCLUDE_DIR - the libusb include directory
# LIBUSB_LIBRARIES - Link these to use libusb

# Copyright (c) 2006, 2008 Laurent Montel, <montel@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.


if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)

# in cache already
set(LIBUSB_FOUND TRUE)

else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)

find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBUSB libusb-1.0)
endif(PKG_CONFIG_FOUND)

FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h
PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})

FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)

MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)

endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
2 changes: 1 addition & 1 deletion crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
#include <stddef.h>
#include <inttypes.h>
#include <crc.h>
#include "crc.h"

static const uint32_t error_table[112] = {
0x3935ea, 0x1c9af5, 0xf1b77e, 0x78dbbf, 0xc397db, 0x9e31e9, 0xb0e2f0, 0x587178,
Expand Down