<!--
{
  "availability" : [
    "DriverKit: 19.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "USBSerialDriverKit",
  "identifier" : "/documentation/USBSerialDriverKit/IOUserUSBSerial/handleRxPacket",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "USBSerialDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserUSBSerial@F@handleRxPacket#&*c#&i#"
  },
  "title" : "handleRxPacket"
}
-->

# handleRxPacket

Processes the data received from the USB device.

```
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

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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)