@matterbridge/core 3.11.4-dev-20261113-8c3f732 → 3.11.4-dev-20261116-a92c40e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ import { NodeStorageManager } from 'node-persist-manager';
22
22
  import { addVirtualDevice } from './helpers.js';
23
23
  import { bridge } from './matterbridgeDeviceTypes.js';
24
24
  import { setupLoggers } from './matterLogger.js';
25
- import { deleteAdvertisingNode, getServerNodeData, rootCameraEndpoint, rootCameraOptions, setAdvertisingNode, toDevice } from './matterNodeHelpers.js';
25
+ import { deleteAdvertisingNode, getServerNodeData, rootCameraEndpoint, rootCameraOptions, setAdvertisingNode, toDevice, truncateUtf8 } from './matterNodeHelpers.js';
26
26
  import { startMatterStorage, stopMatterStorage } from './matterStorage.js';
27
27
  import { PluginManager } from './pluginManager.js';
28
28
  logModuleLoaded('MatterNode');
@@ -479,7 +479,7 @@ export class MatterNode extends EventEmitter {
479
479
  discriminator: validDiscriminator,
480
480
  },
481
481
  productDescription: {
482
- name: await this.matterStorageContext.get('deviceName'),
482
+ name: truncateUtf8(await this.matterStorageContext.get('deviceName'), 32),
483
483
  deviceType: DeviceTypeId(await this.matterStorageContext.get('deviceType')),
484
484
  vendorId: VendorId(await this.matterStorageContext.get('vendorId')),
485
485
  productId: await this.matterStorageContext.get('productId'),
@@ -24,6 +24,7 @@ export declare function getServerNodeData(serverNode: ServerNode): ApiMatter;
24
24
  export declare function sanitizeFabricInformations(fabricInfo: ExposedFabricInformation[]): SanitizedExposedFabricInformation[];
25
25
  export declare function sanitizeSessionInformation(sessions: SessionsBehavior.Session[]): SanitizedSession[];
26
26
  export declare function getVendorIdName(vendorId: number | undefined): string;
27
+ export declare function truncateUtf8(value: string, maxBytes: number): string;
27
28
  export declare function rootCameraEndpoint(): import("@matter/node").MutableEndpoint.With<import("@matter/node").EndpointType.For<{
28
29
  readonly name: "RootNode";
29
30
  readonly deviceType: 22;
@@ -489,6 +489,17 @@ export function getVendorIdName(vendorId) {
489
489
  }
490
490
  return vendorName;
491
491
  }
492
+ export function truncateUtf8(value, maxBytes) {
493
+ let bytes = 0;
494
+ let result = '';
495
+ for (const character of value) {
496
+ bytes += Buffer.byteLength(character);
497
+ if (bytes > maxBytes)
498
+ break;
499
+ result += character;
500
+ }
501
+ return result;
502
+ }
492
503
  export function rootCameraEndpoint() {
493
504
  return ServerNode.RootEndpoint.with(PowerSourceServer.with(PowerSource.Feature.Wired), MatterbridgeTimeSynchronizationServer, MatterbridgeTlsCertificateManagementServer, MatterbridgeTlsClientManagementServer);
494
505
  }
@@ -33,7 +33,7 @@ import { bridge } from './matterbridgeDeviceTypes.js';
33
33
  import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
34
34
  import { startController } from './matterController.js';
35
35
  import { matterToAnsiLogLevel } from './matterLogger.js';
36
- import { clearAdvertisingNodes, deleteAdvertisingNode, getServerNodeData, rootCameraEndpoint, rootCameraOptions, setAdvertisingNode } from './matterNodeHelpers.js';
36
+ import { clearAdvertisingNodes, deleteAdvertisingNode, getServerNodeData, rootCameraEndpoint, rootCameraOptions, setAdvertisingNode, truncateUtf8 } from './matterNodeHelpers.js';
37
37
  import { PluginManager } from './pluginManager.js';
38
38
  logModuleLoaded('Matterbridge');
39
39
  export class Matterbridge extends EventEmitter {
@@ -2052,8 +2052,10 @@ export class Matterbridge extends EventEmitter {
2052
2052
  discriminator,
2053
2053
  },
2054
2054
  productDescription: {
2055
- name: await storageContext.get('deviceName'),
2055
+ name: truncateUtf8(await storageContext.get('deviceName'), 32),
2056
2056
  deviceType: DeviceTypeId(await storageContext.get('deviceType')),
2057
+ vendorId: VendorId(await storageContext.get('vendorId')),
2058
+ productId: await storageContext.get('productId'),
2057
2059
  },
2058
2060
  basicInformation: {
2059
2061
  nodeLabel: await storageContext.get('nodeLabel'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matterbridge/core",
3
- "version": "3.11.4-dev-20261113-8c3f732",
3
+ "version": "3.11.4-dev-20261116-a92c40e",
4
4
  "description": "Matterbridge core library",
5
5
  "author": "https://github.com/Luligu",
6
6
  "homepage": "https://matterbridge.io/",
@@ -136,10 +136,10 @@
136
136
  },
137
137
  "dependencies": {
138
138
  "@matter/main": "0.18.0",
139
- "@matterbridge/dgram": "3.11.4-dev-20261113-8c3f732",
140
- "@matterbridge/thread": "3.11.4-dev-20261113-8c3f732",
141
- "@matterbridge/types": "3.11.4-dev-20261113-8c3f732",
142
- "@matterbridge/utils": "3.11.4-dev-20261113-8c3f732",
139
+ "@matterbridge/dgram": "3.11.4-dev-20261116-a92c40e",
140
+ "@matterbridge/thread": "3.11.4-dev-20261116-a92c40e",
141
+ "@matterbridge/types": "3.11.4-dev-20261116-a92c40e",
142
+ "@matterbridge/utils": "3.11.4-dev-20261116-a92c40e",
143
143
  "escape-html": "1.0.3",
144
144
  "express": "5.3.0",
145
145
  "express-rate-limit": "8.7.4",