Jump to main content

# 1.1.3.4.10 DRV_RF215_TxRequest Function

## C

    DRV_RF215_TX_HANDLE DRV_RF215_TxRequest (
        DRV_HANDLE drvHandle,
        DRV_RF215_TX_REQUEST_OBJ* reqObj,
        DRV_RF215_TX_RESULT* result
    );

## Summary

Allows a client to request data transmission through RF.

## Description

This routine allows a client to request a new data transmission through RF using the RF215 device.

## Precondition

DRV_RF215_Open must have been called to obtain a valid opened driver handle.

## Parameters

Param | Description
--- | ---
drvHandle | A valid open-instance handle, returned from the driver's open routine.
reqObj | Pointer to the object containing TX request parameters.
result | Pointer to result of the TX request.

## Returns

If successful, the routine returns a valid scheduled-transmission handle (a number identifying the transmission request). Once the transmission finishes (successfully or not), it is notified through TX confirm callback.

If an error occurs in the TX request, the return value is DRV_RF215_TX_HANDLE_INVALID. In this case the error type will be reported by the `result` parameter. Error can occur:

- If the number of TX buffer objects allocated through MCC is insufficient
- If the specified driver handle is not valid
- If transmission request parameters are not valid

## Example

    DRV_HANDLE drvRf215Handle; // returned from DRV_RF215_Open
    DRV_RF215_TX_REQUEST_OBJ txReqObj;
    DRV_RF215_TX_RESULT txReqResult;
    DRV_RF215_TX_HANDLE txReqHandle;
    uint8_t psduTx[DRV_RF215_MAX_PSDU_LEN];

    txReqObj.cancelByRx = false;
    txReqObj.ccaMode = PHY_CCA_MODE_3;
    txReqObj.modScheme = FSK_FEC_OFF;
    txReqObj.txPwrAtt = 0;
    txReqObj.psduLen = DRV_RF215_MAX_PSDU_LEN;
    txReqObj.timeMode = TX_TIME_RELATIVE;
    txReqObj.timeCount = 0;
    txReqObj.psdu = psduTx;

    txReqHandle = DRV_RF215_TxRequest(drvRf215Handle, &txReqObj, &txReqResult);
    if (txReqHandle != DRV_RF215_TX_HANDLE_INVALID)
    {
        // TX requested successfully. Result will be notified via TX confirm
    }

## Remarks

The handle returned is valid until the TX confirm routine is called back or canceled by DRV_RF215_TxCancel function.

This is a non-blocking routine.

Rev: G