<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOStateReporter_IVars/handleSetStateID",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOStateReporter_IVars@F@handleSetStateID#k#I#k#"
  },
  "title" : "handleSetStateID"
}
-->

# handleSetStateID

```
virtual IOReturn handleSetStateID(uint64_t channel_id, int state_index, uint64_t state_id);
```

## Parameters

`channel_id`

- ID of channel containing the state in question

`state_index`

- index of state to give an ID: [0..(nstates-1)]

`state_id`

- 64-bit state ID, for ASCII, use IOREPORT_MAKEID

## Return Value

Appropriate IOReturn code

## Discussion

\abstract Assign a non-default ID to a state
\discussion Locked version of IOReporter::setStateID(). This method may be
overriden by sub-classes

Locking: Caller must ensure that the reporter (data) lock is held.

---

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)