> ## Documentation Index
> Fetch the complete documentation index at: https://developer.plugchoice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Devices and capabilities

> What Plugchoice can do for a charger, what a phone can do, and how to show a button only where it works.

## Devices

Link and the SDK API name every device as `{ type, id }`. The only type today is `charger`, and `id` is the charger's id in the SDK API. Ignore types you don't know: later SDK releases and API versions may add some, such as meters.

## Capabilities

Every charger from [List chargers](/sdk/api/list-chargers) and [Get a charger](/sdk/api/get-charger) has `capabilities`: what Plugchoice can do for it.

```json theme={null}
"capabilities": {
  "network_setup": { "capable": true, "needs": ["ble"] },
  "electrical_setup": { "capable": true, "needs": [] },
  "reconnect": { "capable": true, "needs": [] }
}
```

| Capability | Action | `capable` when |
| - | - | - |
| `network_setup` | `network` | Link can set up the network of the charger's brand and model |
| `electrical_setup` | `setup` | Plugchoice can apply an electrical setup to the charger's model |
| `reconnect` | `reconnect` | Always |

* `needs` lists what the phone or browser must be able to do for it. It's empty when the capability isn't `capable`.
* More capabilities may be added. Ignore the ones you don't know.
* Capabilities follow the hosted flow: when Link learns a new brand or model, its chargers become capable without a release of your app.

## Transports

`needs` holds **transports**: what the phone or browser must be able to do.

| Transport | What it is |
| - | - |
| `wifi` | Join a charger's own Wi-Fi hotspot |
| `http` | Talk HTTP and WebSocket to a device on the local network |
| `socket` | Talk raw TCP and UDP to a device on the local network |
| `lan` | Find devices on the home network |
| `ble` | Talk to a charger over Bluetooth |

The SDK tells you which ones this phone and your app have, without asking for a permission:

| Platform | Call | Notes |
| - | - | - |
| iOS | `Plugchoice.transports()` | `wifi`, `http`, `socket` always. `lan` when your Info.plist declares a service type in `NSBonjourServices`. `ble` on a device with Bluetooth (not the simulator) when your Info.plist has `NSBluetoothAlwaysUsageDescription`. |
| Android | `Plugchoice.transports(context)` | `http`, `socket`, `lan` always; `wifi` on a device with Wi-Fi. `ble` on a device with Bluetooth when your app kept the SDK's Bluetooth permissions. |
| React Native | `await getTransports()` | As the native platform. Rejects where the SDK isn't in the build, such as Expo Go. |
| A browser | — | None, except `ble` in Chrome and Edge (Web Bluetooth: check `navigator.bluetooth`). |

## Show a button only where it works

Offer an action when the charger is capable of it and the phone has everything it needs:

<CodeGroup>
  ```ts TypeScript theme={null}
  type Capability = { capable: boolean; needs: string[] };

  function isCapableHere(capability: Capability | undefined, transports: string[]): boolean {
    return !!capability?.capable && capability.needs.every((need) => transports.includes(need));
  }

  // Show "Network settings" for this charger?
  const charger = await yourServer.getCharger(chargerId); // from GET /sdk/v1/chargers/{id}
  const showNetworkSettings = isCapableHere(charger.capabilities.network_setup, await getTransports());
  ```

  ```swift Swift theme={null}
  struct Capability: Decodable { let capable: Bool; let needs: [String] }

  func isCapableHere(_ capability: Capability?) -> Bool {
      guard let capability, capability.capable else { return false }
      let transports = Set(Plugchoice.transports())
      return capability.needs.allSatisfy(transports.contains)
  }
  ```

  ```kotlin Kotlin theme={null}
  data class Capability(val capable: Boolean, val needs: List<String>)

  fun isCapableHere(capability: Capability?, context: Context): Boolean {
      if (capability == null || !capability.capable) return false
      val transports = Plugchoice.transports(context)
      return capability.needs.all { it in transports }
  }
  ```
</CodeGroup>

Your server reads `capabilities` with its own credentials and passes them to your app; your app checks the transports. If your app opens an action the charger can't do here anyway, Link shows what it can do instead. See [Actions](/sdk/concepts/actions).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.