# MoveDevice

{% hint style="info" %}
Since MOVE SDK v2.4
{% endhint %}

MoveDevice is used to register / unregister relevant car audio devices and beacons if the optional [BDD - Device Discovery](/move-platform/move-services.md#bdd-device-discovery) feature is configured with setup(...). It is also used when the relevant scan results are delivered to the host app.

{% hint style="warning" %}
Till MOVE SDK v2.12.0: After a .shutdown() the previous registered devices will be unregistered.
{% endhint %}

{% hint style="warning" %}
Since MOVE SDK v2.13.0: The registered Bluetooth devices will be stored in the SDK Backend. After a re-registration / login with the same userId the registered Bluetooth devices are available again.
{% endhint %}

{% tabs %}
{% tab title="Android" %}

```kotlin
class MoveDevice internal constructor(
    val id: String,
    val name: String,
    val manufacturerId: Int? = null,
    val isConnected: Boolean = false,
    val uuid: String? = null,
    val major: Int? = null,
    val minor: Int? = null,
    val state: MoveDeviceState = MoveDeviceState.NOT_SYNCHRONIZED,
    val displayName: String = "",
)
```

{% endtab %}

{% tab title="iOS" %}

<pre class="language-swift"><code class="lang-swift"><strong>public class MoveDevice {
</strong>    public var id: String
    public var name: String
    public var displayName: String
    public var isConnected: Bool
    public var state: MoveDeviceState

    public init(name: String, id: String)
    public init(name: String, proximityUUID: UUID, major: UInt16, minor: UInt16)
    public init(proximityUUID: UUID)
}
</code></pre>

{% endtab %}

{% tab title="React Native" %}

```typescript
export type MoveSdkDevice = {
    name: string;
    displayName: string;
    data: string;
    id: string;
    isConnected?: boolean;
    state?: MoveSdkDeviceState;
};
```

{% endtab %}

{% tab title="Flutter" %}

```dart
import 'package:movesdk/io/dolphin/move/move_device.dart';
```

```dart
class MoveDevice {
  String name;
  String data;
  bool isConnected;
  String displayName;
  MoveDeviceState state;
}
```

{% endtab %}
{% endtabs %}

<table data-header-hidden><thead><tr><th width="270.55859375">MoveDevice</th><th width="162.10546875"></th><th></th></tr></thead><tbody><tr><td><strong>MoveDevice</strong></td><td><strong>Type</strong></td><td></td></tr><tr><td>id</td><td>String</td><td>A device identifier to uniquely identify the device i.e: MAC address. This is used for equality checks. This id is sent to the server during trip device discovery.</td></tr><tr><td>name</td><td>String</td><td>The name of the device.</td></tr><tr><td>displayName</td><td>String</td><td><p><em>Since MOVE SDK 2.17.0</em></p><p>An editable custom name for the device. defaults to name.</p></td></tr><tr><td>manufacturerId <strong>(Android only)</strong></td><td>Integer</td><td>A company identification of the beacon. You can find a list of companies at <a href="https://www.bluetooth.com/specifications/assigned-numbers/">www.bluetooth.com</a>.</td></tr><tr><td>data <strong>(Flutter/React only)</strong></td><td>String</td><td>Opaque data field to convert to native object.</td></tr><tr><td>isConnected</td><td>Boolean</td><td><p><em>Since MOVE SDK v2.9.1</em></p><p>The connection state of the registered MoveDevice. Will be updated via the <a href="/pages/-McyOiBhGHk7b4Lw-4oa#movedevice-state-listener-callback">deviceStateListener</a>.</p></td></tr><tr><td>uuid</td><td>String</td><td><p><em>Since MOVE SDK v2.13.0</em></p><p>Universally Unique Identifier of a group of beacons.</p></td></tr><tr><td>major</td><td>Int</td><td><p><em>Since MOVE SDK v2.13.0</em></p><p>The subgroup within a UUID.</p></td></tr><tr><td>minor</td><td>Int</td><td><p>S<em>ince MOVE SDK v2.13.0</em></p><p>Used to identify an individual beacon.</p></td></tr><tr><td>state</td><td><a href="/pages/XOoLu5IAWBkzdpIhtusd">MoveDeviceState</a></td><td><em>Since MOVE SDK 2.17.0</em><br>A state indicating errors during synchronization of the device with the backend.</td></tr></tbody></table>

| **MoveDevice related**                                                                                         |                       |
| -------------------------------------------------------------------------------------------------------------- | --------------------- |
| [Device Discovery Listener](/move-platform/sdk/models/listeners-callbacks.md#device-discovery-listener)        | Listeners / Callbacks |
| [MoveDevice State Listener](/move-platform/sdk/models/listeners-callbacks.md#movedevice-state-change-listener) | Listeners / Callbacks |

#### Registering all beacons for a Service UUID

To register all beacons for a specific proximity UUID, register a beacon device with empty *major*, *minor*.

For Android you can use code like:

```kotlin
fun createBeacons(uuid: String): MoveDevice {
    return MoveDevice(
        id = uuid,
        name = "Beacons $uuid",
        manufacturerId = null,
        isConnected = false,
        uuid = uuid,
        major = null,
        minor = null,
        ...
    )
    
...

MoveSdk.get()?.registerDevices(
    listOf(
        MoveDevice.createBeacons("B325A5E9-F12E-4E60-869A-36FEC22A225A")
    )
)
```

For react native there is a helper function:

```typescript
MoveSDK.beaconDevices(serviceUUID)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.movesdk.com/move-platform/sdk/models/movedevice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
