@matter/protocol
Advanced tools
Comparing version 0.11.5-alpha.0-20241116-c923f6d75 to 0.11.5-alpha.0-20241117-8798960f0
@@ -78,2 +78,6 @@ "use strict"; | ||
endpoint.verifyRequiredClusters(); | ||
const endpointId = endpoint.number; | ||
if (this.endpoints.has(endpoint.number)) { | ||
throw new import_general.ImplementationError(`Endpoint ID ${endpoint.number} exists twice`); | ||
} | ||
for (const cluster of endpoint.getAllClusterServers()) { | ||
@@ -88,3 +92,3 @@ const { | ||
const attribute = clusterAttributes[name]; | ||
const path = { endpointId: endpoint.number, clusterId, attributeId: attribute.id }; | ||
const path = { endpointId, clusterId, attributeId: attribute.id }; | ||
this.attributes.set((0, import_InteractionServer.attributePathToId)(path), attribute); | ||
@@ -95,3 +99,3 @@ this.attributePaths.push(path); | ||
const event = clusterEvents[name]; | ||
const path = { endpointId: endpoint.number, clusterId, eventId: event.id }; | ||
const path = { endpointId, clusterId, eventId: event.id }; | ||
this.events.set((0, import_InteractionServer.eventPathToId)(path), event); | ||
@@ -102,3 +106,3 @@ this.eventPaths.push(path); | ||
const command = clusterCommands[name]; | ||
const path = { endpointId: endpoint.number, clusterId, commandId: command.invokeId }; | ||
const path = { endpointId, clusterId, commandId: command.invokeId }; | ||
this.commands.set((0, import_InteractionServer.commandPathToId)(path), command); | ||
@@ -108,5 +112,3 @@ this.commandPaths.push(path); | ||
} | ||
if (this.endpoints.has(endpoint.number)) | ||
throw new import_general.ImplementationError(`Endpoint ID ${endpoint.number} exists twice`); | ||
this.endpoints.set(endpoint.number, endpoint); | ||
this.endpoints.set(endpointId, endpoint); | ||
} | ||
@@ -113,0 +115,0 @@ toHex(value) { |
@@ -392,5 +392,5 @@ "use strict"; | ||
this.sendUpdateErrorCounter++; | ||
logger.error( | ||
logger.info( | ||
`Error sending subscription update message (error count=${this.sendUpdateErrorCounter}):`, | ||
error | ||
error instanceof import_general.MatterError ? error.message : error | ||
); | ||
@@ -409,3 +409,3 @@ if (this.sendUpdateErrorCounter <= 2) { | ||
} else { | ||
logger.error( | ||
logger.info( | ||
`Sending update failed 3 times in a row, canceling subscription ${this.id} and let controller subscribe again.` | ||
@@ -412,0 +412,0 @@ ); |
@@ -349,5 +349,10 @@ "use strict"; | ||
try { | ||
this.onMessage(socket, data).catch((error) => logger.error(error)); | ||
this.onMessage(socket, data).catch( | ||
(error) => logger.info(error instanceof import_general.MatterError ? error.message : error) | ||
); | ||
} catch (error) { | ||
logger.warn("Ignoring UDP message with error", error); | ||
logger.info( | ||
"Ignoring UDP message with error", | ||
error instanceof import_general.MatterError ? error.message : error | ||
); | ||
} | ||
@@ -354,0 +359,0 @@ }) |
@@ -76,2 +76,6 @@ /** | ||
endpoint.verifyRequiredClusters(); | ||
const endpointId = endpoint.number; | ||
if (this.endpoints.has(endpoint.number)) { | ||
throw new ImplementationError(`Endpoint ID ${endpoint.number} exists twice`); | ||
} | ||
for (const cluster of endpoint.getAllClusterServers()) { | ||
@@ -86,3 +90,3 @@ const { | ||
const attribute = clusterAttributes[name]; | ||
const path = { endpointId: endpoint.number, clusterId, attributeId: attribute.id }; | ||
const path = { endpointId, clusterId, attributeId: attribute.id }; | ||
this.attributes.set(attributePathToId(path), attribute); | ||
@@ -93,3 +97,3 @@ this.attributePaths.push(path); | ||
const event = clusterEvents[name]; | ||
const path = { endpointId: endpoint.number, clusterId, eventId: event.id }; | ||
const path = { endpointId, clusterId, eventId: event.id }; | ||
this.events.set(eventPathToId(path), event); | ||
@@ -100,3 +104,3 @@ this.eventPaths.push(path); | ||
const command = clusterCommands[name]; | ||
const path = { endpointId: endpoint.number, clusterId, commandId: command.invokeId }; | ||
const path = { endpointId, clusterId, commandId: command.invokeId }; | ||
this.commands.set(commandPathToId(path), command); | ||
@@ -106,5 +110,3 @@ this.commandPaths.push(path); | ||
} | ||
if (this.endpoints.has(endpoint.number)) | ||
throw new ImplementationError(`Endpoint ID ${endpoint.number} exists twice`); | ||
this.endpoints.set(endpoint.number, endpoint); | ||
this.endpoints.set(endpointId, endpoint); | ||
} | ||
@@ -111,0 +113,0 @@ toHex(value) { |
@@ -9,2 +9,3 @@ /** | ||
Logger, | ||
MatterError, | ||
MaybePromise, | ||
@@ -382,5 +383,5 @@ NetworkError, | ||
this.sendUpdateErrorCounter++; | ||
logger.error( | ||
logger.info( | ||
`Error sending subscription update message (error count=${this.sendUpdateErrorCounter}):`, | ||
error | ||
error instanceof MatterError ? error.message : error | ||
); | ||
@@ -399,3 +400,3 @@ if (this.sendUpdateErrorCounter <= 2) { | ||
} else { | ||
logger.error( | ||
logger.info( | ||
`Sending update failed 3 times in a row, canceling subscription ${this.id} and let controller subscribe again.` | ||
@@ -402,0 +403,0 @@ ); |
@@ -334,5 +334,10 @@ /** | ||
try { | ||
this.onMessage(socket, data).catch((error) => logger.error(error)); | ||
this.onMessage(socket, data).catch( | ||
(error) => logger.info(error instanceof MatterError ? error.message : error) | ||
); | ||
} catch (error) { | ||
logger.warn("Ignoring UDP message with error", error); | ||
logger.info( | ||
"Ignoring UDP message with error", | ||
error instanceof MatterError ? error.message : error | ||
); | ||
} | ||
@@ -339,0 +344,0 @@ }) |
{ | ||
"name": "@matter/protocol", | ||
"version": "0.11.5-alpha.0-20241116-c923f6d75", | ||
"version": "0.11.5-alpha.0-20241117-8798960f0", | ||
"description": "Low-level APIs for Matter interaction", | ||
@@ -43,10 +43,10 @@ "keywords": [ | ||
"dependencies": { | ||
"@matter/general": "0.11.5-alpha.0-20241116-c923f6d75", | ||
"@matter/model": "0.11.5-alpha.0-20241116-c923f6d75", | ||
"@matter/types": "0.11.5-alpha.0-20241116-c923f6d75", | ||
"@matter/general": "0.11.5-alpha.0-20241117-8798960f0", | ||
"@matter/model": "0.11.5-alpha.0-20241117-8798960f0", | ||
"@matter/types": "0.11.5-alpha.0-20241117-8798960f0", | ||
"@noble/curves": "^1.5.0" | ||
}, | ||
"devDependencies": { | ||
"@matter/tools": "0.11.5-alpha.0-20241116-c923f6d75", | ||
"@matter/testing": "0.11.5-alpha.0-20241116-c923f6d75" | ||
"@matter/tools": "0.11.5-alpha.0-20241117-8798960f0", | ||
"@matter/testing": "0.11.5-alpha.0-20241117-8798960f0" | ||
}, | ||
@@ -53,0 +53,0 @@ "files": [ |
@@ -114,2 +114,7 @@ /** | ||
const endpointId = endpoint.number; | ||
if (this.endpoints.has(endpoint.number)) { | ||
throw new ImplementationError(`Endpoint ID ${endpoint.number} exists twice`); | ||
} | ||
for (const cluster of endpoint.getAllClusterServers()) { | ||
@@ -126,3 +131,3 @@ const { | ||
const attribute = clusterAttributes[name]; | ||
const path = { endpointId: endpoint.number, clusterId, attributeId: attribute.id }; | ||
const path = { endpointId, clusterId, attributeId: attribute.id }; | ||
this.attributes.set(attributePathToId(path), attribute); | ||
@@ -135,3 +140,3 @@ this.attributePaths.push(path); | ||
const event = clusterEvents[name]; | ||
const path = { endpointId: endpoint.number, clusterId, eventId: event.id }; | ||
const path = { endpointId, clusterId, eventId: event.id }; | ||
this.events.set(eventPathToId(path), event); | ||
@@ -144,3 +149,3 @@ this.eventPaths.push(path); | ||
const command = clusterCommands[name]; | ||
const path = { endpointId: endpoint.number, clusterId, commandId: command.invokeId }; | ||
const path = { endpointId, clusterId, commandId: command.invokeId }; | ||
this.commands.set(commandPathToId(path), command); | ||
@@ -151,6 +156,3 @@ this.commandPaths.push(path); | ||
if (this.endpoints.has(endpoint.number)) | ||
throw new ImplementationError(`Endpoint ID ${endpoint.number} exists twice`); | ||
this.endpoints.set(endpoint.number, endpoint); | ||
this.endpoints.set(endpointId, endpoint); | ||
} | ||
@@ -157,0 +159,0 @@ |
@@ -10,2 +10,3 @@ /** | ||
Logger, | ||
MatterError, | ||
MaybePromise, | ||
@@ -572,5 +573,5 @@ NetworkError, | ||
this.sendUpdateErrorCounter++; | ||
logger.error( | ||
logger.info( | ||
`Error sending subscription update message (error count=${this.sendUpdateErrorCounter}):`, | ||
error, | ||
error instanceof MatterError ? error.message : error, | ||
); | ||
@@ -590,3 +591,3 @@ if (this.sendUpdateErrorCounter <= 2) { | ||
} else { | ||
logger.error( | ||
logger.info( | ||
`Sending update failed 3 times in a row, canceling subscription ${this.id} and let controller subscribe again.`, | ||
@@ -593,0 +594,0 @@ ); |
@@ -422,5 +422,10 @@ /** | ||
try { | ||
this.onMessage(socket, data).catch(error => logger.error(error)); | ||
this.onMessage(socket, data).catch(error => | ||
logger.info(error instanceof MatterError ? error.message : error), | ||
); | ||
} catch (error) { | ||
logger.warn("Ignoring UDP message with error", error); | ||
logger.info( | ||
"Ignoring UDP message with error", | ||
error instanceof MatterError ? error.message : error, | ||
); | ||
} | ||
@@ -427,0 +432,0 @@ }), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3879181
67249
+ Added@matter/general@0.11.5-alpha.0-20241117-8798960f0(transitive)
+ Added@matter/model@0.11.5-alpha.0-20241117-8798960f0(transitive)
+ Added@matter/types@0.11.5-alpha.0-20241117-8798960f0(transitive)
- Removed@matter/general@0.11.5-alpha.0-20241116-c923f6d75(transitive)
- Removed@matter/model@0.11.5-alpha.0-20241116-c923f6d75(transitive)
- Removed@matter/types@0.11.5-alpha.0-20241116-c923f6d75(transitive)