Skip to content

Commit

Permalink
Fix:
Browse files Browse the repository at this point in the history
1. The value type of twin could not be written as "integer" but "int".
2. Add notice for opcua usage.
  • Loading branch information
sailorvii committed Apr 1, 2022
1 parent 5d1270d commit 2500fe6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build/crd-samples/devices/modbusrtu-device-instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ status:
reported:
metadata:
timestamp: '1550049403598'
type: integer
type: int
value: "1"
desired:
metadata:
timestamp: '1550049403598'
type: integer
type: int
value: "1"
4 changes: 2 additions & 2 deletions build/crd-samples/devices/modbustcp-device-instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ status:
reported:
metadata:
timestamp: '1550049403598'
type: integer
type: int
value: "0"
desired:
metadata:
timestamp: '1550049403598'
type: integer
type: int
value: "0"
2 changes: 1 addition & 1 deletion build/crd-samples/devices/opcua-device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ status:
reported:
metadata:
timestamp: '1550049403598'
type: integer
type: int
value: "0"
20 changes: 20 additions & 0 deletions mappers/opcua/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ Please configuration the device instance and device model. You could refer to th
Float
Double
- The get device status function "driver.GetStatus" should be written depending the device.

# Notice

There's a bug about gopcua library. https://github.com/gopcua/opcua/issues/410. The source code is at:
https://github.com/gopcua/opcua/blob/main/uasc/secure_channel_crypto.go#L67

If you want to use username&password mode, please modify the file as this:
vendor/github.com/gopcua/opcua/uasc/secure_channel_crypto.go#67:

```
67 func (s *SecureChannel) EncryptUserPassword(policyURI, password string, cert, nonce []byte) ([]byte, string, error) {
68 // If the User ID Token's policy was null, then default to the secure channel's policy
69 if policyURI == "" {
70 policyURI = s.cfg.SecurityPolicyURI
71 }
72
73 if policyURI == ua.SecurityPolicyURINone {
74 return []byte(password), "", nil
75 }
```

0 comments on commit 2500fe6

Please sign in to comment.