QRSS Rx Network receiver. A receiver to sample a segment of RF spectrum and send this data to a server for further processing and display. NXP mbed Design Challenge entry (Honorable Mention). Published in Circuit Cellar, Feb 2012

Dependencies:   NetServices mbed DNSResolver

Committer:
claytong
Date:
Wed Jan 25 20:32:53 2012 +0000
Revision:
0:82ff15078322
1.0 (initial public release)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
claytong 0:82ff15078322 1 /*---------------------------------------------------------------------------
claytong 0:82ff15078322 2
claytong 0:82ff15078322 3 QRSS Receiver Application
claytong 0:82ff15078322 4
claytong 0:82ff15078322 5 by Clayton ZL3TKA/VK1TKA
claytong 0:82ff15078322 6 clayton@isnotcrazy.com
claytong 0:82ff15078322 7
claytong 0:82ff15078322 8 Buffer System
claytong 0:82ff15078322 9
claytong 0:82ff15078322 10 ---------------------------------------------------------------------------*/
claytong 0:82ff15078322 11 // include files
claytong 0:82ff15078322 12
claytong 0:82ff15078322 13 #include "BufferSys.h"
claytong 0:82ff15078322 14
claytong 0:82ff15078322 15 // Definitions
claytong 0:82ff15078322 16
claytong 0:82ff15078322 17 // Macros
claytong 0:82ff15078322 18
claytong 0:82ff15078322 19 // Local Data
claytong 0:82ff15078322 20
claytong 0:82ff15078322 21 // Global Data
claytong 0:82ff15078322 22 const TDataSample NullSample = {0,0};
claytong 0:82ff15078322 23
claytong 0:82ff15078322 24 // Function Prototypes
claytong 0:82ff15078322 25
claytong 0:82ff15078322 26 //---------------------------------------------------------------------------
claytong 0:82ff15078322 27 // BUFFER SYSTEM METHODS
claytong 0:82ff15078322 28 //---------------------------------------------------------------------------
claytong 0:82ff15078322 29
claytong 0:82ff15078322 30 //---------------------------------------------------------------------------
claytong 0:82ff15078322 31 //
claytong 0:82ff15078322 32 // Buffer Release Method
claytong 0:82ff15078322 33 //
claytong 0:82ff15078322 34 void TBufferHandle::Release( void )
claytong 0:82ff15078322 35 {
claytong 0:82ff15078322 36 if ( !HasBuffer() )
claytong 0:82ff15078322 37 return;
claytong 0:82ff15078322 38 // If the handler was the only reference to the buffer
claytong 0:82ff15078322 39 // then the buffer should be released to the pool
claytong 0:82ff15078322 40 if ( pMyBuffer->iRefCount<=0 )
claytong 0:82ff15078322 41 error( "TBufferHandle::CheckForBuffer Invalid TBufferData iRefCount in Release - %d\r\n", pMyBuffer->iRefCount );
claytong 0:82ff15078322 42 pMyBuffer->iRefCount--;
claytong 0:82ff15078322 43 if ( pMyBuffer->iRefCount==0 )
claytong 0:82ff15078322 44 { // Release message to the pool it came from
claytong 0:82ff15078322 45 pMyBuffer->pPool->ReturnToPool( pMyBuffer );
claytong 0:82ff15078322 46 }
claytong 0:82ff15078322 47 // Detach the message from the handler
claytong 0:82ff15078322 48 pMyBuffer = NULL;
claytong 0:82ff15078322 49 }
claytong 0:82ff15078322 50
claytong 0:82ff15078322 51 //---------------------------------------------------------------------------
claytong 0:82ff15078322 52 // END
claytong 0:82ff15078322 53 //---------------------------------------------------------------------------