@bacnet-js/device
Version:
A TypeScript library for implementing BACnet IP devices in Node.js.
87 lines • 4.78 kB
TypeScript
import { BDObject } from '../generic/object.js';
import { BDArrayProperty, BDPolledArrayProperty, BDPolledSingletProperty, BDSingletProperty } from '../../properties/index.js';
import { ApplicationTag, Segmentation, DeviceStatus } from '@bacnet-js/client';
import { type BDDeviceOpts, type BDDeviceEvents } from './types.js';
import { AsyncEventEmitter } from '../../events.js';
/**
* Implements a BACnet Device object
*
* The Device object is a specialized BACnet object that represents the BACnet device itself.
* It serves as a container for all other BACnet objects and provides device-level properties
* and services. Each BACnet node hosts exactly one Device object.
*
* According to the BACnet specification, the Device object includes standard properties:
* - Object_Identifier (automatically added by BACnetObject)
* - Object_Name (automatically added by BACnetObject)
* - Object_Type (automatically added by BACnetObject)
* - System_Status
* - Vendor_Name
* - Vendor_Identifier
* - Model_Name
* - Firmware_Revision
* - Application_Software_Version
* - Protocol_Version
* - Protocol_Revision
* - Protocol_Services_Supported
* - Protocol_Object_Types_Supported
* - Object_List
* - And other properties related to device capabilities and configuration
*
* @extends BDObject
*/
export declare class BDDevice extends BDObject implements AsyncEventEmitter<BDDeviceEvents> {
#private;
readonly objectList: BDPolledArrayProperty<ApplicationTag.OBJECTIDENTIFIER>;
readonly structuredObjectList: BDPolledArrayProperty<ApplicationTag.OBJECTIDENTIFIER>;
readonly protocolVersion: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly protocolRevision: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly protocolServicesSupported: BDSingletProperty<ApplicationTag.BIT_STRING>;
readonly protocolObjectTypesSupported: BDSingletProperty<ApplicationTag.BIT_STRING>;
readonly activeCovSubscriptions: BDPolledArrayProperty<ApplicationTag.COV_SUBSCRIPTION>;
readonly vendorIdentifier: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly vendorName: BDSingletProperty<ApplicationTag.CHARACTER_STRING>;
readonly modelName: BDSingletProperty<ApplicationTag.CHARACTER_STRING>;
readonly firmwareRevision: BDSingletProperty<ApplicationTag.CHARACTER_STRING>;
readonly applicationSoftwareVersion: BDSingletProperty<ApplicationTag.CHARACTER_STRING>;
readonly databaseRevision: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly deviceAddressBinding: BDArrayProperty<ApplicationTag.NULL>;
readonly location: BDSingletProperty<ApplicationTag.CHARACTER_STRING>;
readonly serialNumber: BDSingletProperty<ApplicationTag.CHARACTER_STRING>;
readonly maxApduLengthAccepted: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly apduTimeout: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly numberOfApduRetries: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly apduSegmentTimeout: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly segmentationSupported: BDSingletProperty<ApplicationTag.ENUMERATED, Segmentation>;
readonly maxSegmentsAccepted: BDSingletProperty<ApplicationTag.UNSIGNED_INTEGER>;
readonly utcOffset: BDPolledSingletProperty<ApplicationTag.SIGNED_INTEGER>;
readonly localDate: BDPolledSingletProperty<ApplicationTag.DATE>;
readonly localTime: BDPolledSingletProperty<ApplicationTag.TIME>;
readonly daylightSavingsStatus: BDPolledSingletProperty<ApplicationTag.BOOLEAN>;
readonly systemStatus: BDSingletProperty<ApplicationTag.ENUMERATED, DeviceStatus>;
/**
* Creates a new BACnet Device object
*
* This constructor initializes a Device object with all required properties
* according to the BACnet specification, including support for basic BACnet
* services and object types.
*
* @param instance - Device instance number (0-4194303). Must be unique on the BACnet network.
* @param opts - Configuration options for this device
*
* @see {@link https://kargs.net/BACnet/Foundations2012-BACnetDeviceID.pdf}
*/
constructor(instance: number, opts: BDDeviceOpts);
/**
* Adds a BACnet object to this device
*
* This method registers a new BACnet object with the device and adds it to the
* device's object list. The object must have a unique identifier (type and instance).
*
* @param object - The BACnet object to add to this device
* @returns The added object
* @throws Error if an object with the same identifier already exists
* @typeParam T - The specific BACnet object type
*/
addObject<T extends BDObject>(object: T): T;
}
//# sourceMappingURL=device.d.ts.map