Handler code cleanup AND C++ api library infrastructure

master
Lucjan Bryndza 2013-05-27 19:21:29 +02:00
rodzic f4e7a49841
commit 3f7a84f14e
3 zmienionych plików z 36 dodań i 9 usunięć

Wyświetl plik

@ -70,12 +70,6 @@ typedef std::array<int, 16> signal_vector_type;
typedef std::array<unsigned int, 16> sync_array_type;
/* ------------------------------------------------------------------------- */
/* Function event handler type
* first parameter channel number
* second channel type
*/
typedef std::function <void( const event &ev )> event_handler_t;
/* ------------------------------------------------------------------------- */
/* Receiver codec base class */
@ -200,7 +194,7 @@ public:
static constexpr auto INVALID = -1;
static constexpr auto ALL = -1;
/* Constructor */
trx_device_base( event_handler_t evt_callback )
trx_device_base( handler_t evt_callback )
: m_evt_callback( evt_callback )
{
}
@ -288,7 +282,7 @@ private:
spectrum_calculator m_spectrum; /* Spectrum calculator object */
unsigned m_spectrum_tmr {}; /* Spectrum time */
unsigned short m_spectrum_timeout { 250 }; /* Spectrum timeout */
const event_handler_t m_evt_callback; /* Event handler object */
const handler_t m_evt_callback; /* Event handler object */
mode m_mode { mode::off }; /* Current device mode */
};

Wyświetl plik

@ -0,0 +1,33 @@
/*
* ham_digi.hpp
*
* Created on: 27-05-2013
* Author: lucck
*/
/* ------------------------------------------------------------------------- */
#ifndef HAM_DIGI_HPP_
#define HAM_DIGI_HPP_
/* ------------------------------------------------------------------------- */
#include "codec/trx_device_base.hpp"
/* ------------------------------------------------------------------------- */
namespace ham {
namespace psk {
/* ------------------------------------------------------------------------- */
/* Function event handler type
* first parameter channel number
* second channel type
*/
typedef std::function <void( int chn, const event &ev )> event_handler_t;
/* ------------------------------------------------------------------------- */
//Master class access library
class ham_digi
{
};
/* ------------------------------------------------------------------------- */
}}
/* ------------------------------------------------------------------------- */
#endif /* HAM_DIGI_HPP_ */
/* ------------------------------------------------------------------------- */

Wyświetl plik

@ -26,7 +26,7 @@ class pulse_device: public trx_device_base
{
public:
//Constructor
pulse_device( event_handler_t evt_callback, const char *name = nullptr )
pulse_device( handler_t evt_callback, const char *name = nullptr )
: trx_device_base(evt_callback), m_dev_name( name )
{
}