Click or drag to resize
LegacyTelogisServiceListDevices Method
Print this page
Get an array of devices connected to the specified unit (typically a vehicle).

Namespace: Telogis.API
 
Syntax
public Device[] ListDevices(
	long unitId
)

Parameters

unitId
Type: SystemInt64
Unit ID. Only devices associated with this unit will be returned.

Return Value

Type: Device
An arary of Device objects.
Examples
The following code snippets lists all of your Verizon Connect Fleet units, along with a summary of each device associated with each unit and whether the device is connected or not.
C#
/*
    Output snippet:
    Dave's Truck (vCore_G3)
        Verizon Connect VCore is connected
    Josh's Truck (vCore_G3)
        Verizon Connect VCore is connected*/

// get *all* of our units
Unit[] units = myService.FindUnits(null, null);
foreach (Unit u in units) 
{
    // output the unit name and type
    Console.WriteLine("{0} ({1})", u.Name, u.Type);
    // get an array of devices for the unit
    Device[] devices = myService.ListDevices(u.ID); 
    foreach (Device d in devices) 
    {
        Console.WriteLine("\t{0} is {1}", d.Name, d.Connected ? "connected" : "disconnected");
    }
    Console.WriteLine("");
}
See Also