The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
io_tcp_fwcb_t Class Reference

TCP sound-io library's interface to the framework callbacks. More...

Public Member Functions

 io_tcp_fwcb_t (IOProcessEvent_t proc_event, void *proc_handle, IOStartedEvent_t start_event, void *start_handle, IOStoppedEvent_t stop_event, void *stop_handle)
 Constructor stores framework handles and initializes error numbers to 0. More...
 
virtual ~io_tcp_fwcb_t ()
 Do-nothing destructor. More...
 
virtual void start ()
 Call the framework's start callback. More...
 
virtual int process (mha_wave_t *sIn, mha_wave_t *&sOut)
 Call the frameworks processing callback. More...
 
virtual void set_errnos (int proc_err, int io_err)
 Save error numbers to use during. More...
 
virtual void stop ()
 Call the frameworks stop callback. More...
 

Private Attributes

IOProcessEvent_t proc_event
 Pointer to signal processing callback function. More...
 
IOStartedEvent_t start_event
 Pointer to start notification callback function. More...
 
IOStoppedEvent_t stop_event
 Pointer to stop notification callback function. More...
 
void * proc_handle
 Handles belonging to framework. More...
 
void * start_handle
 
void * stop_handle
 
int proc_err
 Errors from the processing callback and from the TCP IO itself are stored here before closing Network handles. More...
 
int io_err
 

Detailed Description

TCP sound-io library's interface to the framework callbacks.

Constructor & Destructor Documentation

◆ io_tcp_fwcb_t()

io_tcp_fwcb_t::io_tcp_fwcb_t ( IOProcessEvent_t  proc_event,
void *  proc_handle,
IOStartedEvent_t  start_event,
void *  start_handle,
IOStoppedEvent_t  stop_event,
void *  stop_handle 
)

Constructor stores framework handles and initializes error numbers to 0.

◆ ~io_tcp_fwcb_t()

virtual io_tcp_fwcb_t::~io_tcp_fwcb_t ( )
inlinevirtual

Do-nothing destructor.

Member Function Documentation

◆ start()

void io_tcp_fwcb_t::start ( )
virtual

Call the framework's start callback.

◆ process()

int io_tcp_fwcb_t::process ( mha_wave_t sIn,
mha_wave_t *&  sOut 
)
virtual

Call the frameworks processing callback.

Parameters
sInThe input sound data just received from TCP.
sOutA pointer to output sound data. Will point to the output sound data storage when the callback finishes.
Returns
Status, an error number from the signal processing callback. If this is != 0, then the connection should be closed.

◆ set_errnos()

void io_tcp_fwcb_t::set_errnos ( int  proc_err,
int  io_err 
)
virtual

Save error numbers to use during.

See also
stop
Parameters
proc_errThe error number from the
See also
process callback.
Parameters
io_errThe error number from the io library itself.

◆ stop()

void io_tcp_fwcb_t::stop ( )
virtual

Call the frameworks stop callback.

Uses the error numbers set previously with

See also
set_errnos.

Member Data Documentation

◆ proc_event

IOProcessEvent_t io_tcp_fwcb_t::proc_event
private

Pointer to signal processing callback function.

◆ start_event

IOStartedEvent_t io_tcp_fwcb_t::start_event
private

Pointer to start notification callback function.

Called when a new TCP connection is established or the user issues the start command while there is a connection.

◆ stop_event

IOStoppedEvent_t io_tcp_fwcb_t::stop_event
private

Pointer to stop notification callback function.

Called when the connection is closed.

◆ proc_handle

void* io_tcp_fwcb_t::proc_handle
private

Handles belonging to framework.

◆ start_handle

void * io_tcp_fwcb_t::start_handle
private

◆ stop_handle

void * io_tcp_fwcb_t::stop_handle
private

◆ proc_err

int io_tcp_fwcb_t::proc_err
private

Errors from the processing callback and from the TCP IO itself are stored here before closing Network handles.

MHAIOTCP is notified by the server when the connection has been taken down, and calls

See also
stop from that callback. Within stop, these error numbers are read again and transmitted to the framework.

◆ io_err

int io_tcp_fwcb_t::io_err
private

The documentation for this class was generated from the following file: