---
title: Device
summary: The device data associated with a particular User-Agent string.
url: https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/device_detection/class.Device/
---

**Kind:** Class  
**Module:** [device_detection](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/device_detection/)  
**Package:** compute-sdk-cpp 0.7.0  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L13

Include `fastly/device_detection.h` to use this class.

The device data associated with a particular User-Agent string.

## Methods

### brand

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L23

```cpp
std::optional<std::string> fastly::device_detection::Device::brand()
```

The brand of the client device, possibly different from the manufacturer of that device.

**Returns**

`std::optional<std::string>`

### device_name

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L19

```cpp
std::optional<std::string> fastly::device_detection::Device::device_name()
```

The name of the client device.

**Returns**

`std::optional<std::string>`

### hwtype

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L34

```cpp
std::optional<std::string> fastly::device_detection::Device::hwtype()
```

A string representation of the primary client platform hardware. The most commonly used device types are also identified via boolean variables. Because a device may have multiple device types and this variable only has the primary type, we recommend using the boolean variables for logic and using this string representation for logging.

**Returns**

`std::optional<std::string>`

### is_desktop

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L60

```cpp
std::optional<bool> fastly::device_detection::Device::is_desktop()
```

The client is a desktop web browser.

**Returns**

`std::optional<bool>`

### is_ereader

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L37

```cpp
std::optional<bool> fastly::device_detection::Device::is_ereader()
```

The client device is a reading device (like a Kindle).

**Returns**

`std::optional<bool>`

### is_gameconsole

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L40

```cpp
std::optional<bool> fastly::device_detection::Device::is_gameconsole()
```

The client device is a video game console (like a PlayStation or Xbox).

**Returns**

`std::optional<bool>`

### is_mediaplayer

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L44

```cpp
std::optional<bool> fastly::device_detection::Device::is_mediaplayer()
```

The client device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo).

**Returns**

`std::optional<bool>`

### is_mobile

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L47

```cpp
std::optional<bool> fastly::device_detection::Device::is_mobile()
```

The client device is a mobile phone.

**Returns**

`std::optional<bool>`

### is_smarttv

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L50

```cpp
std::optional<bool> fastly::device_detection::Device::is_smarttv()
```

The client device is a smart TV.

**Returns**

`std::optional<bool>`

### is_tablet

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L53

```cpp
std::optional<bool> fastly::device_detection::Device::is_tablet()
```

The client device is a tablet (like an iPad).

**Returns**

`std::optional<bool>`

### is_touchscreen

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L63

```cpp
std::optional<bool> fastly::device_detection::Device::is_touchscreen()
```

The client device's screen is touch sensitive.

**Returns**

`std::optional<bool>`

### is_tvplayer

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L57

```cpp
std::optional<bool> fastly::device_detection::Device::is_tvplayer()
```

The client device is a set-top box or other TV player (like a Roku or Apple TV).

**Returns**

`std::optional<bool>`

### model

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L26

```cpp
std::optional<std::string> fastly::device_detection::Device::model()
```

The model of the client device.

**Returns**

`std::optional<std::string>`
