Device |
Get device entry points with parents
Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public ISimpleCollection<SimpleDeviceV1> GetEntryPointsWithParents( Guid deviceId )
Parameters
- deviceId Guid
- The device identifier.
Return Value
ISimpleCollection<SimpleDeviceV1>Collection of devices
Implements
ISimpleClientDeviceRepositoryV3.GetEntryPointsWithParents(Guid)Example
The following example illustrates how SimpleClient filter all devices which define access and all its parents
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; var examplePanelCategory = client.EntityDefinitions.Get(Guid.Parse("822caeea-b66b-4f60-ab43-bc14240cb6ec")).Id; var exampleDoorCategory = client.EntityDefinitions.Get(Guid.Parse("dcd0cea7-8de9-4458-afa7-cd1e94b56028")).Id; // Create the Example Device (Bus Controller) var exampleBusController = new SimpleDeviceV1( Guid.NewGuid(), "BUS", EntityRoot.Device, exampleBusCategory ); // Create the Example Device (Panel) var examplePanel = new SimpleDeviceV1( Guid.NewGuid(), "PANEL", exampleBusController.Id, examplePanelCategory ); // Create the Example Device (Door) var exampleDoor = new SimpleDeviceV1( Guid.NewGuid(), "DOOR", examplePanel.Id, exampleDoorCategory ); // Create devices in db client.Devices.Create(exampleBusController); client.Devices.Create(examplePanel); client.Devices.Create(exampleDoor); // Here we get fetch the Entry Point devices and their parents var result = client.Devices.GetEntryPointsWithParents(exampleDoor.Id); foreach(var devices in result) { Console.WriteLine(devices.Name); } // Disconnect from server client.Disconnect(); } }
See Also