# 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](https://docs.movesdk.com/move-platform/move-services#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
data class MoveDevice(
    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,
)
```

{% 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 isConnected: Bool

    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;
    data: string;
    id: string;
    isConnected?: boolean;
};
```

{% endtab %}

{% tab title="Flutter" %}

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

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

{% endtab %}
{% endtabs %}

<table data-header-hidden><thead><tr><th width="300">MoveDevice</th><th width="95"></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 display name of the device.</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 (since MOVE SDK v2.9.1)</td><td>Boolean</td><td>The connection state of the registered MoveDevice.</td></tr><tr><td>uuid (since MOVE SDK v2.13.0)</td><td>String</td><td>Universally Unique Identifier of a group of beacons.</td></tr><tr><td>major (since MOVE SDK v2.13.0)</td><td>Int</td><td>The subgroup within a UUID.</td></tr><tr><td>minor (since MOVE SDK v2.13.0)</td><td>Int</td><td>Used to identify an individual beacon.</td></tr></tbody></table>

| **MoveDevice related**                                                                                                       |                       |
| ---------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| [Device Discovery Listener](https://docs.movesdk.com/move-platform/sdk/listeners-callbacks#device-discovery-listener)        | Listeners / Callbacks |
| [MoveDevice State Listener](https://docs.movesdk.com/move-platform/sdk/listeners-callbacks#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)
```
