(Page 44 of 69 in this chapter) Version
adiStartReceivingFSK
Description
- Receives Frequency Shift Key (FSK) data.
Prototype
- DWORD adiStartReceivingFSK ( CTAHD ctahd,
void *buffer,
unsigned bufsize,
ADI_FSKRECEIVE_PARMS *parms)
- ctahd CTA context handle returned by ctaCreateContext.
- buffer Pointer to buffer to hold received data.
- bufsize Size of buffer to receive.
- parms Pointer to the FSK receive parameters, stored in the following structure (NULL designates default values):
typedef struct
{
DWORD size; /* Size of this structure */
INT32 minlevel; /* Required minimum receive level (dB) */
DWORD minmark; /* Minimum required initial mark and seizure */
DWORD droptime; /* Minimum dropout to silence before a */
/* packet is considered terminated (ms) */
DWORD baudrate; /* Baud rate (only 1200 supported) */
} ADI_FSKRECEIVE_PARMS;
Return Values
Events
DSP File
- For most AG hardware, this function requires that adsir.dsp has been loaded. On AG 2000 boards and AG 4000 boards, adsir.m54 must be loaded to the board before adiStartReceivingFSK will work.
- On CG 6000C boards, adsir.f54 must be loaded to the board before adiStartReceivingFSK will work. Refer to the board-specific installation and developer's manual for a table of MIPS usage for all functions.
- For QX hardware, this function is supported in the standard DSP file. Refer to the QX Installation and Developer's Manual for a table of MIPS usage for all functions.
Details
- This function receives Frequency Shift Key (FSK) data. The function may be stopped using adiStopReceivingFSK. When the function completes, the ADIEVN_FSK_RECEIVE_DONE event is generated.
- If the event value field contains CTA_REASON_FINISHED or CTA_REASON_STOPPED, the size field of the event structure contains the number of bytes received. The received buffer is in the buffer field. If errors occur, the receive operation is terminated and the event value field contains either ADI_REASON_DROP_IN_DATA or ADI_REASON_BAD_STOP_BIT.
See Also
- adiStopReceivingFSK
Example
#define MYRECEIVE_FAILURE (-11)
#define MYRECEIVE_STOPPED (-12)
int myReceiveFSK( CTAHD ctahd )
{
CTA_EVENT event;
char buffer [512];
if( adiStartReceivingFSK( ctahd, buffer, sizeof buffer, NULL) != SUCCESS )
return MYFAILURE;
do
{
myGetEvent( &event ); /* see ctaWaitEvent example */
} while( event.id != ADIEVN_FSK_RECEIVE_DONE );
switch( event.value )
{
case CTA_REASON_FINISHED:
return SUCCESS;
case CTA_REASON_RELEASED:
return MYDISCONNECT;
case CTA_REASON_STOPPED:
/* Receive was stopped by another application thread */
return MYRECEIVE_STOPPED;
case ADI_REASON_DROP_IN_DATA:
case ADI_REASON_BAD_STOP_BIT:
return MYRECEIVE_FAILURE;
default:
if( CTA_IS_ERROR( event.value ) )
return MYFAILURE;
}
return MYFAILURE;
}
(Page 44 of 69 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights
reserved.