-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ptz absolute-move cli command params better match the Onvif spec
- Loading branch information
1 parent
4d3f1b3
commit bc743e4
Showing
20 changed files
with
420 additions
and
644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:easy_onvif/src/soap/authorization.dart'; | ||
import 'package:easy_onvif/src/soap/xmlns.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'package:xml/xml.dart'; | ||
|
||
import 'username_token.dart'; | ||
|
||
class Security { | ||
@JsonKey(name: 'UsernameToken') | ||
final UsernameToken usernameToken; | ||
|
||
final int mustUnderstand; | ||
|
||
Security({ | ||
required this.usernameToken, | ||
required this.mustUnderstand, | ||
}); | ||
|
||
XmlDocumentFragment toXml(XmlBuilder builder, Authorization authorization) { | ||
builder.element( | ||
'Security', | ||
namespaces: {Xmlns.s: 's'}, | ||
nest: () { | ||
builder.namespace( | ||
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'); | ||
|
||
builder.attribute( | ||
'mustUnderstand', | ||
mustUnderstand, | ||
namespace: Xmlns.s, | ||
); | ||
|
||
usernameToken.toXml(builder, authorization); | ||
}, | ||
); | ||
|
||
return builder.buildFragment(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:easy_onvif/src/soap/authorization.dart'; | ||
import 'package:xml/xml.dart'; | ||
|
||
class UsernameToken { | ||
Authorization? authorization; | ||
|
||
XmlDocumentFragment toXml(XmlBuilder builder, Authorization authorization) { | ||
builder.element('UsernameToken', nest: () { | ||
builder.element('Username', nest: authorization.authInfo.username); | ||
builder.element('Password', | ||
attributes: { | ||
'Type': | ||
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest' | ||
}, | ||
nest: authorization.digest); | ||
builder.element('Nonce', | ||
attributes: { | ||
'EncodingType': | ||
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary' | ||
}, | ||
nest: authorization.nonce.toBase64()); | ||
builder.element('Created', nest: () { | ||
builder.namespace( | ||
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'); | ||
builder.text(authorization.utcTimeStamp); | ||
}); | ||
}); | ||
|
||
return builder.buildFragment(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.