DeviceRepositoryV2.UpdateDeviceMemoryInfo Method

Updates the device memory information.

Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public void UpdateDeviceMemoryInfo(
	Guid deviceId,
	bool resetMemory,
	SimpleCollection<DeviceMemoryInfoChangeV2> deviceMemoryInfoChange
)

Parameters

deviceId  Guid
The device identifier.
resetMemory  Boolean
The device memory was reset before. When set, applying changes from empty memory.
deviceMemoryInfoChange  SimpleCollection<DeviceMemoryInfoChangeV2>
The device memory information change.

Implements

ISimpleClientDeviceRepositoryV2.UpdateDeviceMemoryInfo(Guid, Boolean, SimpleCollection<DeviceMemoryInfoChangeV2>)
Example
The following example illustrates how to update the device memory information by device ID, optionally resetting the memory before applying changes.
C#
using System;
using Gamanet.C4.SDK;
using Gamanet.C4.SimpleInterfaces;

public class Example
{
    static void Main()
    {
        // Create instance of simple client
        var client = new SimpleClient(ConnectorConfiguration.HttpClient);

        ConnectionInfoV1 token;
        // Connect to local server
        var connectionResult = client.Connect(new Uri("https://localhost/"), "Support", "support", out token);

        if (connectionResult != ConnectionResult.Successful)
        {
            Console.WriteLine("Connection unsuccessful, result: {0}", connectionResult);
            return;
        }

        Console.WriteLine("Connection result: {0}", connectionResult);
        Console.WriteLine();

        // You need to have installed the Demo Access Device package from https://my.c4portal.com/plugins/
        var exampleBusCategory = client.EntityDefinitions.Get(Guid.Parse("4810e0c6-9391-490c-a646-ca9643dd1ca5")).Id;
        // Create the Example Device
        var exampleDevice = new SimpleDeviceV1(
            Guid.NewGuid(),
            "BUS",
            EntityRoot.Device,
            exampleBusCategory
        );

        // Create device under device root in db
        client.Devices.Create(exampleDevice);

        // Create a change for Device Memory info
        var change = new DeviceMemoryInfoChangeV2(EntityRoot.Person, "1", DateTime.Now);
        change.CredentialId = SpecialCredential.Unknown;
        var changes = new SimpleCollection<DeviceMemoryInfoChangeV2> { change };

        client.Devices.UpdateDeviceMemoryInfo(exampleDevice.Id, false, changes);

        // Disconnect from server
        client.Disconnect();
    }
}
See Also

Reference

DeviceRepositoryV2 Class
Gamanet.C4.SDK Namespace