File: StorageManager_1_0_2.pm

package info (click to toggle)
raritan-json-rpc-sdk 3.6.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 41,748 kB
  • sloc: cs: 162,629; perl: 85,818; python: 24,275; javascript: 5,937; makefile: 21
file content (211 lines) | stat: -rw-r--r-- 6,449 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from StorageManager.idl.

use strict;

package Raritan::RPC::webcam::StorageManager_1_0_2;

use parent qw(Raritan::RPC::RemoteObject);

use constant typeId => "webcam.StorageManager:1.0.2";

sub new {
    my ($class, $agent, $rid, $typeId) = @_;
    $typeId = $typeId || Raritan::RPC::webcam::StorageManager_1_0_2::typeId;
    return $class->SUPER::new($agent, $rid, $typeId);
}

use constant NO_ERROR => 0;

use constant ERR_INVALID_PARAM => 1;

use constant ERR_INIT_IN_PROGRESS => 2;

use constant ERR_ALREADY_RUNNING => 3;

use constant ERR_TOO_LARGE => 4;

use constant ERR_OPERATION_NOT_SUPPORTED => 5;


sub getSupportedStorageTypes($) {
    my ($self) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    my $rsp = $agent->json_rpc($self->{'rid'}, 'getSupportedStorageTypes', $args);
    my $_ret_;
    $_ret_ = [];
    for (my $i0 = 0; $i0 <= $#{$rsp->{'_ret_'}}; $i0++) {
        $_ret_->[$i0] = $rsp->{'_ret_'}->[$i0];
    }
    return $_ret_;
}

use Raritan::RPC::webcam::StorageManager_1_0_2::StorageInformation;

sub getInformation($) {
    my ($self) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    my $rsp = $agent->json_rpc($self->{'rid'}, 'getInformation', $args);
    my $_ret_;
    $_ret_ = Raritan::RPC::webcam::StorageManager_1_0_2::StorageInformation::decode($agent, $rsp->{'_ret_'});
    return $_ret_;
}

use Raritan::RPC::webcam::StorageManager_1_0_2::StorageSettings;

sub getSettings($) {
    my ($self) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    my $rsp = $agent->json_rpc($self->{'rid'}, 'getSettings', $args);
    my $_ret_;
    $_ret_ = Raritan::RPC::webcam::StorageManager_1_0_2::StorageSettings::decode($agent, $rsp->{'_ret_'});
    return $_ret_;
}

use Raritan::RPC::webcam::StorageManager_1_0_2::StorageSettings;

sub setSettings($$) {
    my ($self, $settings) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'settings'} = Raritan::RPC::webcam::StorageManager_1_0_2::StorageSettings::encode($settings);
    my $rsp = $agent->json_rpc($self->{'rid'}, 'setSettings', $args);
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}

use Raritan::RPC::webcam::Image_2_0_0;

sub addImage($$$$) {
    my ($self, $webcam, $image, $index) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'webcam'} = Raritan::RPC::ObjectCodec::encode($webcam);
    $args->{'image'} = Raritan::RPC::webcam::Image_2_0_0::encode($image);
    my $rsp = $agent->json_rpc($self->{'rid'}, 'addImage', $args);
    $$index = $rsp->{'index'};
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}


sub removeImages($$$$$) {
    my ($self, $webcam, $start, $count, $direction) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'webcam'} = Raritan::RPC::ObjectCodec::encode($webcam);
    $args->{'start'} = 1 * $start;
    $args->{'count'} = 1 * $count;
    $args->{'direction'} = $direction;
    my $rsp = $agent->json_rpc($self->{'rid'}, 'removeImages', $args);
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}

use Raritan::RPC::webcam::StorageManager_1_0_2::ImageStorageMetaData;

sub getMetaData($$$$$$) {
    my ($self, $webcam, $start, $count, $direction, $meta) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'webcam'} = Raritan::RPC::ObjectCodec::encode($webcam);
    $args->{'start'} = 1 * $start;
    $args->{'count'} = 1 * $count;
    $args->{'direction'} = $direction;
    my $rsp = $agent->json_rpc($self->{'rid'}, 'getMetaData', $args);
    $$meta = [];
    for (my $i0 = 0; $i0 <= $#{$rsp->{'meta'}}; $i0++) {
        $$meta->[$i0] = Raritan::RPC::webcam::StorageManager_1_0_2::ImageStorageMetaData::decode($agent, $rsp->{'meta'}->[$i0]);
    }
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}

use Raritan::RPC::webcam::StorageManager_1_0_2::StorageImage;

sub getImages($$$$$$) {
    my ($self, $webcam, $start, $count, $direction, $image) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'webcam'} = Raritan::RPC::ObjectCodec::encode($webcam);
    $args->{'start'} = 1 * $start;
    $args->{'count'} = 1 * $count;
    $args->{'direction'} = $direction;
    my $rsp = $agent->json_rpc($self->{'rid'}, 'getImages', $args);
    $$image = [];
    for (my $i0 = 0; $i0 <= $#{$rsp->{'image'}}; $i0++) {
        $$image->[$i0] = Raritan::RPC::webcam::StorageManager_1_0_2::StorageImage::decode($agent, $rsp->{'image'}->[$i0]);
    }
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}

use Raritan::RPC::webcam::StorageManager_1_0_2::Activity;

sub getActivities($) {
    my ($self) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    my $rsp = $agent->json_rpc($self->{'rid'}, 'getActivities', $args);
    my $_ret_;
    $_ret_ = [];
    for (my $i0 = 0; $i0 <= $#{$rsp->{'_ret_'}}; $i0++) {
        $_ret_->[$i0] = Raritan::RPC::webcam::StorageManager_1_0_2::Activity::decode($agent, $rsp->{'_ret_'}->[$i0]);
    }
    return $_ret_;
}


sub startActivity($$$$) {
    my ($self, $webcam, $count, $interval) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'webcam'} = Raritan::RPC::ObjectCodec::encode($webcam);
    $args->{'count'} = 1 * $count;
    $args->{'interval'} = 1 * $interval;
    my $rsp = $agent->json_rpc($self->{'rid'}, 'startActivity', $args);
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}


sub startActivityWithFolder($$$$$) {
    my ($self, $webcam, $count, $interval, $folder) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'webcam'} = Raritan::RPC::ObjectCodec::encode($webcam);
    $args->{'count'} = 1 * $count;
    $args->{'interval'} = 1 * $interval;
    $args->{'folder'} = "$folder";
    my $rsp = $agent->json_rpc($self->{'rid'}, 'startActivityWithFolder', $args);
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}


sub stopActivity($$) {
    my ($self, $webcam) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'webcam'} = Raritan::RPC::ObjectCodec::encode($webcam);
    my $rsp = $agent->json_rpc($self->{'rid'}, 'stopActivity', $args);
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}

Raritan::RPC::Registry::registerProxyClass('webcam.StorageManager', 1, 0, 2, 'Raritan::RPC::webcam::StorageManager_1_0_2');
1;