Endpunkt-Konfigurationssammlung
Das Endpunkt-Konfigurationssammlungsobjekt repräsentiert eine Sammlung von Endpunkten, für die eine initiale Konfiguration festgelegt werden soll, typischerweise in Gerätemodelkonfigurationsskripten.
Die getEndpoints-Funktion erhält ein Objekt dieses Typs als Parameter, welches es ermöglicht, die Liste der Endpunkte festzulegen, die in einem neu erstellten Gerät enthalten sein sollen, sowie deren grundlegende initiale Konfiguration. Diese Funktion ist im zu erstellenden Gerätemodelskript enthalten.
Methoden
addEndpoint(address, description, endpointType [, endpointSubType]) Die addEndpoint-Methode ermöglicht das Hinzufügen eines neuen Endpunkts zur Sammlung.
Parameter
- address (string): indicates the address of the endpoint within the device. The address must be unique within the device, although endpoints with the same address can exist in different devices.
- description (string): indicates the description to be used for this endpoint.
- endpointType (enum): indicates the type of the endpoint being added. To learn more about endpoint types, see the endpoint-Objektreferenz, insbesondere die endpointType-Eigenschaft.
- endpointSubType (enum, optional): this parameter indicates the endpoint subtype, and can be optionally specified only for certain endpoint types. To learn more about endpoint types and subtypes, see the endpoint-Objektreferenz, insbesondere die endpointSubType-Eigenschaft.
Rückgabewert
Die addEndpoint-Methode gibt ein Endpunkt-Konfigurationsobjekt zurück, welches den Endpunkt repräsentiert, der gerade zur Sammlung hinzugefügt wurde.
Beispiel 1
Dieses Beispiel zeigt, wie 2 Endpunkte innerhalb des Geräts erstellt werden, einer vom Typ Temperatursensor mit der Adresse "1" und ein weiterer vom Typ Kohlendioxidsensor mit der Adresse "2".
function getEndpoints(deviceAddress, endpoints)
{
endpoints.addEndpoint("1", "Temperature sensor", endpointType.TemperatureSensor);
endpoints.addEndpoint("2", "CO2 sensor", endpointType.PpmConcentrationSensor, ppmConcentrationSensorSubType.CarbonDioxide);
}Gerätemodelkonfiguration
Das Gerätemodelkonfigurationsobjekt ermöglicht die Festlegung der Basiskonfiguration für ein Gerätemodell, typischerweise verwendet in Gerätemodelkonfigurationsskripten.
Endpunkt-Konfiguration
Das Endpunkt-Konfigurationsobjekt repräsentiert die initiale Konfiguration eines Endpunkts, typischerweise in Gerätemodell-Konfigurationsskripten. Objekte dieses Typs werden erstellt...