---
title: handleRxPacket
framework: usbserialdriverkit
role: symbol
role_heading: Instance Method
path: usbserialdriverkit/iouserusbserial/handlerxpacket
---

# handleRxPacket

Processes the data received from the USB device.

## Declaration

```occ
virtual void handleRxPacket(uint8_t * & packet, uint32_t & size);
```

## Parameters

- `packet`: A pointer to a buffer that contains the raw packets received from the device.
- `size`: A pointer to the number of bytes in the packet buffer.

## Discussion

Discussion The system calls this method after it receives raw data from the USB device, and before it moves that data to the read buffer. The default implementation of this method does nothing. You can override it, as needed, to modify the packet data or report any errors.

## See Also

### Transmitting and Receiving Data

- [RxFreeSpaceAvailable](usbserialdriverkit/iouserusbserial/rxfreespaceavailable.md)
- [TxDataAvailable](usbserialdriverkit/iouserusbserial/txdataavailable.md)
- [handleInterruptPacket](usbserialdriverkit/iouserusbserial/handleinterruptpacket.md)
