BLEMeshJS
API

Utils Package

Shared identifiers, storage abstractions, enums, message helpers, and low-level support types.

This page is auto-generated from packages/utils/src/** and the public exports exposed by @blemeshjs/utils.

Update TSDoc comments in source, then run yarn workspace docs api:generate. Normal docs dev, build, and types:check runs regenerate these pages automatically.

Package overview

FieldValue
Package@blemeshjs/utils
Entry pointpackages/utils/src/index.ts
Source treepackages/utils/src/**

Export map

ExportKindSummary
AccessErrorClassA set of errors originating from the access layer.
AcknowledgedConfigMessageClassA base protocol for acknowledged Configuration messages. Acknowledged messages will be responded with a status message.
AcknowledgedMeshMessageClassThe base class for acknowledged messages. An acknowledged message is transmitted and acknowledged by each receiving element by responding to that message. The response is typically a status message. If a response is not received within an arbitrary time period, the message will be retransmitted automatically until the timeout occurs. Acknowledged messages are expected to be replied with a status message with a message of type set as AcknowledgedMeshMessage.responseOpCode. Access Layer timer will wait for NetworkParameters.acknowledgmentMessageTimeout seconds before throwing a timeout.
AcknowledgedProxyConfigurationMessageClassA base class for acknowledged proxy configuration messages. An acknowledged message is transmitted and acknowledged by each receiving element by responding to that message. The response is typically a status message. If a response is not received within an arbitrary time period, the message will be retransmitted automatically until the timeout occurs.
AddressClassBluetooth Mesh address type. Type alias for UInt16. In Bluetooth mesh addresses are divided into several categories: - Unassigned Address - address 0x0000. - Unicast Addresses - a unique address of an Element. - Group Address - a group address allows sending messages to multiple receivers. - Virtual Group Address - each virtual address is a hash of a Virtual Label (UUID). - Fixed Group Addresses - set of predefined group addresses.
AlgorithmUnknownNo description yet.
assertArrayFunctionNo description yet.
assertBooleanFunctionNo description yet.
assertDirectInstanceOfFunctionNo description yet.
assertEnumCaseFunctionNo description yet.
AssertionTypeDescriptionType aliasNo description yet.
assertNumberFunctionNo description yet.
assertObjectFunctionNo description yet.
assertStringFunctionNo description yet.
AttentionTimerHandlerClassAn Attention Timer Handler is used to notify the app about the Attention Timer state. The Attention Timer is used to attract the user's attention to the device. It may only be started and stopped by sending a HealthAttentionSet or HealthAttentionSetUnacknowledged message to the main Element of the local Node.
BackgroundTimerClassNo description yet.
BaseMeshMessageClassThe base interface of every mesh message. Mesh messages can be sent to and received from a mesh network.
BigUIntClassNo description yet.
BindableTinyEmitterClassNo description yet.
bitArrayToUint8ArrayFunctionNo description yet.
BleErrorClassNo description yet.
calculateHMAC_SHA256FunctionNo description yet.
calculateSharedSecretFunctionNo description yet.
CancellationErrorClassNo description yet.
CBCentralManagerClassAbstract class representing a Bluetooth Central Manager. Subclasses must implement scanning, connection, and state management logic.
CBCentralManagerHandlerClassAbstract base class representing the handler of a central Bluetooth manager. Use this class to respond to central manager events such as state updates and peripheral discovery.
CBCentralManagerStateEnumerationNo description yet.
CBCharacteristicClassNo description yet.
CBCharacteristicPropertiesEnumerationNo description yet.
CBCharacteristicWriteTypeEnumerationNo description yet.
CBPeripheralClassNo description yet.
CBPeripheralHandlerClassAbstract base class representing the handler of a Bluetooth peripheral. Use this class to respond to events such as service discovery and characteristic updates.
CBPeripheralStateEnumerationNo description yet.
CBServiceClassNo description yet.
CBUUIDClassRepresents a Core Bluetooth UUID. Can be constructed from a string, number, or Uint8Array. Provides utility methods for comparison and string representation.
chunkedMapFunctionNo description yet.
ClassType aliasMatches a class.
ClosedRangeClassNo description yet.
CompanyIdentifierUnknownSource: https://www.bluetooth.com/specifications/assigned-numbers/ Last update date: 7 June 2023
ConfigAnyModelMessageClassA base protocol for config messages related to Models, where the Model can be a vendor model.
ConfigAppKeyMessageClassA base protocol for config messages related to Application Keys.
ConfigElementMessageClassA base protocol for config messages related to Elements.
ConfigMessageClassA base protocol for all Configuration messages. Configuration messages are used to configure Nodes. They are sent between Configuration Client model on the Configuration Manager and Configuration Server model on the device, which is being configured. All Config messages are encrypted using target Node's Device Key.
ConfigMessageStatusUnknownNo description yet.
ConfigModelMessageClassA base protocol for config messages related to Models.
ConfigNetAndAppKeyMessageClassA base protocol for config messages related to Network Key and Application Key.
ConfigNetKeyMessageClassA base protocol for config messages related to Network Keys.
ConfigResponseClassThe base class for response messages.
ConfigStatusMessageClassA base protocol for config status messages.
DataType aliasNo description yet.
dataViewToUint8ArrayFunctionNo description yet.
DecodingErrorClassNo description yet.
decryptAesCcmFunctionNo description yet.
DispatchQueueClassNo description yet.
DoubleType aliasRepresents a 64-bit IEEE‑754 double-precision floating-point (the same as JavaScript's built-in number type).
encryptAesCcmFunctionNo description yet.
encryptAesEcbFunctionNo description yet.
ExportConfigurationEnumerationconfiguration allows to narrow down the exported configuration to a required minimum. When sharing a mesh network configuration a care must be taken not to share sensitive information to prevent unauthorized use. When sharing a configuration with a guest, a separate Network Key and set of Application Keys should be created. The Nodes given to the guest under control should be configured to use the keys. The guest can be given only the part of the network related to the guest Network Key, with all other data excluded. Also, to prevent reconfiguration of the Nodes, only partial Nodes configuration can be shared, which excludes the Device Keys of those Nodes.
FailureClassNo description yet.
generateElGamalKeyPairFunctionNo description yet.
getEnumKeysFunctionNo description yet.
getEnumValuesFunctionNo description yet.
getSecureRandomBytesFunctionNo description yet.
HeartbeatSubscriptionClassNo description yet.
HexType aliasRepresents a hexadecimal string (e.g., color codes, hashes).
hexToUuidFunctionNo description yet.
importKeyFromPrivateFunctionNo description yet.
Int16Type aliasRepresents a signed 16-bit integer.
Int32Type aliasRepresents a signed 32-bit integer.
Int64Type aliasRepresents a signed 64-bit integer using Long.
Int8Type aliasRepresents a signed 8-bit integer.
isArrayFunctionNo description yet.
isDirectInstanceOfFunctionNo description yet.
isEnumCaseFunctionNo description yet.
isFunctionFunctionNo description yet.
isNullFunctionNo description yet.
isNumberFunctionNo description yet.
isObjectFunctionNo description yet.
isValidUuidFunctionNo description yet.
IvIndexClassNo description yet.
KeyClassBase protocol for Network and Application Keys.
KeyIndexClassThe key index is a 12-bit unsigned integer identifying a Network or an Application Key. The key indexes within Network Keys and Application Keys must be distinct. This type is an alias for UInt16. To check the range, use isValidKeyIndex.
KeyRefreshPhaseUnknownSafely parses numeric input into a KeyRefreshPhase.
KeySetClassNo description yet.
LocalProvisionerUuidKeyVariableThe key used in UserDefaults to store the UUID of the local Provisioner for each loaded mesh network. The intent is to restore the same instance (move to index 0) whenever the same mesh network configuration is imported. Local Provisioner UUID is saved whenever a new Provisioner is added or moved to index 0 in the MeshNetwork.provisioners array in mesh network object. Use MeshNetwork.restoreLocalProvisioner() to restore the Provisioner instance.
LocationUnknownNo description yet.
LogCategoryEnumerationThe log category indicates the component that created the log entry.
LoggerHandlerClassNo description yet.
LogLevelClassLog level, which allows filtering logs by importance.
longMinFunctionNo description yet.
MeshCDBUnknownA namespace for Mesh Configuration Database Zod schemas. This provides a clean, organized, and properly typed structure for validation.
MeshMessageClassThe base class of every mesh message. Mesh messages can be sent to and received from the mesh network. For messages with the Op Code known during compilation a StaticMeshMessage protocol should be preferred. Parameters MeshMessage.security and MeshMessage.isSegmented are checked and should be set only for outgoing messages.
MeshMessageSecurityEnumerationThe mesh message security enum determines authentication level which shall be used when encrypting a segmented mesh message. This filed is used to determine the TransMIC. The Message Integrity Check for Transport (TransMIC) is a 32-bit or 64-bit field that authenticates that the Access payload has not been changed. For a segmented message, where SEG is set to 1, the size of the TransMIC is determined by the value of the SZMIC field in the Lower Transport PDU. For unsegmented messages, the size of the TransMIC is 32 bits for data messages. Control messages do not have a TransMIC.
MeshNetworkErrorClassA set of generic mesh errors.
MeshProvisioningServiceClassA structure defining Mesh Provisioning service, which shall be present on unprovisioned devices. It allows sending provisioning messages. When provisioning is complete, the service shall be replaced with Mesh Proxy service.
MeshProxyServiceClassA structure defining Mesh Proxy service, which shall be present on provisioned Nodes. The Mesh Proxy service is used to send mesh messages over GATT.
MeshResponseClassThe base class for response messages.
MeshServiceClassA base class for mesh service objects.
meshTimestampFunctionNo description yet.
NSNullType aliasUnique symbol used to represent a special "null" value within the namespace. Useful for distinguishing between JavaScript's native null and a custom sentinel value.
OobInformationClassInformation that points to Out-Of-Band (OOB) information needed for provisioning.
OptionSetClassNo description yet.
packInt16BEFunctionNo description yet.
packInt16LEFunctionNo description yet.
packInt32BEFunctionNo description yet.
packInt32LEFunctionNo description yet.
packUInt16BEFunctionNo description yet.
packUInt16LEFunctionNo description yet.
packUInt32BEFunctionNo description yet.
packUInt32LEFunctionNo description yet.
ProxyConfigurationMessageClassA base class for Proxy configuration messages.
ProxyFilterEventHandlerInterfaceNo description yet.
ProxyFilterHandlerClassThe delegate that will be notified about changes of the Proxy Filter.
ProxyFilterSetupUnknownNo description yet.
ProxyFilterSetupTypeEnumerationAn enumeration for different initial configurations of the Proxy Filter.
ProxyFilterTypeUnknownNo description yet.
RangeObjectClassA base class for an address or scene range. Ranges are assigned to Provisioner objects. Each Provisioner may provision new Nodes, create Groups and Scenes using only values from assigned ranges. The assigned ranges may not overlap with the ranges of other Provisioners, otherwise different instances could reuse the same values leading to collisions.
readUInt16BEFunctionNo description yet.
readUInt16LEFunctionNo description yet.
readUInt32BEFunctionNo description yet.
readUInt32LEFunctionNo description yet.
ResultType aliasNo description yet.
SceneNumberClassScene number enum type.
SigModelIdEnumerationNo description yet.
StaticAcknowledgedMeshMessageClassA base class for acknowledged messages which opcode and the type of the response message are known during compilation time. The message must have the StaticAcknowledgedMeshMessage/responseType specified.
StaticAcknowledgedProxyConfigurationMessageClassA base class static acknowledged proxy configuration messages.
StaticMeshMessageClassA type of a mesh message which opcode is known during compilation time.
StaticMeshResponseClassThe base class for response messages with an opcode known at the compilation time.
StaticProxyConfigurationMessageClassA type of Proxy Configuration message which opcode is known during compilation time.
StaticUnacknowledgedMeshMessageClassThe base class for unacknowledged messages with an opcode known at the compilation time.
StatusMessageClassA mesh message containing the operation status.
StepResolutionUnknownNo description yet.
StorageClassAbstract base class for storage engines. Subclasses must implement the core storage methods: get, set, remove, and clear. This class defines the contract for key-value storage with asynchronous access.
SuccessClassNo description yet.
TaskClassNo description yet.
TimeIntervalType aliasDouble
timeIntervalSinceNowFunctionNo description yet.
toPaddedHex16FunctionNo description yet.
toPaddedHex32FunctionNo description yet.
toPaddedHex64FunctionNo description yet.
toPaddedHex64SignedFunctionNo description yet.
toPaddedHex8FunctionNo description yet.
TransactionMessageClassA message with Transaction Identifier. The Transaction Identifier will automatically be set and incremented each time a message is sent. The counter is reused for all types that extend this protocol.
TransitionMessageClassA base protocol for a message that can initiate a non-immediate state transition.
TransitionStatusMessageClassA base protocol for messages sent as responses to TransitionMessages.
TransitionTimeClassThis structure represents a time needed to transition from one state to another, for example dimming a light. Internally, it uses steps and step resolution. Thanks to that only some time intervals are possible. Use TransitionTime/interval to get exact time
TransportClassAbstract base class for transport implementations. Provides a static method to retrieve the advertisement data service data key.
tryOptionalAsyncFunctionNo description yet.
typeOfFunctionNo description yet.
UInt16Type aliasRepresents an unsigned 16-bit integer.
UInt32Type aliasRepresents an unsigned 32-bit integer.
UInt64Type aliasRepresents an unsigned 64-bit integer using bigint.
UInt8Type aliasRepresents an unsigned 8-bit integer.
UnacknowledgedConfigMessageClassA base protocol for unacknowledged Configuration messages. Unacknowledged configuration messages are sent as replies to acknowledged messages.
UnacknowledgedMeshMessageClassThe base class for unacknowledged messages.
unpackInt16BEFunctionNo description yet.
unpackInt16LEFunctionNo description yet.
unpackInt32BEFunctionNo description yet.
unpackInt32LEFunctionNo description yet.
unpackUInt16BEFunctionNo description yet.
unpackUInt16LEFunctionNo description yet.
unpackUInt32BEFunctionNo description yet.
unpackUInt32LEFunctionNo description yet.
UserDefaultsClassNo description yet.
UUIDClassRepresents a universally unique identifier (UUID) with Swift-like API
uuidToHexFunctionNo description yet.
uuidToUint8ArrayFunctionNo description yet.
writeInt16BEFunctionNo description yet.
writeInt16LEFunctionNo description yet.
writeInt32BEFunctionNo description yet.
writeInt32LEFunctionNo description yet.
writeUInt16BEFunctionNo description yet.
writeUInt16LEFunctionNo description yet.
writeUInt32BEFunctionNo description yet.
writeUInt32LEFunctionNo description yet.
xorUint8ArraysFunctionNo description yet.

Exported API

AccessError

Kind: Class

Source: packages/utils/src/constants/access-error.ts#L4

A set of errors originating from the access layer.

class AccessError extends Error

Properties

NameTypeDescription
messagestringNo description yet.
namestringNo description yet.
stackstringNo description yet.
busyAccessErrorError thrown when trying to send a message to an address for which another message is already being sent.
cancelledAccessErrorThrown when sending the message was cancelled.
cannotDeleteAccessErrorError thrown when the Provisioner is trying to delete the last Network Key from the Node, or a key that is used to secure the message.
cannotRelayAccessErrorThrown when a message is sent that is encrypted with a Network Key that is not known to the connected GATT Proxy, or no GATT Proxy is connected.
invalidDestinationAccessErrorThrown when the destination Address is not known and the library cannot determine the Network Key to use.
invalidElementAccessErrorThrown when trying to send a message using an Element that does not belong to the local Provisioner's Node.
invalidKeyAccessErrorThrown when the target Node cannot decrypt messages sent with the given key.
invalidSourceAccessErrorError thrown when the local Provisioner does not have a Unicast Address specified and is not able to send requested message.
invalidTtlAccessErrorThrown when the given TTL is not valid. Valid TTL must be 0 or in range 2...127.
modelNotBoundToAppKeyAccessErrorThrown when trying to send a message from a Model that does not have any Application Key bound to it.
noDeviceKeyAccessErrorThrown when trying to send a config message to a Node of which the Device Key is not known.
stackTraceLimitnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
timeoutAccessErrorThrown, when the acknowledgment has not been received until the time run out.

Methods

NameSignatureDescription
captureStackTracecaptureStackTrace(targetObject: object, constructorOpt?: Function): void;No description yet.
prepareStackTraceprepareStackTrace(err: Error, stackTraces: CallSite[]): any;No description yet.

AcknowledgedConfigMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L256

A base protocol for acknowledged Configuration messages. Acknowledged messages will be responded with a status message.

class AcknowledgedConfigMessage extends ConfigMessage<this> & StaticAcknowledgedMeshMessage<this>

Constructors

NameSignatureDescription
constructorAcknowledgedConfigMessage(): AcknowledgedConfigMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
responseTypePick<typeof StaticMeshResponse, "fromData" | "opCode">The Type of the response message.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
responseOpCodeunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

AcknowledgedMeshMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L100

The base class for acknowledged messages. An acknowledged message is transmitted and acknowledged by each receiving element by responding to that message. The response is typically a status message. If a response is not received within an arbitrary time period, the message will be retransmitted automatically until the timeout occurs. Acknowledged messages are expected to be replied with a status message with a message of type set as AcknowledgedMeshMessage.responseOpCode. Access Layer timer will wait for NetworkParameters.acknowledgmentMessageTimeout seconds before throwing a timeout.

class AcknowledgedMeshMessage extends MeshMessage

Constructors

NameSignatureDescription
constructorAcknowledgedMeshMessage(): AcknowledgedMeshMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
responseOpCodeunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

AcknowledgedProxyConfigurationMessage

Kind: Class

Source: packages/utils/src/mesh-messages/proxy-configuration-message.ts#L34

A base class for acknowledged proxy configuration messages. An acknowledged message is transmitted and acknowledged by each receiving element by responding to that message. The response is typically a status message. If a response is not received within an arbitrary time period, the message will be retransmitted automatically until the timeout occurs.

class AcknowledgedProxyConfigurationMessage extends ProxyConfigurationMessage

Constructors

NameSignatureDescription
constructorAcknowledgedProxyConfigurationMessage(): AcknowledgedProxyConfigurationMessage;No description yet.

Properties

NameTypeDescription
opCodeunknownNo description yet.
parametersunknownNo description yet.
responseOpCodeunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

Address

Kind: Class

Source: packages/utils/src/constants/address.ts#L14

Bluetooth Mesh address type. Type alias for UInt16. In Bluetooth mesh addresses are divided into several categories: - Unassigned Address - address 0x0000. - Unicast Addresses - a unique address of an Element. - Group Address - a group address allows sending messages to multiple receivers. - Virtual Group Address - each virtual address is a hash of a Virtual Label (UUID). - Fixed Group Addresses - set of predefined group addresses.

class Address extends Number

Constructors

NameSignatureDescription
constructorAddress(value: number): Address;No description yet.

Properties

NameTypeDescription
allFriendsAddressA message sent to the all-friends address will be processed by the Primary Element of all nodes that have the friend functionality enabled. That means, that Models on the Primary Element of all the Nodes are automatically subscribed to all-friends address if the Node has Friend functionality enabled. Models on the Primary and other Elements of a Node may subscribe to this address to receive messages no matter what the feature state is.
allNodesAddressA message sent to the all-nodes address will be processed by the Primary Element of all nodes. That means, that all Models on the Primary Element of all the Nodes are automatically subscribed to all-nodes address. It is not possible for Models on other Elements to receive messages sent to All Nodes address, as they cannot subscribe to this address.
allProxiesAddressA message sent to the all-proxies address will be processed by the Primary Element of all nodes that have the friend functionality enabled. That means, that Models on the Primary Element of all the Nodes are automatically subscribed to all-proxies address if the Node has Proxy functionality enabled. Models on the Primary and other Elements of a Node may subscribe to this address to receive messages no matter what the feature state is.
allRelaysAddressA message sent to the all-relays address will be processed by the Primary Element of all nodes that have the relay functionality enabled. That means, that Models on the Primary Element of all the Nodes are automatically subscribed to all-relays address if the Node has Relay functionality enabled. Models on the Primary and other Elements of a Node may subscribe to this address to receive messages no matter what the feature state is.
EPSILONnumberThe value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately: 2.2204460492503130808472633361816 x 10‍−‍16.
MAX_SAFE_INTEGERnumberThe value of the largest integer n such that n and n + 1 are both exactly representable as a Number value. The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
MAX_VALUEnumberThe largest number that can be represented in JavaScript. Equal to approximately 1.79E+308.
maxGroupAddressAddressNo description yet.
maxUnicastAddressAddressNo description yet.
maxVirtualAddressAddressNo description yet.
MIN_SAFE_INTEGERnumberThe value of the smallest integer n such that n and n − 1 are both exactly representable as a Number value. The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
MIN_VALUEnumberThe closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324.
minGroupAddressAddressNo description yet.
minUnicastAddressAddressNo description yet.
minVirtualAddressAddressNo description yet.
NaNnumberA value that is not a number. In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
NEGATIVE_INFINITYnumberA value that is less than the largest negative number that can be represented in JavaScript. JavaScript displays NEGATIVE_INFINITY values as -infinity.
POSITIVE_INFINITYnumberA value greater than the largest number that can be represented in JavaScript. JavaScript displays POSITIVE_INFINITY values as infinity.
unassignedAddressAddressNo description yet.
bytesunknownNo description yet.
bytesBEunknownNo description yet.
decunknownNo description yet.
hexunknownNo description yet.
isGroupunknownNo description yet.
isSpecialGroupunknownNo description yet.
isUnassignedunknownNo description yet.
isUnicastunknownNo description yet.
isValidAddressunknownNo description yet.
isVirtualunknownNo description yet.

Methods

NameSignatureDescription
equalequal(other: Address): boolean;No description yet.
toExponentialtoExponential(fractionDigits?: number): string;No description yet.
toFixedtoFixed(fractionDigits?: number): string;No description yet.
toLocaleStringtoLocaleString(locales?: string | string[], options?: NumberFormatOptions): string;No description yet.
toPrecisiontoPrecision(precision?: number): string;No description yet.
toStringtoString(radix?: number): string;No description yet.
valueOfvalueOf(): number;No description yet.
fromHexfromHex(hex: string): Address | undefined;No description yet.
isFiniteisFinite(number: unknown): boolean;No description yet.
isIntegerisInteger(number: unknown): boolean;No description yet.
isNaNisNaN(number: unknown): boolean;No description yet.
isSafeIntegerisSafeInteger(number: unknown): boolean;No description yet.
parseFloatparseFloat(string: string): number;No description yet.
parseIntparseInt(string: string, radix?: number): number;No description yet.

Algorithm

Kind: Unknown

Source: packages/utils/src/enums/algorithm.ts#L5

assertArray

Kind: Function

Source: packages/utils/src/helpers/common.ts#L196

function assertArray<T>(value: unknown, assertion?: (element: unknown, message?: string) => asserts element is T, message?: string): asserts value is T[];

assertBoolean

Kind: Function

Source: packages/utils/src/helpers/common.ts#L255

function assertBoolean(value: unknown, message?: string): asserts value is boolean;

assertDirectInstanceOf

Kind: Function

Source: packages/utils/src/helpers/common.ts#L235

function assertDirectInstanceOf<T>(instance: unknown, class_: Class<T>, message?: string): asserts instance is T;

assertEnumCase

Kind: Function

Source: packages/utils/src/helpers/common.ts#L245

function assertEnumCase<T>(value: unknown, targetEnum: T, message?: string): asserts value is T[keyof T];

AssertionTypeDescription

Kind: Type alias

Source: packages/utils/src/helpers/common.ts#L155

type AssertionTypeDescription = typeof _assertionTypeDescriptions[number];

assertNumber

Kind: Function

Source: packages/utils/src/helpers/common.ts#L171

function assertNumber(value: unknown, message?: string): asserts value is number;

assertObject

Kind: Function

Source: packages/utils/src/helpers/common.ts#L221

function assertObject(value: unknown, message?: string): asserts value is object;

assertString

Kind: Function

Source: packages/utils/src/helpers/common.ts#L161

function assertString(value: unknown, message?: string): asserts value is string;

AttentionTimerHandler

Kind: Class

Source: packages/utils/src/types/attention-timeout-handler.ts#L12

An Attention Timer Handler is used to notify the app about the Attention Timer state. The Attention Timer is used to attract the user's attention to the device. It may only be started and stopped by sending a HealthAttentionSet or HealthAttentionSetUnacknowledged message to the main Element of the local Node.

class AttentionTimerHandler

Constructors

NameSignatureDescription
constructorAttentionTimerHandler(): AttentionTimerHandler;No description yet.

Methods

NameSignatureDescription
attentionTimerDidStartattentionTimerDidStart(duration: number): void;No description yet.
attentionTimerDidStopattentionTimerDidStop(): void;No description yet.

BackgroundTimer

Kind: Class

Source: packages/utils/src/types/background-timer.ts#L7

class BackgroundTimer

Constructors

NameSignatureDescription
constructorBackgroundTimer(interval: number, repeats: boolean, callback: TimerCallback, queue: DispatchQueue): BackgroundTimer;No description yet.

Properties

NameTypeDescription
intervalnumberNo description yet.
repeatsbooleanNo description yet.
remainingTimeunknownNo description yet.

Methods

NameSignatureDescription
invalidateinvalidate(): void;No description yet.
scheduledTimerscheduledTimer(interval: number, repeats: boolean, callback: TimerCallback, queue: DispatchQueue): BackgroundTimer;No description yet.

BaseMeshMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L9

The base interface of every mesh message. Mesh messages can be sent to and received from a mesh network.

class BaseMeshMessage

Constructors

NameSignatureDescription
constructorBaseMeshMessage(): BaseMeshMessage;No description yet.

Properties

NameTypeDescription
parametersunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

BigUInt

Kind: Class

Source: packages/utils/src/types/big-uint.ts#L1

class BigUInt

Constructors

NameSignatureDescription
constructorBigUInt(decimalString: string): BigUInt;No description yet.

Properties

NameTypeDescription
maxBytes14No description yet.
maxDecimalDigits32No description yet.

Methods

NameSignatureDescription
toBytestoBytes(sizeInBytes: number): Uint8Array<ArrayBufferLike> | undefined;No description yet.
toDecimalStringtoDecimalString(): string;No description yet.
toStringtoString(): string;No description yet.
randomrandom(length: number): BigUInt | undefined;No description yet.

BindableTinyEmitter

Kind: Class

Source: packages/utils/src/types/emitter.ts#L1

class BindableTinyEmitter<E>

Constructors

NameSignatureDescription
constructorBindableTinyEmitter<E>(): BindableTinyEmitter<E>;No description yet.

Methods

NameSignatureDescription
bindAllEventsbindAllEvents(handler: Partial<E>): () => void;No description yet.
emitemit<K>(event: K, args: Parameters<E[K]>): void;No description yet.
offoff<K>(event: K, fn?: E[K]): void;No description yet.
onon<K>(event: K, fn: E[K]): () => void;No description yet.
unbindAllEventsunbindAllEvents(handler: Partial<E>): void;No description yet.

bitArrayToUint8Array

Kind: Function

Source: packages/utils/src/helpers/data.ts#L4

function bitArrayToUint8Array(signedInts: BitArray): Uint8Array;

BleError

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L407

class BleError extends Error

Constructors

NameSignatureDescription
constructorBleError(code: number, message: string): BleError;No description yet.

Properties

NameTypeDescription
codenumberNo description yet.
messagestringNo description yet.
namestringNo description yet.
stackstringNo description yet.
stackTraceLimitnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Methods

NameSignatureDescription
captureStackTracecaptureStackTrace(targetObject: object, constructorOpt?: Function): void;No description yet.
prepareStackTraceprepareStackTrace(err: Error, stackTraces: CallSite[]): any;No description yet.

calculateHMAC_SHA256

Kind: Function

Source: packages/utils/src/helpers/crypto.ts#L123

function calculateHMAC_SHA256(key: Uint8Array, data: Uint8Array): Uint8Array;

calculateSharedSecret

Kind: Function

Source: packages/utils/src/helpers/crypto.ts#L102

function calculateSharedSecret(privateKeyHex: string, publicKeyHex: string): string;

CancellationError

Kind: Class

Source: packages/utils/src/constants/errors.ts#L1

class CancellationError extends Error

Constructors

NameSignatureDescription
constructorCancellationError(message: string): CancellationError;No description yet.

Properties

NameTypeDescription
messagestringNo description yet.
namestringNo description yet.
stackstringNo description yet.
stackTraceLimitnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Methods

NameSignatureDescription
captureStackTracecaptureStackTrace(targetObject: object, constructorOpt?: Function): void;No description yet.
prepareStackTraceprepareStackTrace(err: Error, stackTraces: CallSite[]): any;No description yet.

CBCentralManager

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L367

Abstract class representing a Bluetooth Central Manager. Subclasses must implement scanning, connection, and state management logic.

class CBCentralManager extends BindableTinyEmitter<CBCentralManagerHandler>

Constructors

NameSignatureDescription
constructorCBCentralManager(): CBCentralManager;No description yet.

Properties

NameTypeDescription
stateCBCentralManagerStateNo description yet.

Methods

NameSignatureDescription
bindAllEventsbindAllEvents(handler: Partial<E>): () => void;No description yet.
cancelPeripheralConnectioncancelPeripheralConnection(peripheral: CBPeripheral): Promise<void>;No description yet.
connectconnect(peripheral: CBPeripheral): Promise<void>;No description yet.
emitemit<K>(event: K, args: Parameters<CBCentralManagerHandler[K]>): void;No description yet.
getStategetState(): CBCentralManagerState;No description yet.
offoff<K>(event: K, fn?: CBCentralManagerHandler[K]): void;No description yet.
onon<K>(event: K, fn: CBCentralManagerHandler[K]): () => void;No description yet.
retrieveConnectedPeripheralsretrieveConnectedPeripherals(serviceUUIDs?: string[]): CBPeripheral[];No description yet.
retrievePeripheralsretrievePeripherals(identifiers: UUID[]): CBPeripheral[];No description yet.
scanForPeripheralsscanForPeripherals(serviceUUIDs?: string[]): Promise<void>;No description yet.
stopScanstopScan(): Promise<void>;No description yet.
unbindAllEventsunbindAllEvents(handler: Partial<E>): void;No description yet.

CBCentralManagerHandler

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L292

Abstract base class representing the handler of a central Bluetooth manager. Use this class to respond to central manager events such as state updates and peripheral discovery.

class CBCentralManagerHandler

Constructors

NameSignatureDescription
constructorCBCentralManagerHandler(): CBCentralManagerHandler;No description yet.

Methods

NameSignatureDescription
centralManagerDidConnectcentralManagerDidConnect(central: CBCentralManager, peripheral: CBPeripheral): void;No description yet.
centralManagerDidDisconnectPeripheralcentralManagerDidDisconnectPeripheral(central: CBCentralManager, peripheral: CBPeripheral, error?: Error): void;No description yet.
centralManagerDidDiscoverPeripheralcentralManagerDidDiscoverPeripheral(central: CBCentralManager, peripheral: CBPeripheral, rssi?: number, advertisementData?: Record<string, unknown>): void;No description yet.
centralManagerDidFailConnectcentralManagerDidFailConnect(central: CBCentralManager, peripheral: CBPeripheral, error: Error): void;No description yet.
centralManagerDidUpdateStatecentralManagerDidUpdateState(central: CBCentralManager, state: CBCentralManagerState): void;No description yet.

CBCentralManagerState

Kind: Enumeration

Source: packages/utils/src/constants/mesh-constants.ts#L354

enum CBCentralManagerState {
  poweredOff,
  poweredOn,
  resetting,
  unauthorized,
  unknown,
  unsupported,
}

Members

NameDescription
poweredOffNo description yet.
poweredOnNo description yet.
resettingNo description yet.
unauthorizedNo description yet.
unknownNo description yet.
unsupportedNo description yet.

CBCharacteristic

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L154

class CBCharacteristic

Constructors

NameSignatureDescription
constructorCBCharacteristic(): CBCharacteristic;No description yet.

Properties

NameTypeDescription
isNotifyingbooleanIf true, the characteristic is currently notifying (i.e. streaming updates)
propertiesCBCharacteristicProperties[]Characteristic properties (e.g., read, write, notify)
serviceUUIDCBUUIDUUID of the service this characteristic belongs to
uuidCBUUIDTHe UUID of the characteristic.
valueDataLast known value, if read or notified
isMeshProvisioningDataInCharacteristicunknownNo description yet.
isMeshProvisioningDataOutCharacteristicunknownNo description yet.
isMeshProxyDataInCharacteristicunknownNo description yet.
isMeshProxyDataOutCharacteristicunknownNo description yet.

Methods

NameSignatureDescription
equalequal(other: unknown): boolean;No description yet.

CBCharacteristicProperties

Kind: Enumeration

Source: packages/utils/src/constants/mesh-constants.ts#L136

enum CBCharacteristicProperties {
  authenticatedSignedWrites,
  broadcast,
  extendedProperties,
  indicate,
  indicateEncryptionRequired,
  notify,
  notifyEncryptionRequired,
  read,
  write,
  writeWithoutResponse,
}

Members

NameDescription
authenticatedSignedWritesNo description yet.
broadcastNo description yet.
extendedPropertiesNo description yet.
indicateNo description yet.
indicateEncryptionRequiredNo description yet.
notifyNo description yet.
notifyEncryptionRequiredNo description yet.
readNo description yet.
writeNo description yet.
writeWithoutResponseNo description yet.

CBCharacteristicWriteType

Kind: Enumeration

Source: packages/utils/src/constants/mesh-constants.ts#L149

enum CBCharacteristicWriteType {
  withoutResponse,
  withResponse,
}

Members

NameDescription
withoutResponseNo description yet.
withResponseNo description yet.

CBPeripheral

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L72

class CBPeripheral extends BindableTinyEmitter<CBPeripheralHandler>

Constructors

NameSignatureDescription
constructorCBPeripheral(): CBPeripheral;No description yet.

Properties

NameTypeDescription
advertisementDataRecord<string, unknown>Optional manufacturer data or device metadata
identifierUUIDA unique identifier of the peripheral
namestringDisplay name (optional, may be null or undefined if not advertising)
rssinumberSignal strength in dBm
servicesCBService[]A list of services provided by the peripheral
stateCBPeripheralStateCurrent connection state

Methods

NameSignatureDescription
bindAllEventsbindAllEvents(handler: Partial<E>): () => void;No description yet.
discoverCharacteristicsdiscoverCharacteristics(characteristicUUIDs: CBUUID[], service: CBService): void;No description yet.
discoverServicesdiscoverServices(serviceUUIDs: CBUUID[]): void;No description yet.
emitemit<K>(event: K, args: Parameters<CBPeripheralHandler[K]>): void;No description yet.
equalequal(other: unknown): boolean;No description yet.
maximumWriteValueLengthmaximumWriteValueLength(type: CBCharacteristicWriteType): Long;No description yet.
offoff<K>(event: K, fn?: CBPeripheralHandler[K]): void;No description yet.
onon<K>(event: K, fn: CBPeripheralHandler[K]): () => void;No description yet.
readRSSIreadRSSI(): void;No description yet.
setNotifyValuesetNotifyValue(enabled: boolean, characteristic: CBCharacteristic): void;No description yet.
unbindAllEventsunbindAllEvents(handler: Partial<E>): void;No description yet.
writeValuewriteValue(data: Data, characteristic: CBCharacteristic, type: CBCharacteristicWriteType): Promise<void>;No description yet.

CBPeripheralHandler

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L210

Abstract base class representing the handler of a Bluetooth peripheral. Use this class to respond to events such as service discovery and characteristic updates.

class CBPeripheralHandler

Constructors

NameSignatureDescription
constructorCBPeripheralHandler(): CBPeripheralHandler;No description yet.

Methods

NameSignatureDescription
didDisconnectdidDisconnect(peripheral: CBPeripheral): void;No description yet.
didDiscoverCharacteristicsForServicedidDiscoverCharacteristicsForService(peripheral: CBPeripheral, service: CBService, error?: Error): void;No description yet.
didDiscoverServicesdidDiscoverServices(peripheral: CBPeripheral, error?: Error): void;No description yet.
didReadRSSIdidReadRSSI(peripheral: CBPeripheral, rssi: Long, error?: Error): void;No description yet.
didUpdateNotificationStateForCharacteristicdidUpdateNotificationStateForCharacteristic(peripheral: CBPeripheral, characteristic: CBCharacteristic, error?: Error): void;No description yet.
didUpdateStatedidUpdateState(peripheral: CBPeripheral): void;No description yet.
didUpdateValueForCharacteristicdidUpdateValueForCharacteristic(peripheral: CBPeripheral, characteristic: CBCharacteristic, error?: Error): void;No description yet.
didWriteValueForCharacteristicdidWriteValueForCharacteristic(peripheral: CBPeripheral, characteristic: CBCharacteristic, error?: Error): void;No description yet.

CBPeripheralState

Kind: Enumeration

Source: packages/utils/src/constants/mesh-constants.ts#L65

enum CBPeripheralState {
  connected,
  connecting,
  disconnected,
  disconnecting,
}

Members

NameDescription
connectedNo description yet.
connectingNo description yet.
disconnectedNo description yet.
disconnectingNo description yet.

CBService

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L113

class CBService

Constructors

NameSignatureDescription
constructorCBService(): CBService;No description yet.

Properties

NameTypeDescription
characteristicsCBCharacteristic[]No description yet.
peripheralCBPeripheralNo description yet.
uuidCBUUIDThe UUID of the service.
isMeshProvisioningServiceunknownNo description yet.
isMeshProxyServiceunknownNo description yet.

CBUUID

Kind: Class

Source: packages/utils/src/types/cbuuid.ts#L11

Represents a Core Bluetooth UUID. Can be constructed from a string, number, or Uint8Array. Provides utility methods for comparison and string representation.

class CBUUID

Constructors

NameSignatureDescription
constructorCBUUID(value: string | Uint8Array<ArrayBufferLike>): CBUUID;No description yet.

Properties

NameTypeDescription
fullUuidStringunknownNo description yet.
shortUuidunknownNo description yet.
uuidunknownNo description yet.
uuidStringunknownNo description yet.

Methods

NameSignatureDescription
equalsequals(other: CBUUID): boolean;No description yet.
toBytestoBytes(): Uint8Array;No description yet.
toStringtoString(): string;No description yet.

chunkedMap

Kind: Function

Source: packages/utils/src/helpers/map.ts#L3

function chunkedMap<T>(map: Map<string, T>, maxSize: number): Map<string, T>[];

Class

Kind: Type alias

Source: packages/utils/src/types/common.ts#L23

Matches a class.

type Class<T, Arguments> = Constructor<T, Arguments> & { prototype: T };

ClosedRange

Kind: Class

Source: packages/utils/src/types/closed-range.ts#L4

class ClosedRange<T>

Constructors

NameSignatureDescription
constructorClosedRange<T>(lower: T, upper: T, comparator?: (a: T, b: T) => number): ClosedRange<T>;No description yet.

Properties

NameTypeDescription
lowerBoundTNo description yet.
upperBoundTNo description yet.
lengthunknownNo description yet.

Methods

NameSignatureDescription
containscontains(value: T): boolean;No description yet.
forEachforEach(callback: (value: T) => void): void;No description yet.
overlapsoverlaps(other: ClosedRange<T>): boolean;No description yet.
toStringtoString(): string;No description yet.

CompanyIdentifier

Kind: Unknown

Source: packages/utils/src/enums/company-identifier.ts#L7

Source: https://www.bluetooth.com/specifications/assigned-numbers/ Last update date: 7 June 2023

ConfigAnyModelMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L291

A base protocol for config messages related to Models, where the Model can be a vendor model.

class ConfigAnyModelMessage extends ConfigModelMessage

Constructors

NameSignatureDescription
constructorConfigAnyModelMessage(): ConfigAnyModelMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
companyIdentifierunknownNo description yet.
elementAddressunknownNo description yet.
isAcknowledgedunknownNo description yet.
isBluetoothSIGAssignedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
modelIdunknownNo description yet.
modelIdentifierunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ConfigAppKeyMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L320

A base protocol for config messages related to Application Keys.

class ConfigAppKeyMessage extends ConfigMessage

Constructors

NameSignatureDescription
constructorConfigAppKeyMessage(): ConfigAppKeyMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
applicationKeyIndexunknownNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ConfigElementMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L265

A base protocol for config messages related to Elements.

class ConfigElementMessage extends ConfigMessage

Constructors

NameSignatureDescription
constructorConfigElementMessage(): ConfigElementMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
elementAddressunknownNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ConfigMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L145

A base protocol for all Configuration messages. Configuration messages are used to configure Nodes. They are sent between Configuration Client model on the Configuration Manager and Configuration Server model on the device, which is being configured. All Config messages are encrypted using target Node's Device Key.

class ConfigMessage extends StaticMeshMessage

Constructors

NameSignatureDescription
constructorConfigMessage(): ConfigMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ConfigMessageStatus

Kind: Unknown

Source: packages/utils/src/mesh-messages/config-message.ts#L19

ConfigModelMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L275

A base protocol for config messages related to Models.

class ConfigModelMessage extends ConfigElementMessage

Constructors

NameSignatureDescription
constructorConfigModelMessage(): ConfigModelMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
elementAddressunknownNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
modelIdunknownNo description yet.
modelIdentifierunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ConfigNetAndAppKeyMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L362

A base protocol for config messages related to Network Key and Application Key.

class ConfigNetAndAppKeyMessage extends ConfigNetKeyMessage<this> & ConfigAppKeyMessage<this>

Constructors

NameSignatureDescription
constructorConfigNetAndAppKeyMessage(): ConfigNetAndAppKeyMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
applicationKeyIndexunknownNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
networkKeyIndexunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
encodeNetAndAppKeyIndexencodeNetAndAppKeyIndex(): Data;No description yet.
encodeNetKeyIndexencodeNetKeyIndex(): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
decodeNetAndAppKeyIndexdecodeNetAndAppKeyIndex(data: Data, offset: number): { applicationKeyIndex: KeyIndex; networkKeyIndex: KeyIndex };No description yet.
decodeNetKeyIndexdecodeNetKeyIndex(data: Data, offset: number): KeyIndex;No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ConfigNetKeyMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L330

A base protocol for config messages related to Network Keys.

class ConfigNetKeyMessage extends ConfigMessage

Constructors

NameSignatureDescription
constructorConfigNetKeyMessage(): ConfigNetKeyMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
networkKeyIndexunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
encodeNetKeyIndexencodeNetKeyIndex(): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
decodeNetKeyIndexdecodeNetKeyIndex(data: Data, offset: number): KeyIndex;No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ConfigResponse

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L244

The base class for response messages.

class ConfigResponse extends StaticMeshResponse<this> & UnacknowledgedConfigMessage<this>

Constructors

NameSignatureDescription
constructorConfigResponse(): ConfigResponse;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ConfigStatusMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L209

A base protocol for config status messages.

class ConfigStatusMessage extends ConfigMessage<this> & StatusMessage<this>

Constructors

NameSignatureDescription
constructorConfigStatusMessage(): ConfigStatusMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isSuccessunknownNo description yet.
isVendorMessageunknownNo description yet.
messageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.
statusunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

Data

Kind: Type alias

Source: packages/utils/src/types/buffer.ts#L1

type Data = Uint8Array;

dataViewToUint8Array

Kind: Function

Source: packages/utils/src/helpers/data.ts#L25

function dataViewToUint8Array(view: DataView): Uint8Array;

DecodingError

Kind: Class

Source: packages/utils/src/constants/decoding-error.ts#L1

class DecodingError extends Error

Constructors

NameSignatureDescription
constructorDecodingError(message: string): DecodingError;No description yet.

Properties

NameTypeDescription
messagestringNo description yet.
namestringNo description yet.
stackstringNo description yet.
stackTraceLimitnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Methods

NameSignatureDescription
captureStackTracecaptureStackTrace(targetObject: object, constructorOpt?: Function): void;No description yet.
prepareStackTraceprepareStackTrace(err: Error, stackTraces: CallSite[]): any;No description yet.

decryptAesCcm

Kind: Function

Source: packages/utils/src/helpers/crypto.ts#L45

function decryptAesCcm(key: Uint8Array, iv: Uint8Array, cipherTextWithTag: Uint8Array, aad: Uint8Array<ArrayBufferLike> | undefined, tagLength: number): Uint8Array;

DispatchQueue

Kind: Class

Source: packages/utils/src/types/dispatch-queue.ts#L3

class DispatchQueue

Constructors

NameSignatureDescription
constructorDispatchQueue(label: string): DispatchQueue;No description yet.

Properties

NameTypeDescription
labelstringNo description yet.
backgroundunknownNo description yet.
iounknownNo description yet.
mainunknownNo description yet.

Methods

NameSignatureDescription
asyncasync(execute: () => void | Promise<void>): Promise<void>;No description yet.
executeTimerCallbackexecuteTimerCallback(callback: () => void): Promise<void>;No description yet.
toStringtoString(): string;No description yet.
namednamed(label: string): DispatchQueue;No description yet.

Double

Kind: Type alias

Source: packages/utils/src/types/number.ts#L47

Represents a 64-bit IEEE‑754 double-precision floating-point (the same as JavaScript's built-in number type).

type Double = number;

encryptAesCcm

Kind: Function

Source: packages/utils/src/helpers/crypto.ts#L20

function encryptAesCcm(key: Uint8Array, iv: Uint8Array, data: Uint8Array, aad: Uint8Array<ArrayBufferLike> | undefined, tagLength: number): Uint8Array;

encryptAesEcb

Kind: Function

Source: packages/utils/src/helpers/crypto.ts#L73

function encryptAesEcb(plaintext: Uint8Array, keyBytes: Uint8Array): Uint8Array<ArrayBufferLike>;

ExportConfiguration

Kind: Enumeration

Source: packages/utils/src/types/export-configuration.ts#L15

configuration allows to narrow down the exported configuration to a required minimum. When sharing a mesh network configuration a care must be taken not to share sensitive information to prevent unauthorized use. When sharing a configuration with a guest, a separate Network Key and set of Application Keys should be created. The Nodes given to the guest under control should be configured to use the keys. The guest can be given only the part of the network related to the guest Network Key, with all other data excluded. Also, to prevent reconfiguration of the Nodes, only partial Nodes configuration can be shared, which excludes the Device Keys of those Nodes.

enum ExportConfiguration {
  full,
}

Members

NameDescription
fullThis configuration will contain the whole copy of local mesh network.

Failure

Kind: Class

Source: packages/utils/src/types/result.ts#L33

class Failure<T, E>

Constructors

NameSignatureDescription
constructorFailure<T, E>(error: E): Failure<T, E>;No description yet.

Properties

NameTypeDescription
errorENo description yet.
isFailuretrueNo description yet.
isSuccessfalseNo description yet.

Methods

NameSignatureDescription
flatMapflatMap<U>(_fn: (val: T) => Result<U, E>): Failure<U, E>;No description yet.
getOrThrowgetOrThrow(): T;No description yet.
mapmap<U>(_fn: (val: T) => U): Result<U, E>;No description yet.
mapErrormapError<F>(fn: (err: E) => F): Failure<T, F>;No description yet.

generateElGamalKeyPair

Kind: Function

Source: packages/utils/src/helpers/crypto.ts#L79

function generateElGamalKeyPair(): { privateKey: string; publicKey: string };

getEnumKeys

Kind: Function

Source: packages/utils/src/helpers/enum.ts#L5

function getEnumKeys<T>(_enum: T): string[];

getEnumValues

Kind: Function

Source: packages/utils/src/helpers/enum.ts#L13

function getEnumValues<T, V>(_enum: T): V[];

getSecureRandomBytes

Kind: Function

Source: packages/utils/src/helpers/crypto.ts#L6

function getSecureRandomBytes(length: Long): Uint8Array<ArrayBuffer> | Error;

HeartbeatSubscription

Kind: Class

Source: packages/utils/src/mesh-models/heartbeat-subscription.ts#L46

class HeartbeatSubscription

Constructors

NameSignatureDescription
constructorHeartbeatSubscription(): HeartbeatSubscription;No description yet.

Properties

NameTypeDescription
destinationAddressThe destination address for the Heartbeat messages. It can be either a Group or Unicast Address.
sourceAddressThe source address for the Heartbeat messages. It must be a Unicast Address.
stateState | undefinedThe state contains variables used for handling Heartbeat messages received by the local Node.
isEnabledunknownNo description yet.

Methods

NameSignatureDescription
matchesmatches<T>(heartbeat: T): boolean;No description yet.
updateIfMatchesupdateIfMatches<T>(heartbeat: T): void;No description yet.
periodLog2PeriodperiodLog2Period(periodLog: number): number;No description yet.
remainingPeriod2PeriodremainingPeriod2Period(remainingPeriod: number): number;No description yet.

Hex

Kind: Type alias

Source: packages/utils/src/types/common.ts#L11

Represents a hexadecimal string (e.g., color codes, hashes).

type Hex = string;

hexToUuid

Kind: Function

Source: packages/utils/src/helpers/uuid.ts#L8

function hexToUuid(hex: string): string;

importKeyFromPrivate

Kind: Function

Source: packages/utils/src/helpers/crypto.ts#L93

function importKeyFromPrivate(privateKeyHex: string): string;

Int16

Kind: Type alias

Source: packages/utils/src/types/number.ts#L21

Represents a signed 16-bit integer.

type Int16 = number;

Int32

Kind: Type alias

Source: packages/utils/src/types/number.ts#L31

Represents a signed 32-bit integer.

type Int32 = number;

Int64

Kind: Type alias

Source: packages/utils/src/types/number.ts#L41

Represents a signed 64-bit integer using Long.

type Int64 = Long;

Int8

Kind: Type alias

Source: packages/utils/src/types/number.ts#L11

Represents a signed 8-bit integer.

type Int8 = number;

isArray

Kind: Function

Source: packages/utils/src/helpers/common.ts#L181

function isArray<T>(value: unknown, assertion?: (value: T) => value is T): value is T[];

isDirectInstanceOf

Kind: Function

Source: packages/utils/src/helpers/common.ts#L227

function isDirectInstanceOf<T>(instance: unknown, class_: Class<T>): instance is T;

isEnumCase

Kind: Function

Source: packages/utils/src/helpers/enum.ts#L23

function isEnumCase<T>(value: unknown, targetEnum: T): value is T[keyof T];

isFunction

Kind: Function

Source: packages/utils/src/helpers/common.ts#L177

function isFunction(value: unknown): value is (args: unknown[]) => unknown;

isNull

Kind: Function

Source: packages/utils/src/helpers/common.ts#L213

function isNull(value: unknown): value is null;

isNumber

Kind: Function

Source: packages/utils/src/helpers/common.ts#L167

function isNumber(value: unknown): value is number;

isObject

Kind: Function

Source: packages/utils/src/helpers/common.ts#L217

function isObject(value: unknown): value is object;

isValidUuid

Kind: Function

Source: packages/utils/src/helpers/uuid.ts#L12

function isValidUuid(hex: string): boolean;

IvIndex

Kind: Class

Source: packages/utils/src/types/ivindex.ts#L3

class IvIndex

Constructors

NameSignatureDescription
constructorIvIndex(index: number, updateActive: boolean): IvIndex;No description yet.

Properties

NameTypeDescription
indexnumberNo description yet.
updateActivebooleanNo description yet.
indexKeystringNo description yet.
ivRecoveryKeystringNo description yet.
timestampKeystringNo description yet.
asMapunknownNo description yet.
previousunknownNo description yet.
transmitIndexunknownNo description yet.

Methods

NameSignatureDescription
equalsequals(other: unknown): boolean;No description yet.
indexForindexFor(ivi: number): number;No description yet.
ltlt(other: unknown): boolean;No description yet.
toStringtoString(): string;No description yet.
fromMapfromMap(map?: Record<string, unknown>): IvIndex | undefined;No description yet.

Key

Kind: Class

Source: packages/utils/src/types/key.ts#L9

Base protocol for Network and Application Keys.

class Key

Constructors

NameSignatureDescription
constructorKey(): Key;No description yet.

Properties

NameTypeDescription
$indexKeyIndexNo description yet.
$keyData128-bit key.
$namestringNo description yet.
indexunknownNo description yet.
keyunknownNo description yet.
nameunknownNo description yet.

KeyIndex

Kind: Class

Source: packages/utils/src/types/key-index.ts#L15

The key index is a 12-bit unsigned integer identifying a Network or an Application Key. The key indexes within Network Keys and Application Keys must be distinct. This type is an alias for UInt16. To check the range, use isValidKeyIndex.

class KeyIndex extends Number

Constructors

NameSignatureDescription
constructorKeyIndex(value: number): KeyIndex;No description yet.

Properties

NameTypeDescription
EPSILONnumberThe value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately: 2.2204460492503130808472633361816 x 10‍−‍16.
MAX_SAFE_INTEGERnumberThe value of the largest integer n such that n and n + 1 are both exactly representable as a Number value. The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
MAX_VALUEnumberThe largest number that can be represented in JavaScript. Equal to approximately 1.79E+308.
MIN_SAFE_INTEGERnumberThe value of the smallest integer n such that n and n − 1 are both exactly representable as a Number value. The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
MIN_VALUEnumberThe closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324.
NaNnumberA value that is not a number. In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
NEGATIVE_INFINITYnumberA value that is less than the largest negative number that can be represented in JavaScript. JavaScript displays NEGATIVE_INFINITY values as -infinity.
POSITIVE_INFINITYnumberA value greater than the largest number that can be represented in JavaScript. JavaScript displays POSITIVE_INFINITY values as infinity.
bytesunknownNo description yet.
bytesBEunknownNo description yet.
isValidKeyIndexunknownNo description yet.

Methods

NameSignatureDescription
equalequal(other: KeyIndex): boolean;No description yet.
toExponentialtoExponential(fractionDigits?: number): string;No description yet.
toFixedtoFixed(fractionDigits?: number): string;No description yet.
toLocaleStringtoLocaleString(locales?: string | string[], options?: NumberFormatOptions): string;No description yet.
toPrecisiontoPrecision(precision?: number): string;No description yet.
toStringtoString(radix?: number): string;No description yet.
valueOfvalueOf(): number;No description yet.
isFiniteisFinite(number: unknown): boolean;No description yet.
isIntegerisInteger(number: unknown): boolean;No description yet.
isNaNisNaN(number: unknown): boolean;No description yet.
isSafeIntegerisSafeInteger(number: unknown): boolean;No description yet.
parseFloatparseFloat(string: string): number;No description yet.
parseIntparseInt(string: string, radix?: number): number;No description yet.

KeyRefreshPhase

Kind: Unknown

Source: packages/utils/src/enums/key-refresh-phase.ts#L6

Safely parses numeric input into a KeyRefreshPhase.

KeySet

Kind: Class

Source: packages/utils/src/mesh-models/key-set.ts#L5

class KeySet

Constructors

NameSignatureDescription
constructorKeySet(): KeySet;No description yet.

Properties

NameTypeDescription
accessKeyunknownNo description yet.
aidunknownNo description yet.
networkKeyunknownNo description yet.

LocalProvisionerUuidKey

Kind: Variable

Source: packages/utils/src/constants/common.ts#L13

The key used in UserDefaults to store the UUID of the local Provisioner for each loaded mesh network. The intent is to restore the same instance (move to index 0) whenever the same mesh network configuration is imported. Local Provisioner UUID is saved whenever a new Provisioner is added or moved to index 0 in the MeshNetwork.provisioners array in mesh network object. Use MeshNetwork.restoreLocalProvisioner() to restore the Provisioner instance.

const LocalProvisionerUuidKey: "provisioner";

Location

Kind: Unknown

Source: packages/utils/src/enums/location.ts#L10

LogCategory

Kind: Enumeration

Source: packages/utils/src/types/logger.ts#L40

The log category indicates the component that created the log entry.

enum LogCategory {
  access,
  bearer,
  foundationModel,
  lowerTransport,
  model,
  network,
  provisioning,
  proxy,
  upperTransport,
}

Members

NameDescription
accessLog created by the Access layer.
bearerLog created by the Bearer component.
foundationModelLog created by the Foundation layer models.
lowerTransportLog created by the Lower Transport layer.
modelLog created by the Access layer model.
networkLog created by the Network layer.
provisioningLog created by the Provisioning component.
proxyLog created by the Proxy component.
upperTransportLog created by the Upper Transport layer.

LoggerHandler

Kind: Class

Source: packages/utils/src/types/logger.ts#L61

class LoggerHandler

Constructors

NameSignatureDescription
constructorLoggerHandler(): LoggerHandler;No description yet.

Methods

NameSignatureDescription
dd(category: LogCategory, message: string): void;No description yet.
ee(category: LogCategory, message: string): void;No description yet.
ii(category: LogCategory, message: string): void;No description yet.
loglog(message: string, category: LogCategory, level: LogLevel): void;No description yet.
vv(category: LogCategory, message: string): void;No description yet.
ww(category: LogCategory, message: string): void;No description yet.

LogLevel

Kind: Class

Source: packages/utils/src/types/logger.ts#L4

Log level, which allows filtering logs by importance.

class LogLevel

Properties

NameTypeDescription
applicationLogLevelMessages about application level events, in this case DFU messages in human-readable form.
debugLogLevelLowest priority. Usually names of called methods or callbacks received.
errorLogLevelHighest priority messages with errors.
infoLogLevelMessages about completed tasks.
verboseLogLevelLow priority messages what the service is doing.
warningLogLevelImportant messages.

Methods

NameSignatureDescription
toStringtoString(): string;No description yet.

longMin

Kind: Function

Source: packages/utils/src/helpers/number.ts#L108

function longMin(a: Long, b: Long): Long;

MeshCDB

Kind: Unknown

Source: packages/utils/src/constants/mesh-schema.ts#L7

A namespace for Mesh Configuration Database Zod schemas. This provides a clean, organized, and properly typed structure for validation.

MeshMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L34

The base class of every mesh message. Mesh messages can be sent to and received from the mesh network. For messages with the Op Code known during compilation a StaticMeshMessage protocol should be preferred. Parameters MeshMessage.security and MeshMessage.isSegmented are checked and should be set only for outgoing messages.

class MeshMessage extends BaseMeshMessage

Constructors

NameSignatureDescription
constructorMeshMessage(): MeshMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

MeshMessageSecurity

Kind: Enumeration

Source: packages/utils/src/enums/mesh-message-security.ts#L16

The mesh message security enum determines authentication level which shall be used when encrypting a segmented mesh message. This filed is used to determine the TransMIC. The Message Integrity Check for Transport (TransMIC) is a 32-bit or 64-bit field that authenticates that the Access payload has not been changed. For a segmented message, where SEG is set to 1, the size of the TransMIC is determined by the value of the SZMIC field in the Lower Transport PDU. For unsegmented messages, the size of the TransMIC is 32 bits for data messages. Control messages do not have a TransMIC.

enum MeshMessageSecurity {
  high,
  low,
}

Members

NameDescription
highMessage will be sent with 64-bit Transport MIC. Unsegmented messages cannot be sent with this option.
lowMessage will be sent with 32-bit Transport MIC.

MeshNetworkError

Kind: Class

Source: packages/utils/src/constants/mesh-network-error.ts#L4

A set of generic mesh errors.

class MeshNetworkError extends Error

Properties

NameTypeDescription
messagestringNo description yet.
namestringNo description yet.
stackstringNo description yet.
addressNotAvailableMeshNetworkErrorThrown when the address cannot be assigned as it is being used by another node.
addressNotInAllocatedRangeMeshNetworkErrorThrown when a node cannot be added due to its address not being inside Provisioner's unicast address range.
cannotRemoveMeshNetworkErrorThrown when the object cannot be removed.
groupAlreadyExistsMeshNetworkErrorThrown when a new Group is being added with the same address as one that is already in the network.
groupInUseMeshNetworkErrorThrown when trying to remove a Group that is either a parent of another Group, or set as publication or subscription address for a Model.
invalidAddressMeshNetworkErrorThrown when the address is of a wrong type.
invalidKeyMeshNetworkErrorThrown when the provided key is not 128-bit long.
invalidRangeMeshNetworkErrorThrown when the range to be allocated is of invalid type.
ivIndexTooSmallMeshNetworkErrorThrown when setting too small IV Index. The new IV Index must be greater than or equal to the previous one.
keyIndexAlreadyExistsMeshNetworkErrorThrown when a key with the same index already exists in the network.
keyIndexOutOfRangeMeshNetworkErrorThrown when the given Key Index is not valid.
keyInUseMeshNetworkErrorThrown when trying to remove a key that is being used by another Node.
keyNotKnownMeshNetworkErrorThrown when trying to remove a key that is not known by the network.
noAddressAvailableMeshNetworkErrorThrown when a node cannot be added due to lack of available addresses in Provisioner's range.
noApplicationKeyMeshNetworkErrorThrown when Application Key is required to continue with the operation.
nodeAlreadyExistMeshNetworkErrorThrown when a new Provisioner has the same UUID as one node that is already in the mesh network.
noNetworkMeshNetworkErrorThrown when trying to send a mesh message before setting up the mesh network.
noNetworkKeyMeshNetworkErrorThrown when Network Key is required to continue with the operation.
overlappingProvisionerRangesMeshNetworkErrorThrown when any allocated range of the new Provisioner overlaps with an existing one.
provisionerNotInNetworkMeshNetworkErrorThrown when the requested Provisioner is not in the Mesh Network.
provisionerUsedInAnotherNetworkMeshNetworkErrorThrown when trying to add a Provisioner that is already a part of another mesh network.
sceneAlreadyExistsMeshNetworkErrorThrown when a new Scene is being added with the same number as one that is already in the network.
sceneInUseMeshNetworkErrorThrown when trying to remove a Scene stored by at least one Scene Register.
stackTraceLimitnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Methods

NameSignatureDescription
captureStackTracecaptureStackTrace(targetObject: object, constructorOpt?: Function): void;No description yet.
prepareStackTraceprepareStackTrace(err: Error, stackTraces: CallSite[]): any;No description yet.

MeshProvisioningService

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L32

A structure defining Mesh Provisioning service, which shall be present on unprovisioned devices. It allows sending provisioning messages. When provisioning is complete, the service shall be replaced with Mesh Proxy service.

class MeshProvisioningService extends MeshService

Properties

NameTypeDescription
dataInUuidCBUUIDData In characteristic UUID.
dataOutUuidCBUUIDData Out characteristic UUID.
uuidCBUUIDService UUID.

Methods

NameSignatureDescription
matchesmatches(service: CBService): boolean;No description yet.

MeshProxyService

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L52

A structure defining Mesh Proxy service, which shall be present on provisioned Nodes. The Mesh Proxy service is used to send mesh messages over GATT.

class MeshProxyService extends MeshService

Properties

NameTypeDescription
dataInUuidCBUUIDData In characteristic UUID.
dataOutUuidCBUUIDData Out characteristic UUID.
uuidCBUUIDService UUID.

Methods

NameSignatureDescription
matchesmatches(service: CBService): boolean;No description yet.

MeshResponse

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L117

The base class for response messages.

class MeshResponse extends UnacknowledgedMeshMessage

Constructors

NameSignatureDescription
constructorMeshResponse(): MeshResponse;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

MeshService

Kind: Class

Source: packages/utils/src/constants/mesh-constants.ts#L10

A base class for mesh service objects.

class MeshService

Constructors

NameSignatureDescription
constructorMeshService(): MeshService;No description yet.

Properties

NameTypeDescription
dataInUuidCBUUIDData In characteristic UUID.
dataOutUuidCBUUIDData Out characteristic UUID.
uuidCBUUIDService UUID.

meshTimestamp

Kind: Function

Source: packages/utils/src/helpers/common.ts#L32

function meshTimestamp(timestamp: number): string;

NSNull

Kind: Type alias

Source: packages/utils/src/types/common.ts#L5

Unique symbol used to represent a special "null" value within the namespace. Useful for distinguishing between JavaScript's native null and a custom sentinel value.

type NSNull = typeof NSNull;

OobInformation

Kind: Class

Source: packages/utils/src/types/oob.ts#L11

Information that points to Out-Of-Band (OOB) information needed for provisioning.

class OobInformation

Constructors

NameSignatureDescription
constructorOobInformation(rawValue: number): OobInformation;No description yet.

Properties

NameTypeDescription
rawValuenumberNo description yet.
barCodeOobInformationNo description yet.
electronicURIOobInformationNo description yet.
insideBoxOobInformationNo description yet.
insideManualOobInformationNo description yet.
nfcOobInformationNo description yet.
numberOobInformationNo description yet.
onBoxOobInformationNo description yet.
onDeviceOobInformationNo description yet.
onPieceOfPaperOobInformationNo description yet.
otherOobInformationNo description yet.
qrCodeOobInformationNo description yet.
stringOobInformationNo description yet.
supportForCertificateBasedProvisioningOobInformationNo description yet.
supportForProvisioningRecordsOobInformationNo description yet.

Methods

NameSignatureDescription
fromAdvertisementDatafromAdvertisementData(advertisementData: Record<string, unknown>): OobInformation | undefined;No description yet.

OptionSet

Kind: Class

Source: packages/utils/src/types/option-set.ts#L4

class OptionSet<F>

Constructors

NameSignatureDescription
constructorOptionSet<F>(value: number): OptionSet<F>;No description yet.

Properties

NameTypeDescription
rawValueunknownNo description yet.

Methods

NameSignatureDescription
containscontains(flag: F): boolean;No description yet.
equalsequals(other: OptionSet<F>): boolean;No description yet.
insertinsert(flag: F): OptionSet<F>;No description yet.
intersectintersect(other: OptionSet<F>): OptionSet<F>;No description yet.
isDisjointisDisjoint(other: OptionSet<F>): boolean;No description yet.
isDisjointWithArrayisDisjointWithArray(others: OptionSet<F>[]): boolean;No description yet.
removeremove(flag: F): OptionSet<F>;No description yet.
subtractsubtract(other: OptionSet<F>): OptionSet<F>;No description yet.
toggletoggle(flag: F): OptionSet<F>;No description yet.
toStringtoString(): string;No description yet.
unionunion(other: OptionSet<F>): OptionSet<F>;No description yet.
emptyempty<F>(): OptionSet<F>;No description yet.
fromDatafromData<F>(data: Data, offset: number): OptionSet<F>;No description yet.

packInt16BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L52

function packInt16BE(n: number): Uint8Array;

packInt16LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L6

function packInt16LE(n: number): Uint8Array;

packInt32BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L78

function packInt32BE(n: number): Uint8Array;

packInt32LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L28

function packInt32LE(n: number): Uint8Array;

packUInt16BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L65

function packUInt16BE(n: number): Uint8Array;

packUInt16LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L17

function packUInt16LE(n: number): Uint8Array;

packUInt32BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L91

function packUInt32BE(n: number): Uint8Array;

packUInt32LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L39

function packUInt32LE(n: number): Uint8Array;

ProxyConfigurationMessage

Kind: Class

Source: packages/utils/src/mesh-messages/proxy-configuration-message.ts#L8

A base class for Proxy configuration messages.

class ProxyConfigurationMessage extends BaseMeshMessage

Constructors

NameSignatureDescription
constructorProxyConfigurationMessage(): ProxyConfigurationMessage;No description yet.

Properties

NameTypeDescription
opCodeunknownNo description yet.
parametersunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

ProxyFilterEventHandler

Kind: Interface

Source: packages/utils/src/types/proxy-filter.ts#L6

interface ProxyFilterEventHandler<T>

Methods

NameSignatureDescription
handlehandle(message: ProxyConfigurationMessage, proxy: T): Promise<void>;No description yet.
managerDidDeliverMessagemanagerDidDeliverMessage(message: ProxyConfigurationMessage): void;No description yet.
managerFailedToDeliverMessagemanagerFailedToDeliverMessage(message: ProxyConfigurationMessage, error: Error): void;No description yet.
newNetworkCreatednewNetworkCreated(): void;No description yet.
newProxyDidConnectnewProxyDidConnect(): Promise<void>;No description yet.

ProxyFilterHandler

Kind: Class

Source: packages/utils/src/types/proxy-filter.ts#L72

The delegate that will be notified about changes of the Proxy Filter.

class ProxyFilterHandler

Constructors

NameSignatureDescription
constructorProxyFilterHandler(): ProxyFilterHandler;No description yet.

Methods

NameSignatureDescription
proxyFilterLimitReachedproxyFilterLimitReached(type: ProxyFilterType, maxSize: number): void;No description yet.
proxyFilterUpdateAcknowledgedproxyFilterUpdateAcknowledged(type: ProxyFilterType, listSize: number): void;No description yet.
proxyFilterUpdatedproxyFilterUpdated(type: ProxyFilterType, addresses: Map<string, Address>): void;No description yet.

ProxyFilterSetup

Kind: Unknown

Source: packages/utils/src/types/proxy-filter.ts#L137

ProxyFilterSetupType

Kind: Enumeration

Source: packages/utils/src/types/proxy-filter.ts#L114

An enumeration for different initial configurations of the Proxy Filter.

enum ProxyFilterSetupType {
  acceptList,
  automatic,
  rejectList,
}

Members

NameDescription
acceptListThe Proxy Filter on each connected Proxy Node will be set to ProxyFilterType.acceptList with given set of addresses.
automaticIn automatic Proxy Filter setup the filter will be set to ProxyFilterType.acceptList with Unicast Addresses of all local Elements, all Group Addresses with at least one local Model subscribed and the All Nodes (0xFFFF) address. This is the default configuration.
rejectListThe Proxy Filter on each connected Proxy Node will be set to ProxyFilerType.rejectList with given set of addresses.

ProxyFilterType

Kind: Unknown

Source: packages/utils/src/types/proxy-filter-type.ts#L7

RangeObject

Kind: Class

Source: packages/utils/src/types/range-object.ts#L14

A base class for an address or scene range. Ranges are assigned to Provisioner objects. Each Provisioner may provision new Nodes, create Groups and Scenes using only values from assigned ranges. The assigned ranges may not overlap with the ranges of other Provisioners, otherwise different instances could reuse the same values leading to collisions.

class RangeObject<T>

Constructors

NameSignatureDescription
constructorRangeObject<T>(range: ClosedRange<T>): RangeObject<T>;No description yet.

Properties

NameTypeDescription
countunknownNo description yet.
lowerBoundunknownNo description yet.
rangeunknownNo description yet.
upperBoundunknownNo description yet.

Methods

NameSignatureDescription
containscontains(value: T): boolean;No description yet.
containsRangecontainsRange(range: RangeObject<T>): boolean;No description yet.
overlapsoverlaps(other: RangeObject<T>): boolean;No description yet.

readUInt16BE

Kind: Function

Source: packages/utils/src/helpers/data.ts#L90

function readUInt16BE(data: Uint8Array, offset: number): number;

readUInt16LE

Kind: Function

Source: packages/utils/src/helpers/data.ts#L80

function readUInt16LE(data: Uint8Array, offset: number): number;

readUInt32BE

Kind: Function

Source: packages/utils/src/helpers/data.ts#L54

function readUInt32BE(bytes: Uint8Array, offset: number): number;

readUInt32LE

Kind: Function

Source: packages/utils/src/helpers/data.ts#L64

function readUInt32LE(data: Uint8Array, offset: number): number;

Result

Kind: Type alias

Source: packages/utils/src/types/result.ts#L1

type Result<T, E> = Success<T, E> | Failure<T, E>;

SceneNumber

Kind: Class

Source: packages/utils/src/mesh-models/scene-number.ts#L10

Scene number enum type.

class SceneNumber extends Number

Constructors

NameSignatureDescription
constructorSceneNumber(value: number): SceneNumber;No description yet.

Properties

NameTypeDescription
EPSILONnumberThe value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately: 2.2204460492503130808472633361816 x 10‍−‍16.
invalidSceneSceneNumberNo description yet.
MAX_SAFE_INTEGERnumberThe value of the largest integer n such that n and n + 1 are both exactly representable as a Number value. The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
MAX_VALUEnumberThe largest number that can be represented in JavaScript. Equal to approximately 1.79E+308.
maxSceneSceneNumberNo description yet.
MIN_SAFE_INTEGERnumberThe value of the smallest integer n such that n and n − 1 are both exactly representable as a Number value. The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
MIN_VALUEnumberThe closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324.
minSceneSceneNumberNo description yet.
NaNnumberA value that is not a number. In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
NEGATIVE_INFINITYnumberA value that is less than the largest negative number that can be represented in JavaScript. JavaScript displays NEGATIVE_INFINITY values as -infinity.
POSITIVE_INFINITYnumberA value greater than the largest number that can be represented in JavaScript. JavaScript displays POSITIVE_INFINITY values as infinity.
hexunknownNo description yet.
isValidSceneNumberunknownNo description yet.

Methods

NameSignatureDescription
toExponentialtoExponential(fractionDigits?: number): string;No description yet.
toFixedtoFixed(fractionDigits?: number): string;No description yet.
toLocaleStringtoLocaleString(locales?: string | string[], options?: NumberFormatOptions): string;No description yet.
toPrecisiontoPrecision(precision?: number): string;No description yet.
toStringtoString(radix?: number): string;No description yet.
valueOfvalueOf(): number;No description yet.
fromHexfromHex(hex: string): SceneNumber | undefined;No description yet.
isFiniteisFinite(number: unknown): boolean;No description yet.
isIntegerisInteger(number: unknown): boolean;No description yet.
isNaNisNaN(number: unknown): boolean;No description yet.
isSafeIntegerisSafeInteger(number: unknown): boolean;No description yet.
parseFloatparseFloat(string: string): number;No description yet.
parseIntparseInt(string: string, radix?: number): number;No description yet.

SigModelId

Kind: Enumeration

Source: packages/utils/src/enums/sig-model-id.ts#L1

enum SigModelId {
  blobTransferClientModelId,
  blobTransferServerModelId,
  bridgeConfigurationClientModelId,
  bridgeConfigurationServerModelId,
  configurationClientModelId,
  configurationServerModelId,
  directedForwardingConfigurationClientModelId,
  directedForwardingConfigurationServerModelId,
  firmwareDistributionClientModelId,
  firmwareDistributionServerModelId,
  firmwareUpdateClientModelId,
  firmwareUpdateServerModelId,
  genericAdminPropertyServerModelId,
  genericBatteryClientModelId,
  genericBatteryServerModelId,
  genericClientPropertyServerModelId,
  genericDefaultTransitionTimeClientModelId,
  genericDefaultTransitionTimeServerModelId,
  genericLevelClientModelId,
  genericLevelServerModelId,
  genericLocationClientModelId,
  genericLocationServerModelId,
  genericLocationSetupServerModelId,
  genericManufacturerPropertyServerModelId,
  genericOnOffClientModelId,
  genericOnOffServerModelId,
  genericPowerLevelClientModelId,
  genericPowerLevelServerModelId,
  genericPowerLevelSetupServerModelId,
  genericPowerOnOffClientModelId,
  genericPowerOnOffServerModelId,
  genericPowerOnOffSetupServerModelId,
  genericPropertyClientModelId,
  genericUserPropertyServerModelId,
  healthClientModelId,
  healthServerModelId,
  largeCompositionDataClientModelId,
  largeCompositionDataServerModelId,
  lightCTLClientModelId,
  lightCTLServerModelId,
  lightCTLSetupServerModelId,
  lightCTLTemperatureServerModelId,
  lightHSLClientModelId,
  lightHSLHueServerModelId,
  lightHSLSaturationServerModelId,
  lightHSLServerModelId,
  lightHSLSetupServerModelId,
  lightLCClientModelId,
  lightLCServerModelId,
  lightLCSetupServerModelId,
  lightLightnessClientModelId,
  lightLightnessServerModelId,
  lightLightnessSetupServerModelId,
  lightXyLClientModelId,
  lightXyLServerModelId,
  lightXyLSetupServerModelId,
  onDemandPrivateProxyClientModelId,
  onDemandPrivateProxyServerModelId,
  opcodesAggregatorClientModelId,
  opcodesAggregatorServerModelId,
  privateBeaconClientModelId,
  privateBeaconServerModelId,
  remoteProvisioningClientModelId,
  remoteProvisioningServerModelId,
  sarConfigurationClientModelId,
  sarConfigurationServerModelId,
  sceneClientModelId,
  sceneServerModelId,
  sceneSetupServerModelId,
  schedulerClientModelId,
  schedulerServerModelId,
  schedulerSetupServerModelId,
  sensorClientModelId,
  sensorServerModelId,
  sensorSetupServerModelId,
  solicitationPduRplConfigurationClientModelId,
  solicitationPduRplConfigurationServerModelId,
  timeClientModelId,
  timeServerModelId,
  timeSetupServerModelId,
}

Members

NameDescription
blobTransferClientModelIdNo description yet.
blobTransferServerModelIdNo description yet.
bridgeConfigurationClientModelIdNo description yet.
bridgeConfigurationServerModelIdNo description yet.
configurationClientModelIdNo description yet.
configurationServerModelIdNo description yet.
directedForwardingConfigurationClientModelIdNo description yet.
directedForwardingConfigurationServerModelIdNo description yet.
firmwareDistributionClientModelIdNo description yet.
firmwareDistributionServerModelIdNo description yet.
firmwareUpdateClientModelIdNo description yet.
firmwareUpdateServerModelIdNo description yet.
genericAdminPropertyServerModelIdNo description yet.
genericBatteryClientModelIdNo description yet.
genericBatteryServerModelIdNo description yet.
genericClientPropertyServerModelIdNo description yet.
genericDefaultTransitionTimeClientModelIdNo description yet.
genericDefaultTransitionTimeServerModelIdNo description yet.
genericLevelClientModelIdNo description yet.
genericLevelServerModelIdNo description yet.
genericLocationClientModelIdNo description yet.
genericLocationServerModelIdNo description yet.
genericLocationSetupServerModelIdNo description yet.
genericManufacturerPropertyServerModelIdNo description yet.
genericOnOffClientModelIdNo description yet.
genericOnOffServerModelIdNo description yet.
genericPowerLevelClientModelIdNo description yet.
genericPowerLevelServerModelIdNo description yet.
genericPowerLevelSetupServerModelIdNo description yet.
genericPowerOnOffClientModelIdNo description yet.
genericPowerOnOffServerModelIdNo description yet.
genericPowerOnOffSetupServerModelIdNo description yet.
genericPropertyClientModelIdNo description yet.
genericUserPropertyServerModelIdNo description yet.
healthClientModelIdNo description yet.
healthServerModelIdNo description yet.
largeCompositionDataClientModelIdNo description yet.
largeCompositionDataServerModelIdNo description yet.
lightCTLClientModelIdNo description yet.
lightCTLServerModelIdNo description yet.
lightCTLSetupServerModelIdNo description yet.
lightCTLTemperatureServerModelIdNo description yet.
lightHSLClientModelIdNo description yet.
lightHSLHueServerModelIdNo description yet.
lightHSLSaturationServerModelIdNo description yet.
lightHSLServerModelIdNo description yet.
lightHSLSetupServerModelIdNo description yet.
lightLCClientModelIdNo description yet.
lightLCServerModelIdNo description yet.
lightLCSetupServerModelIdNo description yet.
lightLightnessClientModelIdNo description yet.
lightLightnessServerModelIdNo description yet.
lightLightnessSetupServerModelIdNo description yet.
lightXyLClientModelIdNo description yet.
lightXyLServerModelIdNo description yet.
lightXyLSetupServerModelIdNo description yet.
onDemandPrivateProxyClientModelIdNo description yet.
onDemandPrivateProxyServerModelIdNo description yet.
opcodesAggregatorClientModelIdNo description yet.
opcodesAggregatorServerModelIdNo description yet.
privateBeaconClientModelIdNo description yet.
privateBeaconServerModelIdNo description yet.
remoteProvisioningClientModelIdNo description yet.
remoteProvisioningServerModelIdNo description yet.
sarConfigurationClientModelIdNo description yet.
sarConfigurationServerModelIdNo description yet.
sceneClientModelIdNo description yet.
sceneServerModelIdNo description yet.
sceneSetupServerModelIdNo description yet.
schedulerClientModelIdNo description yet.
schedulerServerModelIdNo description yet.
schedulerSetupServerModelIdNo description yet.
sensorClientModelIdNo description yet.
sensorServerModelIdNo description yet.
sensorSetupServerModelIdNo description yet.
solicitationPduRplConfigurationClientModelIdNo description yet.
solicitationPduRplConfigurationServerModelIdNo description yet.
timeClientModelIdNo description yet.
timeServerModelIdNo description yet.
timeSetupServerModelIdNo description yet.

StaticAcknowledgedMeshMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L155

A base class for acknowledged messages which opcode and the type of the response message are known during compilation time. The message must have the StaticAcknowledgedMeshMessage/responseType specified.

class StaticAcknowledgedMeshMessage extends StaticMeshMessage<this> & AcknowledgedMeshMessage<this>

Constructors

NameSignatureDescription
constructorStaticAcknowledgedMeshMessage(): StaticAcknowledgedMeshMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
responseTypePick<typeof StaticMeshResponse, "fromData" | "opCode">The Type of the response message.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
responseOpCodeunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

StaticAcknowledgedProxyConfigurationMessage

Kind: Class

Source: packages/utils/src/mesh-messages/proxy-configuration-message.ts#L43

A base class static acknowledged proxy configuration messages.

class StaticAcknowledgedProxyConfigurationMessage extends AcknowledgedProxyConfigurationMessage<this> & StaticProxyConfigurationMessage<this>

Constructors

NameSignatureDescription
constructorStaticAcknowledgedProxyConfigurationMessage(): StaticAcknowledgedProxyConfigurationMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
responseTypetypeof StaticProxyConfigurationMessageThe Type of the response message.
opCodeunknownNo description yet.
parametersunknownNo description yet.
responseOpCodeunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

StaticMeshMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L124

A type of a mesh message which opcode is known during compilation time.

class StaticMeshMessage extends MeshMessage

Constructors

NameSignatureDescription
constructorStaticMeshMessage(): StaticMeshMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

StaticMeshResponse

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L141

The base class for response messages with an opcode known at the compilation time.

class StaticMeshResponse extends MeshResponse<this> & StaticUnacknowledgedMeshMessage<this>

Constructors

NameSignatureDescription
constructorStaticMeshResponse(): StaticMeshResponse;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

StaticProxyConfigurationMessage

Kind: Class

Source: packages/utils/src/mesh-messages/proxy-configuration-message.ts#L19

A type of Proxy Configuration message which opcode is known during compilation time.

class StaticProxyConfigurationMessage extends ProxyConfigurationMessage

Constructors

NameSignatureDescription
constructorStaticProxyConfigurationMessage(): StaticProxyConfigurationMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodeunknownNo description yet.
parametersunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

StaticUnacknowledgedMeshMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L130

The base class for unacknowledged messages with an opcode known at the compilation time.

class StaticUnacknowledgedMeshMessage extends StaticMeshMessage<this> & UnacknowledgedMeshMessage<this>

Constructors

NameSignatureDescription
constructorStaticUnacknowledgedMeshMessage(): StaticUnacknowledgedMeshMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

StatusMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L206

A mesh message containing the operation status.

class StatusMessage extends MeshMessage

Constructors

NameSignatureDescription
constructorStatusMessage(): StatusMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isSuccessunknownNo description yet.
isVendorMessageunknownNo description yet.
messageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

StepResolution

Kind: Unknown

Source: packages/utils/src/types/step-resolution.ts#L7

Storage

Kind: Class

Source: packages/utils/src/types/storage.ts#L10

Abstract base class for storage engines. Subclasses must implement the core storage methods: get, set, remove, and clear. This class defines the contract for key-value storage with asynchronous access.

class Storage<Value>

Constructors

NameSignatureDescription
constructorStorage<Value>(): Storage<Value>;No description yet.

Methods

NameSignatureDescription
clearclear(): void | Promise<void>;No description yet.
getget(key: string): Value | Promise<Value | undefined> | undefined;No description yet.
loadload(): Data | Promise<Data | undefined> | undefined;No description yet.
removeremove(key: string): void | Promise<void>;No description yet.
savesave(data: Data): boolean | Promise<boolean>;No description yet.
setset(key: string, value: Value): void | Promise<void>;No description yet.

Success

Kind: Class

Source: packages/utils/src/types/result.ts#L3

class Success<T, E>

Constructors

NameSignatureDescription
constructorSuccess<T, E>(value: T): Success<T, E>;No description yet.

Properties

NameTypeDescription
isFailurefalseNo description yet.
isSuccesstrueNo description yet.
valueTNo description yet.

Methods

NameSignatureDescription
flatMapflatMap<U>(fn: (val: T) => Result<U, E>): Result<U, E>;No description yet.
getOrThrowgetOrThrow(): T;No description yet.
mapmap<U>(fn: (val: T) => U): Result<U, E>;No description yet.
mapErrormapError<F>(_fn: (err: E) => F): Result<T, F>;No description yet.

Task

Kind: Class

Source: packages/utils/src/types/task.ts#L10

class Task<T, E>

Constructors

NameSignatureDescription
constructorTask<T, E>(executor: (continuation: Continuation<T, E>) => void | Promise<void>): Task<T, E>;No description yet.

Properties

NameTypeDescription
signalAbortSignalNo description yet.
resultunknownNo description yet.
statusunknownNo description yet.

Methods

NameSignatureDescription
cancelcancel(): void;No description yet.
valuevalue(): Promise<T>;No description yet.
detacheddetached<T, E>(executor: (continuation: Continuation<T, E>) => void | Promise<void>): Task<T, E>;No description yet.
sleepsleep(ms: number): Task<void, never>;No description yet.

TimeInterval

Kind: Type alias

Source: packages/utils/src/types/time-interval.ts#L4

Double

type TimeInterval = Double;

timeIntervalSinceNow

Kind: Function

Source: packages/utils/src/helpers/date.ts#L1

function timeIntervalSinceNow(futureOrPastDateMillis: number): number;

toPaddedHex16

Kind: Function

Source: packages/utils/src/helpers/number.ts#L117

function toPaddedHex16(value: number): string;

toPaddedHex32

Kind: Function

Source: packages/utils/src/helpers/number.ts#L122

function toPaddedHex32(value: number): string;

toPaddedHex64

Kind: Function

Source: packages/utils/src/helpers/number.ts#L128

function toPaddedHex64(value: Long): string;

toPaddedHex64Signed

Kind: Function

Source: packages/utils/src/helpers/number.ts#L133

function toPaddedHex64Signed(value: Long): string;

toPaddedHex8

Kind: Function

Source: packages/utils/src/helpers/number.ts#L112

function toPaddedHex8(value: number): string;

TransactionMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L176

A message with Transaction Identifier. The Transaction Identifier will automatically be set and incremented each time a message is sent. The counter is reused for all types that extend this protocol.

class TransactionMessage extends MeshMessage

Constructors

NameSignatureDescription
constructorTransactionMessage(): TransactionMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
tidnumberTransaction identifier. If not set, this field will automatically be set when the message is being sent or received.
opCodenumberNo description yet.
continueTransactionunknownNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

TransitionMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L233

A base protocol for a message that can initiate a non-immediate state transition.

class TransitionMessage extends MeshMessage

Constructors

NameSignatureDescription
constructorTransitionMessage(): TransitionMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
delayunknownNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.
transitionTimeunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

TransitionStatusMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L221

A base protocol for messages sent as responses to TransitionMessages.

class TransitionStatusMessage extends MeshMessage

Constructors

NameSignatureDescription
constructorTransitionStatusMessage(): TransitionStatusMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
remainingTimeunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

TransitionTime

Kind: Class

Source: packages/utils/src/types/transition-time.ts#L12

This structure represents a time needed to transition from one state to another, for example dimming a light. Internally, it uses steps and step resolution. Thanks to that only some time intervals are possible. Use TransitionTime/interval to get exact time

class TransitionTime

Constructors

NameSignatureDescription
constructorTransitionTime(steps: number, stepResolution: StepResolution): TransitionTime;No description yet.

Properties

NameTypeDescription
stepResolutionStepResolutionThe step resolution.
stepsnumberTransition Number of Steps, 6-bit value. Value 0 indicates an immediate transition. Value 0x3F means that the value is unknown. The state cannot be set to this value, but an element may report an unknown value if a transition is higher than 0x3E or not determined.
immediateTransitionTimeTransition is immediate.
intervalunknownNo description yet.
isImmediateunknownNo description yet.
isKnownunknownNo description yet.
millisecondsunknownNo description yet.
rawValueunknownNo description yet.

Methods

NameSignatureDescription
oror(defaultTransitionTime?: TransitionTime): TransitionTime;No description yet.
toStringtoString(): string;No description yet.
fromIntervalfromInterval(interval: number): TransitionTime;No description yet.
fromRawValuefromRawValue(rawValue: number): TransitionTime;No description yet.
unknownunknown(): TransitionTime;No description yet.

Transport

Kind: Class

Source: packages/utils/src/types/transport.ts#L5

Abstract base class for transport implementations. Provides a static method to retrieve the advertisement data service data key.

class Transport

Constructors

NameSignatureDescription
constructorTransport(): Transport;No description yet.

Properties

NameTypeDescription
AdvertisementDataServiceDataKeyunknownNo description yet.

tryOptionalAsync

Kind: Function

Source: packages/utils/src/helpers/common.ts#L24

function tryOptionalAsync<T>(fn: () => Promise<T>): Promise<T | null>;

typeOf

Kind: Function

Source: packages/utils/src/helpers/common.ts#L11

function typeOf<T>(value: T): string;

UInt16

Kind: Type alias

Source: packages/utils/src/types/number.ts#L16

Represents an unsigned 16-bit integer.

type UInt16 = number;

UInt32

Kind: Type alias

Source: packages/utils/src/types/number.ts#L26

Represents an unsigned 32-bit integer.

type UInt32 = number;

UInt64

Kind: Type alias

Source: packages/utils/src/types/number.ts#L36

Represents an unsigned 64-bit integer using bigint.

type UInt64 = Long;

UInt8

Kind: Type alias

Source: packages/utils/src/types/number.ts#L6

Represents an unsigned 8-bit integer.

type UInt8 = number;

UnacknowledgedConfigMessage

Kind: Class

Source: packages/utils/src/mesh-messages/config-message.ts#L234

A base protocol for unacknowledged Configuration messages. Unacknowledged configuration messages are sent as replies to acknowledged messages.

class UnacknowledgedConfigMessage extends ConfigMessage<this> & UnacknowledgedMeshMessage<this>

Constructors

NameSignatureDescription
constructorUnacknowledgedConfigMessage(): UnacknowledgedConfigMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
encodeencode(indexes: KeyIndex[], limit: number): Data;No description yet.
decodedecode(data: Data, offset: number, limit: number): KeyIndex[];No description yet.
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

UnacknowledgedMeshMessage

Kind: Class

Source: packages/utils/src/mesh-messages/mesh-message.ts#L110

The base class for unacknowledged messages.

class UnacknowledgedMeshMessage extends MeshMessage

Constructors

NameSignatureDescription
constructorUnacknowledgedMeshMessage(): UnacknowledgedMeshMessage;No description yet.

Properties

NameTypeDescription
opCodenumberThe message Op Code.
opCodenumberNo description yet.
isAcknowledgedunknownNo description yet.
isSegmentedunknownNo description yet.
isVendorMessageunknownNo description yet.
parametersunknownNo description yet.
securityunknownNo description yet.

Methods

NameSignatureDescription
fromDatafromData(_parameters: Data): BaseMeshMessage | undefined;No description yet.

unpackInt16BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L55

function unpackInt16BE(bytes: Uint8Array<ArrayBufferLike> | number[], offset: number, safe: boolean): number;

unpackInt16LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L9

function unpackInt16LE(bytes: Uint8Array<ArrayBufferLike> | number[], offset: number, safe: boolean): number;

unpackInt32BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L81

function unpackInt32BE(bytes: Uint8Array<ArrayBufferLike> | number[], offset: number, safe: boolean): number;

unpackInt32LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L31

function unpackInt32LE(bytes: Uint8Array<ArrayBufferLike> | number[], offset: number, safe: boolean): number;

unpackUInt16BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L68

function unpackUInt16BE(bytes: Uint8Array<ArrayBufferLike> | number[], offset: number, safe: boolean): number;

unpackUInt16LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L20

function unpackUInt16LE(bytes: Uint8Array<ArrayBufferLike> | number[], offset: number, safe: boolean): number;

unpackUInt32BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L94

function unpackUInt32BE(bytes: Uint8Array<ArrayBufferLike> | number[], offset: number, safe: boolean): number;

unpackUInt32LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L42

function unpackUInt32LE(bytes: Uint8Array<ArrayBufferLike> | number[], offset: number, safe: boolean): number;

UserDefaults

Kind: Class

Source: packages/utils/src/types/user-defaults.ts#L10

class UserDefaults

Methods

NameSignatureDescription
clearclear(): Promise<void>;No description yet.
getget<T>(key: string, parser?: (v: unknown) => T): Promise<T | undefined>;No description yet.
lastSeqAuthValuelastSeqAuthValue(source: Address): Promise<Long | undefined>;No description yet.
nextSequenceNumbernextSequenceNumber(source: Address): Promise<number>;No description yet.
previousSeqAuthValuepreviousSeqAuthValue(source: Address): Promise<Long | undefined>;No description yet.
registerregister(defaults: Record<string, StorageValue>): Promise<void>;No description yet.
removeremove(key: string): Promise<void>;No description yet.
removeSeqAuthValuesOfAddressremoveSeqAuthValuesOfAddress(source: Address): Promise<void>;No description yet.
removeSeqAuthValuesOfNoderemoveSeqAuthValuesOfNode(node: { elements: { unicastAddress: Address }[] }): Promise<void>;No description yet.
removeSequenceNumberremoveSequenceNumber(source: Address): Promise<void>;No description yet.
resetSequenceNumbersresetSequenceNumbers(node: { elements: { unicastAddress: Address }[] }): Promise<void>;No description yet.
setset<T>(key: string, value: T): Promise<void>;No description yet.
storeLastSeqAuthValuestoreLastSeqAuthValue(value: Long, source: Address): Promise<void>;No description yet.
storePreviousSeqAuthValuestorePreviousSeqAuthValue(value: Long, source: Address): Promise<void>;No description yet.
instanceinstance(suiteName: string, storage: Storage): UserDefaults;No description yet.

UUID

Kind: Class

Source: packages/utils/src/types/uuid.ts#L12

Represents a universally unique identifier (UUID) with Swift-like API

class UUID

Constructors

NameSignatureDescription
constructorUUID($uuidString: string): UUID;No description yet.

Properties

NameTypeDescription
$uuidStringstringOptional UUID string (default: random v4 UUID)
bytesunknownNo description yet.
hexunknownNo description yet.
uuidStringunknownNo description yet.

Methods

NameSignatureDescription
equalequal(other: UUID): boolean;No description yet.
toStringtoString(): string;No description yet.
fromBluetoothUuidStringfromBluetoothUuidString(uuidString: string): UUID | undefined;No description yet.
fromHexfromHex(hex: string): UUID | undefined;No description yet.
fromUuidStringfromUuidString(uuidString: string): UUID | undefined;No description yet.
isBluetoothUUIDisBluetoothUUID(str: string): boolean;No description yet.
isValidUUIDStringisValidUUIDString(uuidString: string): boolean;No description yet.
randomrandom(): UUID;No description yet.

uuidToHex

Kind: Function

Source: packages/utils/src/helpers/uuid.ts#L4

function uuidToHex(uuid: string): string;

uuidToUint8Array

Kind: Function

Source: packages/utils/src/helpers/uuid.ts#L16

function uuidToUint8Array(uuid: string): Uint8Array;

writeInt16BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L58

function writeInt16BE(n: number, out: Uint8Array, offset: number, clamp: boolean): number;

writeInt16LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L12

function writeInt16LE(n: number, out: Uint8Array, offset: number, clamp: boolean): number;

writeInt32BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L84

function writeInt32BE(n: number, out: Uint8Array, offset: number, clamp: boolean): number;

writeInt32LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L34

function writeInt32LE(n: number, out: Uint8Array, offset: number, clamp: boolean): number;

writeUInt16BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L71

function writeUInt16BE(n: number, out: Uint8Array, offset: number, clamp: boolean): number;

writeUInt16LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L23

function writeUInt16LE(n: number, out: Uint8Array, offset: number, clamp: boolean): number;

writeUInt32BE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L97

function writeUInt32BE(n: number, out: Uint8Array, offset: number, clamp: boolean): number;

writeUInt32LE

Kind: Function

Source: packages/utils/src/helpers/number.ts#L45

function writeUInt32LE(n: number, out: Uint8Array, offset: number, clamp: boolean): number;

xorUint8Arrays

Kind: Function

Source: packages/utils/src/helpers/data.ts#L37

function xorUint8Arrays(a: Uint8Array, b: Uint8Array): Uint8Array;

On this page

Package overviewExport mapExported APIAccessErrorPropertiesMethodsAcknowledgedConfigMessageConstructorsPropertiesMethodsAcknowledgedMeshMessageConstructorsPropertiesMethodsAcknowledgedProxyConfigurationMessageConstructorsPropertiesMethodsAddressConstructorsPropertiesMethodsAlgorithmassertArrayassertBooleanassertDirectInstanceOfassertEnumCaseAssertionTypeDescriptionassertNumberassertObjectassertStringAttentionTimerHandlerConstructorsMethodsBackgroundTimerConstructorsPropertiesMethodsBaseMeshMessageConstructorsPropertiesMethodsBigUIntConstructorsPropertiesMethodsBindableTinyEmitterConstructorsMethodsbitArrayToUint8ArrayBleErrorConstructorsPropertiesMethodscalculateHMAC_SHA256calculateSharedSecretCancellationErrorConstructorsPropertiesMethodsCBCentralManagerConstructorsPropertiesMethodsCBCentralManagerHandlerConstructorsMethodsCBCentralManagerStateMembersCBCharacteristicConstructorsPropertiesMethodsCBCharacteristicPropertiesMembersCBCharacteristicWriteTypeMembersCBPeripheralConstructorsPropertiesMethodsCBPeripheralHandlerConstructorsMethodsCBPeripheralStateMembersCBServiceConstructorsPropertiesCBUUIDConstructorsPropertiesMethodschunkedMapClassClosedRangeConstructorsPropertiesMethodsCompanyIdentifierConfigAnyModelMessageConstructorsPropertiesMethodsConfigAppKeyMessageConstructorsPropertiesMethodsConfigElementMessageConstructorsPropertiesMethodsConfigMessageConstructorsPropertiesMethodsConfigMessageStatusConfigModelMessageConstructorsPropertiesMethodsConfigNetAndAppKeyMessageConstructorsPropertiesMethodsConfigNetKeyMessageConstructorsPropertiesMethodsConfigResponseConstructorsPropertiesMethodsConfigStatusMessageConstructorsPropertiesMethodsDatadataViewToUint8ArrayDecodingErrorConstructorsPropertiesMethodsdecryptAesCcmDispatchQueueConstructorsPropertiesMethodsDoubleencryptAesCcmencryptAesEcbExportConfigurationMembersFailureConstructorsPropertiesMethodsgenerateElGamalKeyPairgetEnumKeysgetEnumValuesgetSecureRandomBytesHeartbeatSubscriptionConstructorsPropertiesMethodsHexhexToUuidimportKeyFromPrivateInt16Int32Int64Int8isArrayisDirectInstanceOfisEnumCaseisFunctionisNullisNumberisObjectisValidUuidIvIndexConstructorsPropertiesMethodsKeyConstructorsPropertiesKeyIndexConstructorsPropertiesMethodsKeyRefreshPhaseKeySetConstructorsPropertiesLocalProvisionerUuidKeyLocationLogCategoryMembersLoggerHandlerConstructorsMethodsLogLevelPropertiesMethodslongMinMeshCDBMeshMessageConstructorsPropertiesMethodsMeshMessageSecurityMembersMeshNetworkErrorPropertiesMethodsMeshProvisioningServicePropertiesMethodsMeshProxyServicePropertiesMethodsMeshResponseConstructorsPropertiesMethodsMeshServiceConstructorsPropertiesmeshTimestampNSNullOobInformationConstructorsPropertiesMethodsOptionSetConstructorsPropertiesMethodspackInt16BEpackInt16LEpackInt32BEpackInt32LEpackUInt16BEpackUInt16LEpackUInt32BEpackUInt32LEProxyConfigurationMessageConstructorsPropertiesMethodsProxyFilterEventHandlerMethodsProxyFilterHandlerConstructorsMethodsProxyFilterSetupProxyFilterSetupTypeMembersProxyFilterTypeRangeObjectConstructorsPropertiesMethodsreadUInt16BEreadUInt16LEreadUInt32BEreadUInt32LEResultSceneNumberConstructorsPropertiesMethodsSigModelIdMembersStaticAcknowledgedMeshMessageConstructorsPropertiesMethodsStaticAcknowledgedProxyConfigurationMessageConstructorsPropertiesMethodsStaticMeshMessageConstructorsPropertiesMethodsStaticMeshResponseConstructorsPropertiesMethodsStaticProxyConfigurationMessageConstructorsPropertiesMethodsStaticUnacknowledgedMeshMessageConstructorsPropertiesMethodsStatusMessageConstructorsPropertiesMethodsStepResolutionStorageConstructorsMethodsSuccessConstructorsPropertiesMethodsTaskConstructorsPropertiesMethodsTimeIntervaltimeIntervalSinceNowtoPaddedHex16toPaddedHex32toPaddedHex64toPaddedHex64SignedtoPaddedHex8TransactionMessageConstructorsPropertiesMethodsTransitionMessageConstructorsPropertiesMethodsTransitionStatusMessageConstructorsPropertiesMethodsTransitionTimeConstructorsPropertiesMethodsTransportConstructorsPropertiestryOptionalAsynctypeOfUInt16UInt32UInt64UInt8UnacknowledgedConfigMessageConstructorsPropertiesMethodsUnacknowledgedMeshMessageConstructorsPropertiesMethodsunpackInt16BEunpackInt16LEunpackInt32BEunpackInt32LEunpackUInt16BEunpackUInt16LEunpackUInt32BEunpackUInt32LEUserDefaultsMethodsUUIDConstructorsPropertiesMethodsuuidToHexuuidToUint8ArraywriteInt16BEwriteInt16LEwriteInt32BEwriteInt32LEwriteUInt16BEwriteUInt16LEwriteUInt32BEwriteUInt32LExorUint8Arrays