Added typical signalization channels (CCCH, BCCH, SDCCH) decoder and demapper for BCCH.
The implementation is quite dirty at this moment.
diff --git a/include/gsm/CMakeLists.txt b/include/gsm/CMakeLists.txt
index c7f4fb3..49f4a43 100644
--- a/include/gsm/CMakeLists.txt
+++ b/include/gsm/CMakeLists.txt
@@ -23,5 +23,8 @@
install(FILES
api.h
receiver.h
- bursts_printer.h DESTINATION include/gsm
+ bursts_printer.h
+ get_bcch_or_ccch_bursts.h
+ control_channels_decoder.h
+ gsmtap.h DESTINATION include/gsm
)
diff --git a/include/gsm/control_channels_decoder.h b/include/gsm/control_channels_decoder.h
new file mode 100644
index 0000000..a44f43e
--- /dev/null
+++ b/include/gsm/control_channels_decoder.h
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2014 <+YOU OR YOUR COMPANY+>.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef INCLUDED_GSM_CONTROL_CHANNELS_DECODER_H
+#define INCLUDED_GSM_CONTROL_CHANNELS_DECODER_H
+
+#include <gsm/api.h>
+#include <gnuradio/block.h>
+
+namespace gr {
+ namespace gsm {
+
+ /*!
+ * \brief <+description of block+>
+ * \ingroup gsm
+ *
+ */
+ class GSM_API control_channels_decoder : virtual public gr::block
+ {
+ public:
+ typedef boost::shared_ptr<control_channels_decoder> sptr;
+
+ /*!
+ * \brief Return a shared_ptr to a new instance of gsm::control_channels_decoder.
+ *
+ * To avoid accidental use of raw pointers, gsm::control_channels_decoder's
+ * constructor is in a private implementation
+ * class. gsm::control_channels_decoder::make is the public interface for
+ * creating new instances.
+ */
+ static sptr make();
+ };
+
+ } // namespace gsm
+} // namespace gr
+
+#endif /* INCLUDED_GSM_CONTROL_CHANNELS_DECODER_H */
+
diff --git a/include/gsm/get_bcch_or_ccch_bursts.h b/include/gsm/get_bcch_or_ccch_bursts.h
new file mode 100644
index 0000000..d74137a
--- /dev/null
+++ b/include/gsm/get_bcch_or_ccch_bursts.h
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2014 <+YOU OR YOUR COMPANY+>.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_H
+#define INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_H
+
+#include <gsm/api.h>
+#include <gnuradio/block.h>
+
+namespace gr {
+ namespace gsm {
+
+ /*!
+ * \brief <+description of block+>
+ * \ingroup gsm
+ *
+ */
+ class GSM_API get_bcch_or_ccch_bursts : virtual public gr::block
+ {
+ public:
+ typedef boost::shared_ptr<get_bcch_or_ccch_bursts> sptr;
+
+ /*!
+ * \brief Return a shared_ptr to a new instance of gsm::get_bcch_or_ccch_bursts.
+ *
+ * To avoid accidental use of raw pointers, gsm::get_bcch_or_ccch_bursts's
+ * constructor is in a private implementation
+ * class. gsm::get_bcch_or_ccch_bursts::make is the public interface for
+ * creating new instances.
+ */
+ static sptr make();
+ };
+
+ } // namespace gsm
+} // namespace gr
+
+#endif /* INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_H */
+
diff --git a/include/gsm/gsmtap.h b/include/gsm/gsmtap.h
new file mode 100644
index 0000000..bf8226b
--- /dev/null
+++ b/include/gsm/gsmtap.h
@@ -0,0 +1,72 @@
+#ifndef _GSMTAP_H
+#define _GSMTAP_H
+
+/* gsmtap header, pseudo-header in front of the actua GSM payload */
+
+/* GSMTAP is a generic header format for GSM protocol captures,
+ * it uses the IANA-assigned UDP port number 4729 and carries
+ * payload in various formats of GSM interfaces such as Um MAC
+ * blocks or Um bursts.
+ *
+ * Example programs generating GSMTAP data are airprobe
+ * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/)
+ */
+
+#include <stdint.h>
+
+#define GSMTAP_VERSION 0x02
+
+#define GSMTAP_TYPE_UM 0x01 /* A Layer 2 MAC block (23 bytes) */
+#define GSMTAP_TYPE_ABIS 0x02
+#define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */
+
+#define GSMTAP_BURST_UNKNOWN 0x00
+#define GSMTAP_BURST_FCCH 0x01
+#define GSMTAP_BURST_PARTIAL_SCH 0x02
+#define GSMTAP_BURST_SCH 0x03
+#define GSMTAP_BURST_CTS_SCH 0x04
+#define GSMTAP_BURST_COMPACT_SCH 0x05
+#define GSMTAP_BURST_NORMAL 0x06
+#define GSMTAP_BURST_DUMMY 0x07
+#define GSMTAP_BURST_ACCESS 0x08
+#define GSMTAP_BURST_NONE 0x09
+
+#define GSMTAP_CHANNEL_UNKNOWN 0x00
+#define GSMTAP_CHANNEL_BCCH 0x01
+#define GSMTAP_CHANNEL_CCCH 0x02
+#define GSMTAP_CHANNEL_RACH 0x03
+#define GSMTAP_CHANNEL_AGCH 0x04
+#define GSMTAP_CHANNEL_PCH 0x05
+#define GSMTAP_CHANNEL_SDCCH 0x06
+#define GSMTAP_CHANNEL_SDCCH4 0x07
+#define GSMTAP_CHANNEL_SDCCH8 0x08
+#define GSMTAP_CHANNEL_TCH_F 0x09
+#define GSMTAP_CHANNEL_TCH_H 0x0a
+#define GSMTAP_CHANNEL_ACCH 0x80
+
+#define GSMTAP_ARFCN_F_PCS 0x8000
+#define GSMTAP_ARFCN_F_UPLINK 0x4000
+#define GSMTAP_ARFCN_MASK 0x3fff
+
+#define GSMTAP_UDP_PORT 4729 /* officially registered with IANA */
+
+struct gsmtap_hdr {
+ uint8_t version; /* version, set to GSMTAP_VERSION */
+ uint8_t hdr_len; /* length in number of 32bit words */
+ uint8_t type; /* see GSMTAP_TYPE_* */
+ uint8_t timeslot; /* timeslot (0..7 on Um) */
+
+ uint16_t arfcn; /* ARFCN (frequency) */
+ int8_t signal_dbm; /* signal level in dBm */
+ int8_t snr_db; /* signal/noise ratio in dB */
+
+ uint32_t frame_number; /* GSM Frame Number (FN) */
+
+ uint8_t sub_type; /* Type of burst/channel, see above */
+ uint8_t antenna_nr; /* Antenna Number */
+ uint8_t sub_slot; /* sub-slot within timeslot */
+ uint8_t res; /* reserved for future use (RFU) */
+
+} __attribute__((packed));
+
+#endif /* _GSMTAP_H */