# AAR51SDK

<Badge tone="type">UCLASS · AActor</Badge> <Badge>singleton</Badge>

```cpp
UCLASS()
class AR51SDK_API AAR51SDK : public AActor, public ISingleton<AAR51SDK>
```

**Inherits:** [`AActor`](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/AActor) *(Unreal Engine)* · [`ISingleton<AAR51SDK>`](/docs/sdk-api/unreal-api/utilities-platform#isingletont)

The connection entry-point and root actor of the SDK. Place one in the level and configure the OMS connection in the Details panel. On `BeginPlay` it stands up the local gRPC service surface (Anchor, Camera, Draw, Engine, Game, HandSkeleton, Render) on `ServicesPort`, then either discovers OMS on `DiscoveryPort` or connects directly to `OmsIPAddress:OmsRegistrationPort`, and registers the device. On end-of-play it shuts the services down and clears tracked characters, anchors, and hands. Acts as a singleton (one instance per world).

The connection model is **inverted** relative to a typical client SDK: there is no Blueprint `Connect()` call. The Unreal app runs the gRPC **servers**; OMS/CVS call into them. Connection is automatic at `BeginPlay` — you control it entirely through the properties below.

:::tip[How-to]
This page is **reference** (facts only). For the connection workflow, see the [Connection & services guide](/docs/sdk-api/unreal-api/connection).
:::

## Properties

All `EditAnywhere, BlueprintReadWrite`, `Category="General"`.

<div className="apiPropTable">

| Property | Type | Default | Description |
|---|---|---|---|
| **Discovery & registration** | | | |
| `Version` | `FString` | `"1.0.0.0"` | SDK/app version reported to OMS |
| `DiscoveryPort` | `int` | `1500` | UDP discovery port used to locate the OMS |
| `OmsIPAddress` | `FString` | `""` | if non-empty, connect directly to this OMS IP and **skip discovery** |
| `OmsRegistrationPort` | `FString` | `"1501"` | OMS registration endpoint port |
| `ServiceLocalIPAddress` | `FString` | `""` | overrides the auto-detected local IP advertised to OMS |
| `ServicesPort` | `int` | `-1` | port the local device services (gRPC) listen on. `-1` = pick a random free port; a busy explicit value falls back to the nearest free port |
| `IsDiscoveryVerbose` | `bool` | `false` | verbose logging of the discovery handshake |
| `IsDGS` | `bool` | `false` | Dedicated Game Server mode flag (passed to registration) |
| `Platform` | [`EPlatformTypes`](/docs/sdk-api/unreal-api/utilities-platform#eplatformtypes) | `PC` | declared platform/device class reported to OMS |
| `OverrideDeviceId` | `FString` | `""` | force a specific device id instead of the auto-generated one |
| **Debug** | | | |
| `IsOnScreenDebugMessage` | `bool` | `false` | route SDK debug messages to the on-screen display |

</div>

## Method summary

**Static**

| Method | Returns | |
|---|---|---|
| [`Instance`](#instance) | `AAR51SDK*` | <Badge>C++ only</Badge> |

**Instance**

| Method | Returns | |
|---|---|---|
| [`Tick`](#tick) | `void` | <Badge>C++ only</Badge> |
| [`GetRegistration`](#getregistration) | `TSharedPtr<RegistrationClient>` | <Badge>C++ only</Badge> |

:::note
There is **no Blueprint `Connect()` method** on this actor. Connection is automatic at `BeginPlay`; configure it through the [properties](#properties) above. None of this actor's methods are `UFUNCTION`-exposed — they are C++ only.
:::

## Events

This actor declares **no `BlueprintAssignable` events**.

:::caution[⚠️ needs confirmation]
`GetRegistration()` is the only programmatic hook into connection state, and it returns an internal/transport type. There is no documented Blueprint "is connected" property or connection-changed event on this actor — poll or wrap registration state yourself if you need it.
:::

## Method details

### Instance

<ApiBody kind="method" tags="static, C++ only">

```cpp
static AAR51SDK* Instance();   // from ISingleton<AAR51SDK>
```

The single live SDK actor — the usual way to reach the connection root from anywhere.

<Returns type="AAR51SDK*">the singleton actor, or `nullptr` if none is spawned or it was garbage-collected</Returns>

<Example inferred>

```cpp
// Read the configured platform from the in-level SDK actor
if (AAR51SDK* SDK = AAR51SDK::Instance())
{
    const EPlatformTypes Platform = SDK->Platform;
    UE_LOG(LogTemp, Log, TEXT("AR 51 SDK platform = %d"), (int32)Platform);
}
```

</Example>

</ApiBody>

### Tick

<ApiBody kind="method" tags="C++ only">

```cpp
virtual void Tick(float DeltaTime) override;
```

Per-frame pump that drives the SDK's marshalling-to-game-thread queue. Called by the engine; you do not invoke it directly.

<Params>
<Param name="DeltaTime" type="float">seconds since the previous frame</Param>
</Params>

</ApiBody>

### GetRegistration

<ApiBody kind="method" tags="C++ only">

```cpp
TSharedPtr<RegistrationClient> GetRegistration();
```

Returns the live registration client handle — the object managing the OMS handshake and heartbeat.

<Returns type="TSharedPtr<RegistrationClient>">the registration client handle</Returns>

:::caution[⚠️ unverified]
`RegistrationClient` is an internal/transport type, not documented for public use. Treat the return value as an opaque handle; do not depend on its members.
:::

</ApiBody>

## See also

- [`EPlatformTypes`](/docs/sdk-api/unreal-api/utilities-platform#eplatformtypes) — the device-class enum set on `Platform`
- [`UAnchorServiceComponent`](/docs/sdk-api/unreal-api/classes/uanchorservicecomponent) — spatial-anchor / boundary service hosted on this actor
- [Service components](/docs/sdk-api/unreal-api/classes/service-components) — the other device-side services hosted on this actor
- [`USkeletonConsumer`](/docs/sdk-api/unreal-api/classes/skeletonconsumer) — the skeleton-stream entry point used to drive characters once connected
- [Class index](/docs/sdk-api/unreal-api/classes) — all Unreal SDK types
