# adiStartSendingFSK

Sends frequency shift key (FSK) data.

#### Supported board types

- AG

- CG

#### Prototype

DWORD adiStartSendingFSK ( CTAHD ctahd, void *buffer, unsigned bufsize, ADI_FSKSEND_PARMS *parms)

Argument | Description
ctahd | Context handle returned by ctaCreateContext or ctaAttachContext.
buffer | Buffer to send.
bufsize | Size of buffer to send.
parms | Pointer to FSK send parameters, as follows (NULL designates default values): typedef struct { DWORD size; /* Size of this structure */ DWORD noseizureflag;/* No channel seizure when set */ INT32 level; /* Transmit output scaling (dBm) */ DWORD seizetime; /* Length of channel seizure in (ms) */ DWORD marktime; /* Length of the initial mark signal in (ms)*/ DWORD baudrate; /* Baud rate (only 1200 supported) */ } ADI_FSKSEND_PARMS; Refer to ADI_FSKSEND_PARMS for field descriptions.

#### Return values

Return value | Description
SUCCESS |
CTAERR_BAD_ARGUMENT | Function argument had an invalid value, or a required pointer argument was NULL.
CTAERR_FUNCTION_ACTIVE | Function already active.
CTAERR_INVALID_CTAHD | Context handle is invalid.
CTAERR_INVALID_STATE | Function not valid in the current port state.
CTAERR_SVR_COMM | Server communication error.

#### Events

Event | Description
ADIEVN_FSK_SEND_DONE | Generated by the ADI service when the send function terminates. The event value field contains one of the following termination conditions: CTAERR_xxx or ADIERR_xxx Function failed. CTA_REASON_FINISHED Buffer submitted was sent in its entirety. CTA_REASON_RELEASED Call terminated. CTA_REASON_STOPPED Stopped by application request.

#### Details

The following DSP file must be loaded to the board before running adiStartSendingFSK:

For these boards... | Load this DSP file...
Bellcore 1200/2200 Hz | V.23 1300/2100 Hz
AG | adsix.m54 | adsix_j.m54
CG | adsix.f54 | adsix_j.f54

See DSP file summary for DSP file descriptions. Refer to the board installation and developer's manual for a table of MIPS usage for all functions.

Use this function to initiate sending frequency shift key (FSK) data. When parms is set to NULL, the default parameter values are used. A typical buffer size is 512 bytes. The buffer size is limited to half the value of the maxbufsize field in the ADI_CONTEXT_INFO structure. The only baud rate supported is 1200.

Call adiStopSendingFSK to stop this function. ADIEVN_FSK_SEND_DONE is delivered when the send operation completes.

For more information, refer to Sending and receiving FSK data.

#### Example

#define MYSEND_STOPPED (-13)
int mySendFSK( CTAHD ctahd, void *buffer, unsigned bufsize )
{
CTA_EVENT event;
if( adiStartSendingFSK( ctahd, buffer, bufsize, NULL ) != SUCCESS )
return MYFAILURE;
do
{
myGetEvent( &event ); /* see ctaWaitEvent example */
} while( event.id !=- ADIEVN_FSK_SEND_DONE );
switch( event.value )
{
case CTA_REASON_FINISHED:
return SUCCESS;
case CTA_REASON_RELEASED:
return MYDISCONNECT;
case CTA_REASON_STOPPED:
/* Send was stopped by another application thread */
return MYSEND_STOPPED;
default:
if( CTA_IS_ERROR( event.value ) )
return MYFAILURE;
}
return MYFAILURE;
}