---
title: setProtocol
framework: hiddriverkit
role: symbol
role_heading: Instance Method
path: hiddriverkit/iouserusbhosthiddevice/setprotocol
---

# setProtocol

Sets the active protocol to use for communicating with the USB device.

## Declaration

```occ
virtual kern_return_t setProtocol(uint16_t protocol);
```

## Parameters

- `protocol`: The protocol to use for the device. Specify 0 to use the boot protocol or 1 to use the report protocol.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

Discussion At startup, the Start method sets the protocol to the report protocol.

## See Also

### Configuring the Device

- [setIdle](hiddriverkit/iouserusbhosthiddevice/setidle.md)
- [setIdlePolicy](hiddriverkit/iouserusbhosthiddevice/setidlepolicy.md)
- [setProperty](hiddriverkit/iouserusbhosthiddevice/setproperty.md)
- [reset](hiddriverkit/iouserusbhosthiddevice/reset.md)
- [USBIdlePolicyType](hiddriverkit/usbidlepolicytype.md)
