Skip to content

Commit

Permalink
'dependency bump, corrections to cli README, GetPresetTour(s)'
Browse files Browse the repository at this point in the history
  • Loading branch information
faithoflifedev committed Nov 30, 2023
1 parent 927a4d5 commit a62ecac
Show file tree
Hide file tree
Showing 24 changed files with 756 additions and 95 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.1.3+4

* dependency bump
* corrections to cli README
* PTZ
* GetPresetTour
* GetPresetTours

## 2.1.3+3

* accept null values in ProbeMatch
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To use this package in your code, first add the dependency to your project:
```yml
dependencies:
...
easy_onvif: ^2.1.3+3
easy_onvif: ^2.1.3+4
```
If you need additional help getting started with dart, check out these [guides](https://dart.dev/guides).
Expand Down Expand Up @@ -260,6 +260,8 @@ Please see the cli documentation [README.md](https://github.com/faithoflifedev/e
| GetConfigurationOptions | getConfigurationOptions | `Future<PtzConfigurationOptions>` | [x\] |
| GetConfigurations | getConfigurations | `Future<List<PtzConfiguration>>` | [x\] |
| GetPresets | getPresets | `Future<List<Preset>>` | [x\] |
| GetPresetTour | getPresetTour | `Future<PresetTour>` | [ \] |
| GetPresetTours | getPresetTours | `Future<List<PresetTours>>` | [ \] |
| GetServiceCapabilities | getServiceCapabilities | `Future<Capabilities>` | [x\] |
| GetStatus | getStatus | `Future<PtzStatus>` | [x\] |
| GotoHomePosition | gotoHomePosition | `Future<bool>` | [x\] |
Expand Down Expand Up @@ -323,17 +325,17 @@ The values returned by the Onvif API `GetDeviceInformation` call.
| Manufacturer | Model | Known Issue |
| ------------------ | -------------- | -------------------------------- |
| Happytimesoft | IPCamera | limited capabilities |
| D-Link Corporation | DCS-6511 | commands not implemented&#x00B9; |
| ONVIF | ENP1A14-IR/25X | commands not implemented&#x00B2; |
| ONVIF | ENP1A14-IR/25X | commands not implemented&#x00B9; |
| D-Link Corporation | DCS-6511 | commands not implemented&#x00B2; |
| NONE | GX728MF-IR28 | commands not implemented&#x00B3; |
| LOREX | LNB4421SB | testing in progress |

&#x00B9; The following are not implemented for the ENP1A14-IR/25X:
&#x00B9; The ENP1A14-IR/25X does not support the following commands:
* Recordings
* `CreateRecording`
* `DeleteRecording`

&#x00B2; The following are not implemented for the DCS-6511:
&#x00B2; The DCS-6511 does not support the following commands:
* Device Management:
* `GetServices`
* `GetServiceCapabilities`
Expand All @@ -346,7 +348,7 @@ The values returned by the Onvif API `GetDeviceInformation` call.
* PTZ:
* not tested

&#x00B3; The following are not implemented for the GX728MF-IR28:
&#x00B3; The GX728MF-IR28 does not support the following commands:
* Device Management:
* `GetSystemUris`
* Media1:
Expand Down
157 changes: 124 additions & 33 deletions bin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -864,25 +864,33 @@ Usage: onvif ptz <subcommand> [arguments]
-h, --help Print this usage information.
Available subcommands:
absolute-move Operation to move pan,tilt or zoom to a absolute destination.
continuous-move Operation for continuous Pan/Tilt and Zoom movements.
get-configuration Get a specific PTZconfiguration from the device, identified by its reference token or name.
get-configurations Get all the existing PTZConfigurations from the device.
get-presets Operation to request all PTZ presets for the PTZNode in the selected profile.
get-status Operation to request PTZ status for the Node in the selected profile.
goto-preset Operation to go to a saved preset position for the PTZNode in the selected profile.
move Operation for Relative Pan/Tilt and Zoom Move, without Zoom.
move-down Operation for a single step tilt down operation.
move-left Operation for a single step pan left operation.
move-right Operation for a single step tilt upwards operation
move-up Operation for a single step tilt upwards operation.
relative-move Operation for Relative Pan/Tilt and Zoom Move.
remove-preset Operation to remove a PTZ preset for the Node in the selected profile.
set-preset The SetPreset command saves the current device position parameters so that the device can move to the saved preset position through the GotoPreset operation.
stop Operation to stop ongoing pan, tilt and zoom movements of absolute relative and continuous type.
zoom Operation for zoom.
zoom-in Operation for a single step zoom in operation.
zoom-out Operation for a single step zoom out operation.
absolute-move Operation to move pan,tilt or zoom to a absolute destination.
continuous-move Operation for continuous Pan/Tilt and Zoom movements.
get-compatible-configurations Contains the token of an existing media profile the configurations shall be compatible with.
get-configuration Get a specific PTZconfiguration from the device, identified by its reference token or name.
get-configuration-options Token of an existing configuration that the options are intended for.
get-configurations Get all the existing PTZConfigurations from the device.
get-current-preset Helper function to get the matching preset for the current PtzPosition and Zoom if there is a match
get-preset-tour Operation to request a specific PTZ preset tour in the selected media profile.
get-preset-tours Operation to request PTZ preset tours in the selected media profiles.
get-presets Operation to request all PTZ presets for the PTZNode in the selected profile.
get-service-capabilities Returns the capabilities of the PTZ service. The result is returned in a typed answer.
get-status Operation to request PTZ status for the Node in the selected profile.
goto-home-position Operation to move the PTZ device to it's "home" position. The operation is supported if the HomeSupported element in the PTZNode is true.
goto-preset Operation to go to a saved preset position for the PTZNode in the selected profile.
move Operation for Relative Pan/Tilt Move without Zoom.
move-down Operation for a single step tilt down operation.
move-left Operation for a single step pan left operation.
move-right Operation for a single step pan right operation
move-up Operation for a single step tilt upwards operation.
relative-move Operation for Relative Pan/Tilt and Zoom Move.
remove-preset Operation to remove a PTZ preset for the Node in the selected profile.
set-home-position Operation to save current position as the home position. The SetHomePosition command returns with a failure if the “home” position is fixed and cannot be overwritten. If the SetHomePosition is successful, it is possible to recall the Home Position with the GotoHomePosition command.
set-preset The SetPreset command saves the current device position parameters so that the device can move to the saved preset position through the GotoPreset operation.
stop Operation to stop ongoing pan, tilt and zoom movements of absolute relative and continuous type.
zoom Operation for zoom.
zoom-in Operation for a single step zoom in operation.
zoom-out Operation for a single step zoom out operation.
```

#### ptz absolute-move
Expand Down Expand Up @@ -919,6 +927,20 @@ Usage: onvif ptz continuous-move [arguments]
--pan-tilt-zoom=<double> (mandatory) A Position vector specifying the absolute target position zoom.
```

### ptz get-compatible-configurations

```sh
onvif ptz get-compatible-configurations --help
```

```text
Contains the token of an existing media profile the configurations shall be compatible with.
Usage: onvif ptz get-compatible-configurations [arguments]
-h, --help Print this usage information.
-t, --profile-token=<token> (mandatory) The ProfileToken element indicates the media profile to use and will define the source and dimensions of the snapshot.
```

#### ptz get-configuration

```sh
Expand All @@ -933,6 +955,20 @@ Usage: onvif ptz get-configuration [arguments]
-t, --ptz-configuration-token=<token> (mandatory) Token of the requested PTZConfiguration.
```

#### ptz get-configuration-options

```sh
onvif ptz get-configuration-options --help
```

```text
List supported coordinate systems including their range limitations.
Usage: onvif ptz get-configuration-options [arguments]
-h, --help Print this usage information.
-t, --configuration-token=<token> (mandatory) Token of an existing configuration that the options are intended for.
```

#### ptz get-configurations

```sh
Expand All @@ -946,6 +982,49 @@ Usage: onvif ptz get-configurations [arguments]
-h, --help Print this usage information.
```

#### ptz get-current-preset

```sh
onvif ptz get-current-preset --help
```

```text
Helper function to get the matching preset for the current PtzPosition and Zoom if there is a match
Usage: onvif ptz get-current-preset [arguments]
-h, --help Print this usage information.
-t, --profile-token=<token> (mandatory) The ProfileToken element indicates the media profile to use and will define the source and dimensions of the snapshot.
```

#### ptz get-preset-tour

```sh
onvif ptz get-preset-tour --help
```

```text
Operation to request a specific PTZ preset tour in the selected media profile.
Usage: onvif ptz get-preset-tour [arguments]
-h, --help Print this usage information.
-t, --profile-token=<token> (mandatory) A reference to the MediaProfile where the operation should take place.
--preset-tour-token=<token> (mandatory) A requested preset tour token.
```

#### ptz get-preset-tours

```sh
onvif ptz get-preset-tours --help
```

```text
Operation to request PTZ preset tours in the selected media profiles.
Usage: onvif ptz get-preset-tours [arguments]
-h, --help Print this usage information.
-t, --profile-token=<token> (mandatory) A reference to the MediaProfile where the operation should take place.
```

#### ptz get-presets

```sh
Expand All @@ -961,6 +1040,18 @@ Usage: onvif ptz get-presets [arguments]
--limit=<int> Limit the number of presets returned
```

#### ptz get-service-capabilities

```sh
onvif ptz get-service-capabilities --help
```

```text
Returns the capabilities of the PTZ service. The result is returned in a typed answer.
Usage: onvif ptz get-service-capabilities [arguments]
```

#### ptz get-status

```sh
Expand Down Expand Up @@ -1098,6 +1189,20 @@ Usage: onvif ptz remove-preset [arguments]
--preset-token=<preset-token> (mandatory) A requested preset token.
```

#### ptz set-home-position

```sh
onvif ptz set-home-position --help
```

```text
Operation to save current position as the home position. The SetHomePosition command returns with a failure if the “home” position is fixed and cannot be overwritten. If the SetHomePosition is successful, it is possible to recall the Home Position with the GotoHomePosition command.
Usage: onvif ptz set-home-position [arguments]
-h, --help Print this usage information.
-t, --profile-token=<profile-token> (mandatory) A reference to the MediaProfile where the operation should be set.
```

#### ptz set-preset

```sh
Expand Down Expand Up @@ -1174,20 +1279,6 @@ Usage: onvif ptz zoom-out [arguments]
--step=<int> The amount of movement for the step.
```

#### ptz get-current-preset

```sh
onvif ptz get-current-preset --help
```

```text
Helper function to get the matching preset for the current PtzPosition and Zoom if there is a match
Usage: onvif ptz get-current-preset [arguments]
-h, --help Print this usage information.
-t, --profile-token=<token> (mandatory) The ProfileToken element indicates the media profile to use and will define the source and dimensions of the snapshot.
```

### recordings

```sh
Expand Down
2 changes: 1 addition & 1 deletion lib/meta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
import 'dart:convert' show json;

final pubSpec = json.decode(
'{"name":"easy_onvif","version":"2.1.3+3","homepage":"https://github.com/faithoflifedev/easy_onvif","environment":{"sdk":">=3.0.0 <4.0.0"},"description":"A pure Dart library designed primarily for command line automation of Onvif compatible devices, but can be used anywhere Dart is used.","dependencies":{"args":"^2.4.2","crypto":"^3.0.3","dio":"^5.3.3","ffi":"^2.1.0","html_unescape":"^2.0.0","intl":"^0.18.1","json_annotation":"^4.8.1","loggy":"^2.0.3","path":"^1.8.3","shelf":"^1.4.1","shelf_router":"^1.1.4","sprintf":"^7.0.0","universal_io":"^2.2.2","uuid":"^4.1.0","xml":"^6.3.0","xml2json":"^6.2.0","yaml":"^3.1.2"},"dev_dependencies":{"build_runner":"^2.4.5","grinder":"^0.9.4","json_serializable":"^6.7.1","lints":"^3.0.0","mustache_template":"^2.0.0","process_run":"^0.13.0","pub_semver":"^2.1.4","publish_tools":"^0.1.0+12","pubspec":"^2.3.0","test":"^1.24.8"},"executables":{"onvif":""},"repository":"https://github.com/faithoflifedev/easy_onvif.git"}');
'{"name":"easy_onvif","version":"2.1.3+4","homepage":"https://github.com/faithoflifedev/easy_onvif","environment":{"sdk":">=3.0.0 <4.0.0"},"description":"A pure Dart library designed primarily for command line automation of Onvif compatible devices, but can be used anywhere Dart is used.","dependencies":{"args":"^2.4.2","crypto":"^3.0.3","dio":"^5.4.0","ffi":"^2.1.0","html_unescape":"^2.0.0","intl":"^0.18.1","json_annotation":"^4.8.1","loggy":"^2.0.3","path":"^1.8.3","shelf":"^1.4.1","shelf_router":"^1.1.4","sprintf":"^7.0.0","universal_io":"^2.2.2","uuid":"^4.2.1","xml":"^6.3.0","xml2json":"^6.2.1","yaml":"^3.1.2"},"dev_dependencies":{"build_runner":"^2.4.7","grinder":"^0.9.5","json_serializable":"^6.7.1","lints":"^3.0.0","mustache_template":"^2.0.0","process_run":"^0.13.0","pub_semver":"^2.1.4","publish_tools":"^0.1.0+12","pubspec":"^2.3.0","test":"^1.24.9"},"executables":{"onvif":""},"repository":"https://github.com/faithoflifedev/easy_onvif.git"}');
6 changes: 6 additions & 0 deletions lib/ptz.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ export 'src/model/ptz/get_configuration_response.dart';
export 'src/model/ptz/get_configuration_options_response.dart';
export 'src/model/ptz/get_configurations_response.dart';
export 'src/model/ptz/get_presets_response.dart';
export 'src/model/ptz/get_preset_tour_response.dart';
export 'src/model/ptz/get_preset_tours_response.dart';
export 'src/model/ptz/get_service_capabilities_response.dart';
export 'src/model/ptz/get_status_response.dart';
export 'src/model/ptz/modal_options.dart';
export 'src/model/ptz/preset.dart';
export 'src/model/ptz/preset_tour.dart';
export 'src/model/ptz/pt_control_direction.dart';
export 'src/model/ptz/ptz_configuration_options.dart';
export 'src/model/ptz/ptz_position.dart';
export 'src/model/ptz/ptz_preset_tour_spot.dart';
export 'src/model/ptz/ptz_preset_tour_starting_condition.dart';
export 'src/model/ptz/ptz_preset_tour_status.dart';
export 'src/model/ptz/ptz_spaces.dart';
export 'src/model/ptz/ptz_status.dart';
export 'src/model/ptz/set_preset_response.dart';
77 changes: 76 additions & 1 deletion lib/src/cmd/onvif_ptz_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class OnvifPtzCommand extends Command {
addSubcommand(OnvifGetConfigurationsPtzCommand());
addSubcommand(OnvifGetCurrentPresetPtzCommand());
addSubcommand(OnvifGetPresetsPtzCommand());
addSubcommand(OnvifGetPresetTourPtzCommand());
addSubcommand(OnvifGetPresetToursPtzCommand());
addSubcommand(OnvifGetServiceCapabilitiesPtzCommand());
addSubcommand(OnvifGetStatusPtzCommand());
addSubcommand(OnvifGotoHomePositionPtzCommand());
Expand Down Expand Up @@ -253,7 +255,7 @@ class OnvifGetConfigurationPtzCommand extends OnvifHelperCommand {
class OnvifGetConfigurationOptionsPtzCommand extends OnvifHelperCommand {
@override
String get description =>
'Token of an existing configuration that the options are intended for.';
'List supported coordinate systems including their range limitations.';

@override
String get name => 'get-configuration-options';
Expand Down Expand Up @@ -323,6 +325,79 @@ class OnvifGetConfigurationsPtzCommand extends OnvifHelperCommand {
}
}

/// Operation to request a specific PTZ preset tour in the selected media profile.
class OnvifGetPresetTourPtzCommand extends OnvifHelperCommand {
@override
String get description =>
'Operation to request a specific PTZ preset tour in the selected media profile.';

@override
String get name => 'get-preset-tour';

OnvifGetPresetTourPtzCommand() {
argParser
..addOption('profile-token',
abbr: 't',
valueHelp: 'token',
mandatory: true,
help:
'A reference to the MediaProfile where the operation should take place.')
..addOption('preset-tour-token',
valueHelp: 'token',
mandatory: true,
help: 'A requested preset tour token.');
}

@override
void run() async {
await initializeOnvif();

try {
final presetTour = await ptz.getPresetTour(
argResults!['profile-token'],
presetTourToken: argResults!['preset-tour-token'],
);

print(presetTour);
} on DioException catch (err) {
throw UsageException('API usage error:', err.usage);
}
}
}

/// Operation to request PTZ preset tours in the selected media profiles.
class OnvifGetPresetToursPtzCommand extends OnvifHelperCommand {
@override
String get description =>
'Operation to request PTZ preset tours in the selected media profiles.';

@override
String get name => 'get-preset-tours';

OnvifGetPresetToursPtzCommand() {
argParser.addOption('profile-token',
abbr: 't',
valueHelp: 'token',
mandatory: true,
help:
'A reference to the MediaProfile where the operation should take place.');
}

@override
void run() async {
await initializeOnvif();

try {
final presetTours =
await ptz.getPresetTours(argResults!['profile-token']);

print(presetTours);
} on DioException catch (err) {
throw UsageException('API usage error:', err.usage);
}
}
}

/// Operation to request all PTZ presets for the PTZNode in the selected
/// profile. The operation is supported if there is support for at least on PTZ
/// preset by the PTZNode.
Expand Down
Loading

0 comments on commit a62ecac

Please sign in to comment.