Skip to content

Commit

Permalink
feat: support learn mode (#7135)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Sep 6, 2024
1 parent afaabc8 commit d6c3906
Show file tree
Hide file tree
Showing 31 changed files with 32,855 additions and 295 deletions.
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,29 @@
"sourceMaps": true
// "preLaunchTask": "npm: build"
},
{
"type": "node",
"request": "launch",
"name": "Debug primary and secondary",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"node",
"--async-stack-traces",
"-r",
"./maintenance/esbuild-register.js",
"--conditions=@@dev",
"${workspaceFolder}/test/run_duplex.ts"
],
"env": {
"NODE_ENV": "development"
// "NO_CACHE": "true"
// "LOGLEVEL": "info"
},
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true
// "preLaunchTask": "npm: build"
},
{
"type": "node",
"request": "launch",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/CCs/FirmwareUpdateMetaData.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async reportMetaData(
```ts
async requestUpdate(
options: FirmwareUpdateMetaDataCCRequestGetOptions,
): Promise<FirmwareUpdateRequestStatus>;
): Promise<FirmwareUpdateInitResult>;
```

Requests the device to start the firmware update process.
Expand Down
12 changes: 12 additions & 0 deletions docs/api/CCs/Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ The return value indicates whether a nonce was successfully sent.
async getSecurityScheme(): Promise<[0]>;
```

### `reportSecurityScheme`

```ts
async reportSecurityScheme(encapsulated: boolean): Promise<void>;
```

### `inheritSecurityScheme`

```ts
Expand All @@ -48,6 +54,12 @@ async inheritSecurityScheme(): Promise<void>;
async setNetworkKey(networkKey: Buffer): Promise<void>;
```

### `verifyNetworkKey`

```ts
async verifyNetworkKey(): Promise<void>;
```

### `getSupportedCommands`

```ts
Expand Down
51 changes: 47 additions & 4 deletions docs/api/CCs/Security2.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ async reportSupportedCommands(
async getKeyExchangeParameters(): Promise<Pick<Security2CCKEXReport, "requestCSA" | "echo" | "supportedKEXSchemes" | "supportedECDHProfiles" | "requestedKeys" | "_reserved"> | undefined>;
```

### `requestKeys`

```ts
async requestKeys(
params: Omit<Security2CCKEXReportOptions, "echo">,
): Promise<void>;
```

Requests the given keys from an including node.

### `grantKeys`

```ts
Expand All @@ -73,15 +83,25 @@ async grantKeys(

Grants the joining node the given keys.

### `confirmGrantedKeys`
### `confirmRequestedKeys`

```ts
async confirmGrantedKeys(
async confirmRequestedKeys(
params: Omit<Security2CCKEXReportOptions, "echo">,
): Promise<void>;
```

Confirms the keys that were granted to a node.
Confirms the keys that were requested by a node.

### `confirmGrantedKeys`

```ts
async confirmGrantedKeys(
params: Omit<Security2CCKEXSetOptions, "echo">,
): Promise<Security2CCKEXReport | Security2CCKEXFail | undefined>;
```

Confirms the keys that were granted by the including node.

### `abortKeyExchange`

Expand All @@ -94,7 +114,18 @@ Notifies the other node that the ongoing key exchange was aborted.
### `sendPublicKey`

```ts
async sendPublicKey(publicKey: Buffer): Promise<void>;
async sendPublicKey(
publicKey: Buffer,
includingNode: boolean = true,
): Promise<void>;
```

### `requestNetworkKey`

```ts
async requestNetworkKey(
securityClass: SecurityClass,
): Promise<void>;
```

### `sendNetworkKey`
Expand All @@ -106,8 +137,20 @@ async sendNetworkKey(
): Promise<void>;
```

### `verifyNetworkKey`

```ts
async verifyNetworkKey(): Promise<void>;
```

### `confirmKeyVerification`

```ts
async confirmKeyVerification(): Promise<void>;
```

### `endKeyExchange`

```ts
async endKeyExchange(): Promise<void>;
```
Loading

0 comments on commit d6c3906

Please sign in to comment.