File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
packages/protocol/src/protocol-thp Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
- import { ThpDeviceProperties } from './messages' ;
1
+ import { ThpCredentials , ThpDeviceProperties } from './messages' ;
2
2
3
3
export type ThpStateSerialized = {
4
4
properties ?: ThpDeviceProperties ;
5
+ credentials : ThpCredentials [ ] ;
5
6
} ;
6
7
7
8
export class ThpState {
8
9
private _properties ?: ThpDeviceProperties ;
10
+ private _pairingCredentials : ThpCredentials [ ] = [ ] ;
9
11
10
12
get properties ( ) {
11
13
return this . _properties ;
@@ -15,9 +17,22 @@ export class ThpState {
15
17
this . _properties = props ;
16
18
}
17
19
20
+ get pairingCredentials ( ) {
21
+ return this . _pairingCredentials ;
22
+ }
23
+
24
+ setPairingCredentials ( credentials ?: ThpCredentials [ ] ) {
25
+ if ( credentials ) {
26
+ this . _pairingCredentials . push ( ...credentials ) ;
27
+ } else {
28
+ this . _pairingCredentials = [ ] ;
29
+ }
30
+ }
31
+
18
32
serialize ( ) : ThpStateSerialized {
19
33
return {
20
34
properties : this . _properties ,
35
+ credentials : this . _pairingCredentials ,
21
36
} ;
22
37
}
23
38
}
You can’t perform that action at this time.
0 commit comments