1#[derive(Clone, PartialEq, ::prost::Message)]
2pub struct TakePhotoRequest {}
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct TakePhotoResponse {
5 #[prost(message, optional, tag = "1")]
6 pub camera_result: ::core::option::Option<CameraResult>,
7}
8#[derive(Clone, PartialEq, ::prost::Message)]
9pub struct StartPhotoIntervalRequest {
10 #[prost(float, tag = "1")]
12 pub interval_s: f32,
13}
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct StartPhotoIntervalResponse {
16 #[prost(message, optional, tag = "1")]
17 pub camera_result: ::core::option::Option<CameraResult>,
18}
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct StopPhotoIntervalRequest {}
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct StopPhotoIntervalResponse {
23 #[prost(message, optional, tag = "1")]
24 pub camera_result: ::core::option::Option<CameraResult>,
25}
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct StartVideoRequest {}
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct StartVideoResponse {
30 #[prost(message, optional, tag = "1")]
31 pub camera_result: ::core::option::Option<CameraResult>,
32}
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct StopVideoRequest {}
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct StopVideoResponse {
37 #[prost(message, optional, tag = "1")]
38 pub camera_result: ::core::option::Option<CameraResult>,
39}
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct StartVideoStreamingRequest {}
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct StartVideoStreamingResponse {
44 #[prost(message, optional, tag = "1")]
45 pub camera_result: ::core::option::Option<CameraResult>,
46}
47#[derive(Clone, PartialEq, ::prost::Message)]
48pub struct StopVideoStreamingRequest {}
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct StopVideoStreamingResponse {
51 #[prost(message, optional, tag = "1")]
52 pub camera_result: ::core::option::Option<CameraResult>,
53}
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct SetModeRequest {
56 #[prost(enumeration = "Mode", tag = "1")]
58 pub mode: i32,
59}
60#[derive(Clone, PartialEq, ::prost::Message)]
61pub struct SetModeResponse {
62 #[prost(message, optional, tag = "1")]
63 pub camera_result: ::core::option::Option<CameraResult>,
64}
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct SubscribeInformationRequest {}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct InformationResponse {
69 #[prost(message, optional, tag = "1")]
71 pub information: ::core::option::Option<Information>,
72}
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct SubscribeModeRequest {}
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct ModeResponse {
77 #[prost(enumeration = "Mode", tag = "1")]
79 pub mode: i32,
80}
81#[derive(Clone, PartialEq, ::prost::Message)]
82pub struct SubscribeVideoStreamInfoRequest {}
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct VideoStreamInfoResponse {
85 #[prost(message, optional, tag = "1")]
87 pub video_stream_info: ::core::option::Option<VideoStreamInfo>,
88}
89#[derive(Clone, PartialEq, ::prost::Message)]
90pub struct SubscribeCaptureInfoRequest {}
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct CaptureInfoResponse {
93 #[prost(message, optional, tag = "1")]
95 pub capture_info: ::core::option::Option<CaptureInfo>,
96}
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct SubscribeStatusRequest {}
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct StatusResponse {
101 #[prost(message, optional, tag = "1")]
103 pub camera_status: ::core::option::Option<Status>,
104}
105#[derive(Clone, PartialEq, ::prost::Message)]
106pub struct SubscribeCurrentSettingsRequest {}
107#[derive(Clone, PartialEq, ::prost::Message)]
108pub struct CurrentSettingsResponse {
109 #[prost(message, repeated, tag = "1")]
111 pub current_settings: ::prost::alloc::vec::Vec<Setting>,
112}
113#[derive(Clone, PartialEq, ::prost::Message)]
114pub struct SubscribePossibleSettingOptionsRequest {}
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct PossibleSettingOptionsResponse {
117 #[prost(message, repeated, tag = "1")]
119 pub setting_options: ::prost::alloc::vec::Vec<SettingOptions>,
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct SetSettingRequest {
123 #[prost(message, optional, tag = "1")]
125 pub setting: ::core::option::Option<Setting>,
126}
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct SetSettingResponse {
129 #[prost(message, optional, tag = "1")]
130 pub camera_result: ::core::option::Option<CameraResult>,
131}
132#[derive(Clone, PartialEq, ::prost::Message)]
133pub struct GetSettingRequest {
134 #[prost(message, optional, tag = "1")]
136 pub setting: ::core::option::Option<Setting>,
137}
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct GetSettingResponse {
140 #[prost(message, optional, tag = "1")]
141 pub camera_result: ::core::option::Option<CameraResult>,
142 #[prost(message, optional, tag = "2")]
144 pub setting: ::core::option::Option<Setting>,
145}
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct FormatStorageRequest {}
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct FormatStorageResponse {
150 #[prost(message, optional, tag = "1")]
151 pub camera_result: ::core::option::Option<CameraResult>,
152}
153#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct CameraResult {
156 #[prost(enumeration = "camera_result::Result", tag = "1")]
158 pub result: i32,
159 #[prost(string, tag = "2")]
161 pub result_str: ::prost::alloc::string::String,
162}
163pub mod camera_result {
165 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
167 #[repr(i32)]
168 pub enum Result {
169 Unknown = 0,
171 Success = 1,
173 InProgress = 2,
175 Busy = 3,
177 Denied = 4,
179 Error = 5,
181 Timeout = 6,
183 WrongArgument = 7,
185 }
186}
187#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct Position {
190 #[prost(double, tag = "1")]
192 pub latitude_deg: f64,
193 #[prost(double, tag = "2")]
195 pub longitude_deg: f64,
196 #[prost(float, tag = "3")]
198 pub absolute_altitude_m: f32,
199 #[prost(float, tag = "4")]
201 pub relative_altitude_m: f32,
202}
203#[derive(Clone, PartialEq, ::prost::Message)]
213pub struct Quaternion {
214 #[prost(float, tag = "1")]
216 pub w: f32,
217 #[prost(float, tag = "2")]
219 pub x: f32,
220 #[prost(float, tag = "3")]
222 pub y: f32,
223 #[prost(float, tag = "4")]
225 pub z: f32,
226}
227#[derive(Clone, PartialEq, ::prost::Message)]
235pub struct EulerAngle {
236 #[prost(float, tag = "1")]
238 pub roll_deg: f32,
239 #[prost(float, tag = "2")]
241 pub pitch_deg: f32,
242 #[prost(float, tag = "3")]
244 pub yaw_deg: f32,
245}
246#[derive(Clone, PartialEq, ::prost::Message)]
248pub struct CaptureInfo {
249 #[prost(message, optional, tag = "1")]
251 pub position: ::core::option::Option<Position>,
252 #[prost(message, optional, tag = "2")]
254 pub attitude_quaternion: ::core::option::Option<Quaternion>,
255 #[prost(message, optional, tag = "3")]
257 pub attitude_euler_angle: ::core::option::Option<EulerAngle>,
258 #[prost(uint64, tag = "4")]
260 pub time_utc_us: u64,
261 #[prost(bool, tag = "5")]
263 pub is_success: bool,
264 #[prost(int32, tag = "6")]
266 pub index: i32,
267 #[prost(string, tag = "7")]
269 pub file_url: ::prost::alloc::string::String,
270}
271#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct VideoStreamSettings {
274 #[prost(float, tag = "1")]
276 pub frame_rate_hz: f32,
277 #[prost(uint32, tag = "2")]
279 pub horizontal_resolution_pix: u32,
280 #[prost(uint32, tag = "3")]
282 pub vertical_resolution_pix: u32,
283 #[prost(uint32, tag = "4")]
285 pub bit_rate_b_s: u32,
286 #[prost(uint32, tag = "5")]
288 pub rotation_deg: u32,
289 #[prost(string, tag = "6")]
291 pub uri: ::prost::alloc::string::String,
292}
293#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct VideoStreamInfo {
296 #[prost(message, optional, tag = "1")]
298 pub settings: ::core::option::Option<VideoStreamSettings>,
299 #[prost(enumeration = "video_stream_info::Status", tag = "2")]
301 pub status: i32,
302}
303pub mod video_stream_info {
305 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
307 #[repr(i32)]
308 pub enum Status {
309 NotRunning = 0,
311 InProgress = 1,
313 }
314}
315#[derive(Clone, PartialEq, ::prost::Message)]
317pub struct Status {
318 #[prost(bool, tag = "1")]
320 pub video_on: bool,
321 #[prost(bool, tag = "2")]
323 pub photo_interval_on: bool,
324 #[prost(float, tag = "3")]
326 pub used_storage_mib: f32,
327 #[prost(float, tag = "4")]
329 pub available_storage_mib: f32,
330 #[prost(float, tag = "5")]
332 pub total_storage_mib: f32,
333 #[prost(float, tag = "6")]
335 pub recording_time_s: f32,
336 #[prost(string, tag = "7")]
338 pub media_folder_name: ::prost::alloc::string::String,
339 #[prost(enumeration = "status::StorageStatus", tag = "8")]
341 pub storage_status: i32,
342}
343pub mod status {
345 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
347 #[repr(i32)]
348 pub enum StorageStatus {
349 NotAvailable = 0,
351 Unformatted = 1,
353 Formatted = 2,
355 }
356}
357#[derive(Clone, PartialEq, ::prost::Message)]
359pub struct Option {
360 #[prost(string, tag = "1")]
362 pub option_id: ::prost::alloc::string::String,
363 #[prost(string, tag = "2")]
365 pub option_description: ::prost::alloc::string::String,
366}
367#[derive(Clone, PartialEq, ::prost::Message)]
369pub struct Setting {
370 #[prost(string, tag = "1")]
372 pub setting_id: ::prost::alloc::string::String,
373 #[prost(string, tag = "2")]
375 pub setting_description: ::prost::alloc::string::String,
376 #[prost(message, optional, tag = "3")]
378 pub option: ::core::option::Option<Option>,
379 #[prost(bool, tag = "4")]
381 pub is_range: bool,
382}
383#[derive(Clone, PartialEq, ::prost::Message)]
385pub struct SettingOptions {
386 #[prost(string, tag = "1")]
388 pub setting_id: ::prost::alloc::string::String,
389 #[prost(string, tag = "2")]
391 pub setting_description: ::prost::alloc::string::String,
392 #[prost(message, repeated, tag = "3")]
394 pub options: ::prost::alloc::vec::Vec<Option>,
395 #[prost(bool, tag = "4")]
397 pub is_range: bool,
398}
399#[derive(Clone, PartialEq, ::prost::Message)]
401pub struct Information {
402 #[prost(string, tag = "1")]
404 pub vendor_name: ::prost::alloc::string::String,
405 #[prost(string, tag = "2")]
407 pub model_name: ::prost::alloc::string::String,
408}
409#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
411#[repr(i32)]
412pub enum Mode {
413 Unknown = 0,
415 Photo = 1,
417 Video = 2,
419}
420#[doc = r" Generated client implementations."]
421pub mod camera_service_client {
422 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
423 use tonic::codegen::*;
424 #[doc = ""]
425 #[doc = " Can be used to manage cameras that implement the MAVLink"]
426 #[doc = " Camera Protocol: https://mavlink.io/en/protocol/camera.html."]
427 #[doc = ""]
428 #[doc = " Currently only a single camera is supported."]
429 #[doc = " When multiple cameras are supported the plugin will need to be"]
430 #[doc = " instantiated separately for every camera and the camera selected using"]
431 #[doc = " `select_camera`."]
432 #[derive(Debug, Clone)]
433 pub struct CameraServiceClient<T> {
434 inner: tonic::client::Grpc<T>,
435 }
436 impl CameraServiceClient<tonic::transport::Channel> {
437 #[doc = r" Attempt to create a new client by connecting to a given endpoint."]
438 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
439 where
440 D: std::convert::TryInto<tonic::transport::Endpoint>,
441 D::Error: Into<StdError>,
442 {
443 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
444 Ok(Self::new(conn))
445 }
446 }
447 impl<T> CameraServiceClient<T>
448 where
449 T: tonic::client::GrpcService<tonic::body::BoxBody>,
450 T::ResponseBody: Body + Send + Sync + 'static,
451 T::Error: Into<StdError>,
452 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
453 {
454 pub fn new(inner: T) -> Self {
455 let inner = tonic::client::Grpc::new(inner);
456 Self { inner }
457 }
458 pub fn with_interceptor<F>(
459 inner: T,
460 interceptor: F,
461 ) -> CameraServiceClient<InterceptedService<T, F>>
462 where
463 F: tonic::service::Interceptor,
464 T: tonic::codegen::Service<
465 http::Request<tonic::body::BoxBody>,
466 Response = http::Response<
467 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
468 >,
469 >,
470 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
471 Into<StdError> + Send + Sync,
472 {
473 CameraServiceClient::new(InterceptedService::new(inner, interceptor))
474 }
475 #[doc = r" Compress requests with `gzip`."]
476 #[doc = r""]
477 #[doc = r" This requires the server to support it otherwise it might respond with an"]
478 #[doc = r" error."]
479 pub fn send_gzip(mut self) -> Self {
480 self.inner = self.inner.send_gzip();
481 self
482 }
483 #[doc = r" Enable decompressing responses with `gzip`."]
484 pub fn accept_gzip(mut self) -> Self {
485 self.inner = self.inner.accept_gzip();
486 self
487 }
488 #[doc = ""]
489 #[doc = " Take one photo."]
490 pub async fn take_photo(
491 &mut self,
492 request: impl tonic::IntoRequest<super::TakePhotoRequest>,
493 ) -> Result<tonic::Response<super::TakePhotoResponse>, tonic::Status> {
494 self.inner.ready().await.map_err(|e| {
495 tonic::Status::new(
496 tonic::Code::Unknown,
497 format!("Service was not ready: {}", e.into()),
498 )
499 })?;
500 let codec = tonic::codec::ProstCodec::default();
501 let path =
502 http::uri::PathAndQuery::from_static("/mavsdk.rpc.camera.CameraService/TakePhoto");
503 self.inner.unary(request.into_request(), path, codec).await
504 }
505 #[doc = ""]
506 #[doc = " Start photo timelapse with a given interval."]
507 pub async fn start_photo_interval(
508 &mut self,
509 request: impl tonic::IntoRequest<super::StartPhotoIntervalRequest>,
510 ) -> Result<tonic::Response<super::StartPhotoIntervalResponse>, tonic::Status> {
511 self.inner.ready().await.map_err(|e| {
512 tonic::Status::new(
513 tonic::Code::Unknown,
514 format!("Service was not ready: {}", e.into()),
515 )
516 })?;
517 let codec = tonic::codec::ProstCodec::default();
518 let path = http::uri::PathAndQuery::from_static(
519 "/mavsdk.rpc.camera.CameraService/StartPhotoInterval",
520 );
521 self.inner.unary(request.into_request(), path, codec).await
522 }
523 #[doc = ""]
524 #[doc = " Stop a running photo timelapse."]
525 pub async fn stop_photo_interval(
526 &mut self,
527 request: impl tonic::IntoRequest<super::StopPhotoIntervalRequest>,
528 ) -> Result<tonic::Response<super::StopPhotoIntervalResponse>, tonic::Status> {
529 self.inner.ready().await.map_err(|e| {
530 tonic::Status::new(
531 tonic::Code::Unknown,
532 format!("Service was not ready: {}", e.into()),
533 )
534 })?;
535 let codec = tonic::codec::ProstCodec::default();
536 let path = http::uri::PathAndQuery::from_static(
537 "/mavsdk.rpc.camera.CameraService/StopPhotoInterval",
538 );
539 self.inner.unary(request.into_request(), path, codec).await
540 }
541 #[doc = ""]
542 #[doc = " Start a video recording."]
543 pub async fn start_video(
544 &mut self,
545 request: impl tonic::IntoRequest<super::StartVideoRequest>,
546 ) -> Result<tonic::Response<super::StartVideoResponse>, tonic::Status> {
547 self.inner.ready().await.map_err(|e| {
548 tonic::Status::new(
549 tonic::Code::Unknown,
550 format!("Service was not ready: {}", e.into()),
551 )
552 })?;
553 let codec = tonic::codec::ProstCodec::default();
554 let path =
555 http::uri::PathAndQuery::from_static("/mavsdk.rpc.camera.CameraService/StartVideo");
556 self.inner.unary(request.into_request(), path, codec).await
557 }
558 #[doc = ""]
559 #[doc = " Stop a running video recording."]
560 pub async fn stop_video(
561 &mut self,
562 request: impl tonic::IntoRequest<super::StopVideoRequest>,
563 ) -> Result<tonic::Response<super::StopVideoResponse>, tonic::Status> {
564 self.inner.ready().await.map_err(|e| {
565 tonic::Status::new(
566 tonic::Code::Unknown,
567 format!("Service was not ready: {}", e.into()),
568 )
569 })?;
570 let codec = tonic::codec::ProstCodec::default();
571 let path =
572 http::uri::PathAndQuery::from_static("/mavsdk.rpc.camera.CameraService/StopVideo");
573 self.inner.unary(request.into_request(), path, codec).await
574 }
575 #[doc = ""]
576 #[doc = " Start video streaming."]
577 pub async fn start_video_streaming(
578 &mut self,
579 request: impl tonic::IntoRequest<super::StartVideoStreamingRequest>,
580 ) -> Result<tonic::Response<super::StartVideoStreamingResponse>, tonic::Status> {
581 self.inner.ready().await.map_err(|e| {
582 tonic::Status::new(
583 tonic::Code::Unknown,
584 format!("Service was not ready: {}", e.into()),
585 )
586 })?;
587 let codec = tonic::codec::ProstCodec::default();
588 let path = http::uri::PathAndQuery::from_static(
589 "/mavsdk.rpc.camera.CameraService/StartVideoStreaming",
590 );
591 self.inner.unary(request.into_request(), path, codec).await
592 }
593 #[doc = ""]
594 #[doc = " Stop current video streaming."]
595 pub async fn stop_video_streaming(
596 &mut self,
597 request: impl tonic::IntoRequest<super::StopVideoStreamingRequest>,
598 ) -> Result<tonic::Response<super::StopVideoStreamingResponse>, tonic::Status> {
599 self.inner.ready().await.map_err(|e| {
600 tonic::Status::new(
601 tonic::Code::Unknown,
602 format!("Service was not ready: {}", e.into()),
603 )
604 })?;
605 let codec = tonic::codec::ProstCodec::default();
606 let path = http::uri::PathAndQuery::from_static(
607 "/mavsdk.rpc.camera.CameraService/StopVideoStreaming",
608 );
609 self.inner.unary(request.into_request(), path, codec).await
610 }
611 #[doc = ""]
612 #[doc = " Set camera mode."]
613 pub async fn set_mode(
614 &mut self,
615 request: impl tonic::IntoRequest<super::SetModeRequest>,
616 ) -> Result<tonic::Response<super::SetModeResponse>, tonic::Status> {
617 self.inner.ready().await.map_err(|e| {
618 tonic::Status::new(
619 tonic::Code::Unknown,
620 format!("Service was not ready: {}", e.into()),
621 )
622 })?;
623 let codec = tonic::codec::ProstCodec::default();
624 let path =
625 http::uri::PathAndQuery::from_static("/mavsdk.rpc.camera.CameraService/SetMode");
626 self.inner.unary(request.into_request(), path, codec).await
627 }
628 #[doc = ""]
629 #[doc = " Subscribe to camera mode updates."]
630 pub async fn subscribe_mode(
631 &mut self,
632 request: impl tonic::IntoRequest<super::SubscribeModeRequest>,
633 ) -> Result<tonic::Response<tonic::codec::Streaming<super::ModeResponse>>, tonic::Status>
634 {
635 self.inner.ready().await.map_err(|e| {
636 tonic::Status::new(
637 tonic::Code::Unknown,
638 format!("Service was not ready: {}", e.into()),
639 )
640 })?;
641 let codec = tonic::codec::ProstCodec::default();
642 let path = http::uri::PathAndQuery::from_static(
643 "/mavsdk.rpc.camera.CameraService/SubscribeMode",
644 );
645 self.inner
646 .server_streaming(request.into_request(), path, codec)
647 .await
648 }
649 #[doc = ""]
650 #[doc = " Subscribe to camera information updates."]
651 pub async fn subscribe_information(
652 &mut self,
653 request: impl tonic::IntoRequest<super::SubscribeInformationRequest>,
654 ) -> Result<
655 tonic::Response<tonic::codec::Streaming<super::InformationResponse>>,
656 tonic::Status,
657 > {
658 self.inner.ready().await.map_err(|e| {
659 tonic::Status::new(
660 tonic::Code::Unknown,
661 format!("Service was not ready: {}", e.into()),
662 )
663 })?;
664 let codec = tonic::codec::ProstCodec::default();
665 let path = http::uri::PathAndQuery::from_static(
666 "/mavsdk.rpc.camera.CameraService/SubscribeInformation",
667 );
668 self.inner
669 .server_streaming(request.into_request(), path, codec)
670 .await
671 }
672 #[doc = ""]
673 #[doc = " Subscribe to video stream info updates."]
674 pub async fn subscribe_video_stream_info(
675 &mut self,
676 request: impl tonic::IntoRequest<super::SubscribeVideoStreamInfoRequest>,
677 ) -> Result<
678 tonic::Response<tonic::codec::Streaming<super::VideoStreamInfoResponse>>,
679 tonic::Status,
680 > {
681 self.inner.ready().await.map_err(|e| {
682 tonic::Status::new(
683 tonic::Code::Unknown,
684 format!("Service was not ready: {}", e.into()),
685 )
686 })?;
687 let codec = tonic::codec::ProstCodec::default();
688 let path = http::uri::PathAndQuery::from_static(
689 "/mavsdk.rpc.camera.CameraService/SubscribeVideoStreamInfo",
690 );
691 self.inner
692 .server_streaming(request.into_request(), path, codec)
693 .await
694 }
695 #[doc = ""]
696 #[doc = " Subscribe to capture info updates."]
697 pub async fn subscribe_capture_info(
698 &mut self,
699 request: impl tonic::IntoRequest<super::SubscribeCaptureInfoRequest>,
700 ) -> Result<
701 tonic::Response<tonic::codec::Streaming<super::CaptureInfoResponse>>,
702 tonic::Status,
703 > {
704 self.inner.ready().await.map_err(|e| {
705 tonic::Status::new(
706 tonic::Code::Unknown,
707 format!("Service was not ready: {}", e.into()),
708 )
709 })?;
710 let codec = tonic::codec::ProstCodec::default();
711 let path = http::uri::PathAndQuery::from_static(
712 "/mavsdk.rpc.camera.CameraService/SubscribeCaptureInfo",
713 );
714 self.inner
715 .server_streaming(request.into_request(), path, codec)
716 .await
717 }
718 #[doc = ""]
719 #[doc = " Subscribe to camera status updates."]
720 pub async fn subscribe_status(
721 &mut self,
722 request: impl tonic::IntoRequest<super::SubscribeStatusRequest>,
723 ) -> Result<tonic::Response<tonic::codec::Streaming<super::StatusResponse>>, tonic::Status>
724 {
725 self.inner.ready().await.map_err(|e| {
726 tonic::Status::new(
727 tonic::Code::Unknown,
728 format!("Service was not ready: {}", e.into()),
729 )
730 })?;
731 let codec = tonic::codec::ProstCodec::default();
732 let path = http::uri::PathAndQuery::from_static(
733 "/mavsdk.rpc.camera.CameraService/SubscribeStatus",
734 );
735 self.inner
736 .server_streaming(request.into_request(), path, codec)
737 .await
738 }
739 #[doc = ""]
740 #[doc = " Get the list of current camera settings."]
741 pub async fn subscribe_current_settings(
742 &mut self,
743 request: impl tonic::IntoRequest<super::SubscribeCurrentSettingsRequest>,
744 ) -> Result<
745 tonic::Response<tonic::codec::Streaming<super::CurrentSettingsResponse>>,
746 tonic::Status,
747 > {
748 self.inner.ready().await.map_err(|e| {
749 tonic::Status::new(
750 tonic::Code::Unknown,
751 format!("Service was not ready: {}", e.into()),
752 )
753 })?;
754 let codec = tonic::codec::ProstCodec::default();
755 let path = http::uri::PathAndQuery::from_static(
756 "/mavsdk.rpc.camera.CameraService/SubscribeCurrentSettings",
757 );
758 self.inner
759 .server_streaming(request.into_request(), path, codec)
760 .await
761 }
762 #[doc = ""]
763 #[doc = " Get the list of settings that can be changed."]
764 pub async fn subscribe_possible_setting_options(
765 &mut self,
766 request: impl tonic::IntoRequest<super::SubscribePossibleSettingOptionsRequest>,
767 ) -> Result<
768 tonic::Response<tonic::codec::Streaming<super::PossibleSettingOptionsResponse>>,
769 tonic::Status,
770 > {
771 self.inner.ready().await.map_err(|e| {
772 tonic::Status::new(
773 tonic::Code::Unknown,
774 format!("Service was not ready: {}", e.into()),
775 )
776 })?;
777 let codec = tonic::codec::ProstCodec::default();
778 let path = http::uri::PathAndQuery::from_static(
779 "/mavsdk.rpc.camera.CameraService/SubscribePossibleSettingOptions",
780 );
781 self.inner
782 .server_streaming(request.into_request(), path, codec)
783 .await
784 }
785 #[doc = ""]
786 #[doc = " Set a setting to some value."]
787 #[doc = ""]
788 #[doc = " Only setting_id of setting and option_id of option needs to be set."]
789 pub async fn set_setting(
790 &mut self,
791 request: impl tonic::IntoRequest<super::SetSettingRequest>,
792 ) -> Result<tonic::Response<super::SetSettingResponse>, tonic::Status> {
793 self.inner.ready().await.map_err(|e| {
794 tonic::Status::new(
795 tonic::Code::Unknown,
796 format!("Service was not ready: {}", e.into()),
797 )
798 })?;
799 let codec = tonic::codec::ProstCodec::default();
800 let path =
801 http::uri::PathAndQuery::from_static("/mavsdk.rpc.camera.CameraService/SetSetting");
802 self.inner.unary(request.into_request(), path, codec).await
803 }
804 #[doc = ""]
805 #[doc = " Get a setting."]
806 #[doc = ""]
807 #[doc = " Only setting_id of setting needs to be set."]
808 pub async fn get_setting(
809 &mut self,
810 request: impl tonic::IntoRequest<super::GetSettingRequest>,
811 ) -> Result<tonic::Response<super::GetSettingResponse>, tonic::Status> {
812 self.inner.ready().await.map_err(|e| {
813 tonic::Status::new(
814 tonic::Code::Unknown,
815 format!("Service was not ready: {}", e.into()),
816 )
817 })?;
818 let codec = tonic::codec::ProstCodec::default();
819 let path =
820 http::uri::PathAndQuery::from_static("/mavsdk.rpc.camera.CameraService/GetSetting");
821 self.inner.unary(request.into_request(), path, codec).await
822 }
823 #[doc = ""]
824 #[doc = " Format storage (e.g. SD card) in camera."]
825 #[doc = ""]
826 #[doc = " This will delete all content of the camera storage!"]
827 pub async fn format_storage(
828 &mut self,
829 request: impl tonic::IntoRequest<super::FormatStorageRequest>,
830 ) -> Result<tonic::Response<super::FormatStorageResponse>, tonic::Status> {
831 self.inner.ready().await.map_err(|e| {
832 tonic::Status::new(
833 tonic::Code::Unknown,
834 format!("Service was not ready: {}", e.into()),
835 )
836 })?;
837 let codec = tonic::codec::ProstCodec::default();
838 let path = http::uri::PathAndQuery::from_static(
839 "/mavsdk.rpc.camera.CameraService/FormatStorage",
840 );
841 self.inner.unary(request.into_request(), path, codec).await
842 }
843 }
844}
845#[doc = r" Generated server implementations."]
846pub mod camera_service_server {
847 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
848 use tonic::codegen::*;
849 #[doc = "Generated trait containing gRPC methods that should be implemented for use with CameraServiceServer."]
850 #[async_trait]
851 pub trait CameraService: Send + Sync + 'static {
852 #[doc = ""]
853 #[doc = " Take one photo."]
854 async fn take_photo(
855 &self,
856 request: tonic::Request<super::TakePhotoRequest>,
857 ) -> Result<tonic::Response<super::TakePhotoResponse>, tonic::Status>;
858 #[doc = ""]
859 #[doc = " Start photo timelapse with a given interval."]
860 async fn start_photo_interval(
861 &self,
862 request: tonic::Request<super::StartPhotoIntervalRequest>,
863 ) -> Result<tonic::Response<super::StartPhotoIntervalResponse>, tonic::Status>;
864 #[doc = ""]
865 #[doc = " Stop a running photo timelapse."]
866 async fn stop_photo_interval(
867 &self,
868 request: tonic::Request<super::StopPhotoIntervalRequest>,
869 ) -> Result<tonic::Response<super::StopPhotoIntervalResponse>, tonic::Status>;
870 #[doc = ""]
871 #[doc = " Start a video recording."]
872 async fn start_video(
873 &self,
874 request: tonic::Request<super::StartVideoRequest>,
875 ) -> Result<tonic::Response<super::StartVideoResponse>, tonic::Status>;
876 #[doc = ""]
877 #[doc = " Stop a running video recording."]
878 async fn stop_video(
879 &self,
880 request: tonic::Request<super::StopVideoRequest>,
881 ) -> Result<tonic::Response<super::StopVideoResponse>, tonic::Status>;
882 #[doc = ""]
883 #[doc = " Start video streaming."]
884 async fn start_video_streaming(
885 &self,
886 request: tonic::Request<super::StartVideoStreamingRequest>,
887 ) -> Result<tonic::Response<super::StartVideoStreamingResponse>, tonic::Status>;
888 #[doc = ""]
889 #[doc = " Stop current video streaming."]
890 async fn stop_video_streaming(
891 &self,
892 request: tonic::Request<super::StopVideoStreamingRequest>,
893 ) -> Result<tonic::Response<super::StopVideoStreamingResponse>, tonic::Status>;
894 #[doc = ""]
895 #[doc = " Set camera mode."]
896 async fn set_mode(
897 &self,
898 request: tonic::Request<super::SetModeRequest>,
899 ) -> Result<tonic::Response<super::SetModeResponse>, tonic::Status>;
900 #[doc = "Server streaming response type for the SubscribeMode method."]
901 type SubscribeModeStream: futures_core::Stream<Item = Result<super::ModeResponse, tonic::Status>>
902 + Send
903 + Sync
904 + 'static;
905 #[doc = ""]
906 #[doc = " Subscribe to camera mode updates."]
907 async fn subscribe_mode(
908 &self,
909 request: tonic::Request<super::SubscribeModeRequest>,
910 ) -> Result<tonic::Response<Self::SubscribeModeStream>, tonic::Status>;
911 #[doc = "Server streaming response type for the SubscribeInformation method."]
912 type SubscribeInformationStream: futures_core::Stream<Item = Result<super::InformationResponse, tonic::Status>>
913 + Send
914 + Sync
915 + 'static;
916 #[doc = ""]
917 #[doc = " Subscribe to camera information updates."]
918 async fn subscribe_information(
919 &self,
920 request: tonic::Request<super::SubscribeInformationRequest>,
921 ) -> Result<tonic::Response<Self::SubscribeInformationStream>, tonic::Status>;
922 #[doc = "Server streaming response type for the SubscribeVideoStreamInfo method."]
923 type SubscribeVideoStreamInfoStream: futures_core::Stream<Item = Result<super::VideoStreamInfoResponse, tonic::Status>>
924 + Send
925 + Sync
926 + 'static;
927 #[doc = ""]
928 #[doc = " Subscribe to video stream info updates."]
929 async fn subscribe_video_stream_info(
930 &self,
931 request: tonic::Request<super::SubscribeVideoStreamInfoRequest>,
932 ) -> Result<tonic::Response<Self::SubscribeVideoStreamInfoStream>, tonic::Status>;
933 #[doc = "Server streaming response type for the SubscribeCaptureInfo method."]
934 type SubscribeCaptureInfoStream: futures_core::Stream<Item = Result<super::CaptureInfoResponse, tonic::Status>>
935 + Send
936 + Sync
937 + 'static;
938 #[doc = ""]
939 #[doc = " Subscribe to capture info updates."]
940 async fn subscribe_capture_info(
941 &self,
942 request: tonic::Request<super::SubscribeCaptureInfoRequest>,
943 ) -> Result<tonic::Response<Self::SubscribeCaptureInfoStream>, tonic::Status>;
944 #[doc = "Server streaming response type for the SubscribeStatus method."]
945 type SubscribeStatusStream: futures_core::Stream<Item = Result<super::StatusResponse, tonic::Status>>
946 + Send
947 + Sync
948 + 'static;
949 #[doc = ""]
950 #[doc = " Subscribe to camera status updates."]
951 async fn subscribe_status(
952 &self,
953 request: tonic::Request<super::SubscribeStatusRequest>,
954 ) -> Result<tonic::Response<Self::SubscribeStatusStream>, tonic::Status>;
955 #[doc = "Server streaming response type for the SubscribeCurrentSettings method."]
956 type SubscribeCurrentSettingsStream: futures_core::Stream<Item = Result<super::CurrentSettingsResponse, tonic::Status>>
957 + Send
958 + Sync
959 + 'static;
960 #[doc = ""]
961 #[doc = " Get the list of current camera settings."]
962 async fn subscribe_current_settings(
963 &self,
964 request: tonic::Request<super::SubscribeCurrentSettingsRequest>,
965 ) -> Result<tonic::Response<Self::SubscribeCurrentSettingsStream>, tonic::Status>;
966 #[doc = "Server streaming response type for the SubscribePossibleSettingOptions method."]
967 type SubscribePossibleSettingOptionsStream: futures_core::Stream<
968 Item = Result<super::PossibleSettingOptionsResponse, tonic::Status>,
969 > + Send
970 + Sync
971 + 'static;
972 #[doc = ""]
973 #[doc = " Get the list of settings that can be changed."]
974 async fn subscribe_possible_setting_options(
975 &self,
976 request: tonic::Request<super::SubscribePossibleSettingOptionsRequest>,
977 ) -> Result<tonic::Response<Self::SubscribePossibleSettingOptionsStream>, tonic::Status>;
978 #[doc = ""]
979 #[doc = " Set a setting to some value."]
980 #[doc = ""]
981 #[doc = " Only setting_id of setting and option_id of option needs to be set."]
982 async fn set_setting(
983 &self,
984 request: tonic::Request<super::SetSettingRequest>,
985 ) -> Result<tonic::Response<super::SetSettingResponse>, tonic::Status>;
986 #[doc = ""]
987 #[doc = " Get a setting."]
988 #[doc = ""]
989 #[doc = " Only setting_id of setting needs to be set."]
990 async fn get_setting(
991 &self,
992 request: tonic::Request<super::GetSettingRequest>,
993 ) -> Result<tonic::Response<super::GetSettingResponse>, tonic::Status>;
994 #[doc = ""]
995 #[doc = " Format storage (e.g. SD card) in camera."]
996 #[doc = ""]
997 #[doc = " This will delete all content of the camera storage!"]
998 async fn format_storage(
999 &self,
1000 request: tonic::Request<super::FormatStorageRequest>,
1001 ) -> Result<tonic::Response<super::FormatStorageResponse>, tonic::Status>;
1002 }
1003 #[doc = ""]
1004 #[doc = " Can be used to manage cameras that implement the MAVLink"]
1005 #[doc = " Camera Protocol: https://mavlink.io/en/protocol/camera.html."]
1006 #[doc = ""]
1007 #[doc = " Currently only a single camera is supported."]
1008 #[doc = " When multiple cameras are supported the plugin will need to be"]
1009 #[doc = " instantiated separately for every camera and the camera selected using"]
1010 #[doc = " `select_camera`."]
1011 #[derive(Debug)]
1012 pub struct CameraServiceServer<T: CameraService> {
1013 inner: _Inner<T>,
1014 accept_compression_encodings: (),
1015 send_compression_encodings: (),
1016 }
1017 struct _Inner<T>(Arc<T>);
1018 impl<T: CameraService> CameraServiceServer<T> {
1019 pub fn new(inner: T) -> Self {
1020 let inner = Arc::new(inner);
1021 let inner = _Inner(inner);
1022 Self {
1023 inner,
1024 accept_compression_encodings: Default::default(),
1025 send_compression_encodings: Default::default(),
1026 }
1027 }
1028 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
1029 where
1030 F: tonic::service::Interceptor,
1031 {
1032 InterceptedService::new(Self::new(inner), interceptor)
1033 }
1034 }
1035 impl<T, B> tonic::codegen::Service<http::Request<B>> for CameraServiceServer<T>
1036 where
1037 T: CameraService,
1038 B: Body + Send + Sync + 'static,
1039 B::Error: Into<StdError> + Send + 'static,
1040 {
1041 type Response = http::Response<tonic::body::BoxBody>;
1042 type Error = Never;
1043 type Future = BoxFuture<Self::Response, Self::Error>;
1044 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
1045 Poll::Ready(Ok(()))
1046 }
1047 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1048 let inner = self.inner.clone();
1049 match req.uri().path() {
1050 "/mavsdk.rpc.camera.CameraService/TakePhoto" => {
1051 #[allow(non_camel_case_types)]
1052 struct TakePhotoSvc<T: CameraService>(pub Arc<T>);
1053 impl<T: CameraService> tonic::server::UnaryService<super::TakePhotoRequest> for TakePhotoSvc<T> {
1054 type Response = super::TakePhotoResponse;
1055 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1056 fn call(
1057 &mut self,
1058 request: tonic::Request<super::TakePhotoRequest>,
1059 ) -> Self::Future {
1060 let inner = self.0.clone();
1061 let fut = async move { (*inner).take_photo(request).await };
1062 Box::pin(fut)
1063 }
1064 }
1065 let accept_compression_encodings = self.accept_compression_encodings;
1066 let send_compression_encodings = self.send_compression_encodings;
1067 let inner = self.inner.clone();
1068 let fut = async move {
1069 let inner = inner.0;
1070 let method = TakePhotoSvc(inner);
1071 let codec = tonic::codec::ProstCodec::default();
1072 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1073 accept_compression_encodings,
1074 send_compression_encodings,
1075 );
1076 let res = grpc.unary(method, req).await;
1077 Ok(res)
1078 };
1079 Box::pin(fut)
1080 }
1081 "/mavsdk.rpc.camera.CameraService/StartPhotoInterval" => {
1082 #[allow(non_camel_case_types)]
1083 struct StartPhotoIntervalSvc<T: CameraService>(pub Arc<T>);
1084 impl<T: CameraService>
1085 tonic::server::UnaryService<super::StartPhotoIntervalRequest>
1086 for StartPhotoIntervalSvc<T>
1087 {
1088 type Response = super::StartPhotoIntervalResponse;
1089 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1090 fn call(
1091 &mut self,
1092 request: tonic::Request<super::StartPhotoIntervalRequest>,
1093 ) -> Self::Future {
1094 let inner = self.0.clone();
1095 let fut = async move { (*inner).start_photo_interval(request).await };
1096 Box::pin(fut)
1097 }
1098 }
1099 let accept_compression_encodings = self.accept_compression_encodings;
1100 let send_compression_encodings = self.send_compression_encodings;
1101 let inner = self.inner.clone();
1102 let fut = async move {
1103 let inner = inner.0;
1104 let method = StartPhotoIntervalSvc(inner);
1105 let codec = tonic::codec::ProstCodec::default();
1106 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1107 accept_compression_encodings,
1108 send_compression_encodings,
1109 );
1110 let res = grpc.unary(method, req).await;
1111 Ok(res)
1112 };
1113 Box::pin(fut)
1114 }
1115 "/mavsdk.rpc.camera.CameraService/StopPhotoInterval" => {
1116 #[allow(non_camel_case_types)]
1117 struct StopPhotoIntervalSvc<T: CameraService>(pub Arc<T>);
1118 impl<T: CameraService>
1119 tonic::server::UnaryService<super::StopPhotoIntervalRequest>
1120 for StopPhotoIntervalSvc<T>
1121 {
1122 type Response = super::StopPhotoIntervalResponse;
1123 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1124 fn call(
1125 &mut self,
1126 request: tonic::Request<super::StopPhotoIntervalRequest>,
1127 ) -> Self::Future {
1128 let inner = self.0.clone();
1129 let fut = async move { (*inner).stop_photo_interval(request).await };
1130 Box::pin(fut)
1131 }
1132 }
1133 let accept_compression_encodings = self.accept_compression_encodings;
1134 let send_compression_encodings = self.send_compression_encodings;
1135 let inner = self.inner.clone();
1136 let fut = async move {
1137 let inner = inner.0;
1138 let method = StopPhotoIntervalSvc(inner);
1139 let codec = tonic::codec::ProstCodec::default();
1140 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1141 accept_compression_encodings,
1142 send_compression_encodings,
1143 );
1144 let res = grpc.unary(method, req).await;
1145 Ok(res)
1146 };
1147 Box::pin(fut)
1148 }
1149 "/mavsdk.rpc.camera.CameraService/StartVideo" => {
1150 #[allow(non_camel_case_types)]
1151 struct StartVideoSvc<T: CameraService>(pub Arc<T>);
1152 impl<T: CameraService> tonic::server::UnaryService<super::StartVideoRequest> for StartVideoSvc<T> {
1153 type Response = super::StartVideoResponse;
1154 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1155 fn call(
1156 &mut self,
1157 request: tonic::Request<super::StartVideoRequest>,
1158 ) -> Self::Future {
1159 let inner = self.0.clone();
1160 let fut = async move { (*inner).start_video(request).await };
1161 Box::pin(fut)
1162 }
1163 }
1164 let accept_compression_encodings = self.accept_compression_encodings;
1165 let send_compression_encodings = self.send_compression_encodings;
1166 let inner = self.inner.clone();
1167 let fut = async move {
1168 let inner = inner.0;
1169 let method = StartVideoSvc(inner);
1170 let codec = tonic::codec::ProstCodec::default();
1171 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1172 accept_compression_encodings,
1173 send_compression_encodings,
1174 );
1175 let res = grpc.unary(method, req).await;
1176 Ok(res)
1177 };
1178 Box::pin(fut)
1179 }
1180 "/mavsdk.rpc.camera.CameraService/StopVideo" => {
1181 #[allow(non_camel_case_types)]
1182 struct StopVideoSvc<T: CameraService>(pub Arc<T>);
1183 impl<T: CameraService> tonic::server::UnaryService<super::StopVideoRequest> for StopVideoSvc<T> {
1184 type Response = super::StopVideoResponse;
1185 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1186 fn call(
1187 &mut self,
1188 request: tonic::Request<super::StopVideoRequest>,
1189 ) -> Self::Future {
1190 let inner = self.0.clone();
1191 let fut = async move { (*inner).stop_video(request).await };
1192 Box::pin(fut)
1193 }
1194 }
1195 let accept_compression_encodings = self.accept_compression_encodings;
1196 let send_compression_encodings = self.send_compression_encodings;
1197 let inner = self.inner.clone();
1198 let fut = async move {
1199 let inner = inner.0;
1200 let method = StopVideoSvc(inner);
1201 let codec = tonic::codec::ProstCodec::default();
1202 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1203 accept_compression_encodings,
1204 send_compression_encodings,
1205 );
1206 let res = grpc.unary(method, req).await;
1207 Ok(res)
1208 };
1209 Box::pin(fut)
1210 }
1211 "/mavsdk.rpc.camera.CameraService/StartVideoStreaming" => {
1212 #[allow(non_camel_case_types)]
1213 struct StartVideoStreamingSvc<T: CameraService>(pub Arc<T>);
1214 impl<T: CameraService>
1215 tonic::server::UnaryService<super::StartVideoStreamingRequest>
1216 for StartVideoStreamingSvc<T>
1217 {
1218 type Response = super::StartVideoStreamingResponse;
1219 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1220 fn call(
1221 &mut self,
1222 request: tonic::Request<super::StartVideoStreamingRequest>,
1223 ) -> Self::Future {
1224 let inner = self.0.clone();
1225 let fut = async move { (*inner).start_video_streaming(request).await };
1226 Box::pin(fut)
1227 }
1228 }
1229 let accept_compression_encodings = self.accept_compression_encodings;
1230 let send_compression_encodings = self.send_compression_encodings;
1231 let inner = self.inner.clone();
1232 let fut = async move {
1233 let inner = inner.0;
1234 let method = StartVideoStreamingSvc(inner);
1235 let codec = tonic::codec::ProstCodec::default();
1236 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1237 accept_compression_encodings,
1238 send_compression_encodings,
1239 );
1240 let res = grpc.unary(method, req).await;
1241 Ok(res)
1242 };
1243 Box::pin(fut)
1244 }
1245 "/mavsdk.rpc.camera.CameraService/StopVideoStreaming" => {
1246 #[allow(non_camel_case_types)]
1247 struct StopVideoStreamingSvc<T: CameraService>(pub Arc<T>);
1248 impl<T: CameraService>
1249 tonic::server::UnaryService<super::StopVideoStreamingRequest>
1250 for StopVideoStreamingSvc<T>
1251 {
1252 type Response = super::StopVideoStreamingResponse;
1253 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1254 fn call(
1255 &mut self,
1256 request: tonic::Request<super::StopVideoStreamingRequest>,
1257 ) -> Self::Future {
1258 let inner = self.0.clone();
1259 let fut = async move { (*inner).stop_video_streaming(request).await };
1260 Box::pin(fut)
1261 }
1262 }
1263 let accept_compression_encodings = self.accept_compression_encodings;
1264 let send_compression_encodings = self.send_compression_encodings;
1265 let inner = self.inner.clone();
1266 let fut = async move {
1267 let inner = inner.0;
1268 let method = StopVideoStreamingSvc(inner);
1269 let codec = tonic::codec::ProstCodec::default();
1270 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1271 accept_compression_encodings,
1272 send_compression_encodings,
1273 );
1274 let res = grpc.unary(method, req).await;
1275 Ok(res)
1276 };
1277 Box::pin(fut)
1278 }
1279 "/mavsdk.rpc.camera.CameraService/SetMode" => {
1280 #[allow(non_camel_case_types)]
1281 struct SetModeSvc<T: CameraService>(pub Arc<T>);
1282 impl<T: CameraService> tonic::server::UnaryService<super::SetModeRequest> for SetModeSvc<T> {
1283 type Response = super::SetModeResponse;
1284 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1285 fn call(
1286 &mut self,
1287 request: tonic::Request<super::SetModeRequest>,
1288 ) -> Self::Future {
1289 let inner = self.0.clone();
1290 let fut = async move { (*inner).set_mode(request).await };
1291 Box::pin(fut)
1292 }
1293 }
1294 let accept_compression_encodings = self.accept_compression_encodings;
1295 let send_compression_encodings = self.send_compression_encodings;
1296 let inner = self.inner.clone();
1297 let fut = async move {
1298 let inner = inner.0;
1299 let method = SetModeSvc(inner);
1300 let codec = tonic::codec::ProstCodec::default();
1301 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1302 accept_compression_encodings,
1303 send_compression_encodings,
1304 );
1305 let res = grpc.unary(method, req).await;
1306 Ok(res)
1307 };
1308 Box::pin(fut)
1309 }
1310 "/mavsdk.rpc.camera.CameraService/SubscribeMode" => {
1311 #[allow(non_camel_case_types)]
1312 struct SubscribeModeSvc<T: CameraService>(pub Arc<T>);
1313 impl<T: CameraService>
1314 tonic::server::ServerStreamingService<super::SubscribeModeRequest>
1315 for SubscribeModeSvc<T>
1316 {
1317 type Response = super::ModeResponse;
1318 type ResponseStream = T::SubscribeModeStream;
1319 type Future =
1320 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
1321 fn call(
1322 &mut self,
1323 request: tonic::Request<super::SubscribeModeRequest>,
1324 ) -> Self::Future {
1325 let inner = self.0.clone();
1326 let fut = async move { (*inner).subscribe_mode(request).await };
1327 Box::pin(fut)
1328 }
1329 }
1330 let accept_compression_encodings = self.accept_compression_encodings;
1331 let send_compression_encodings = self.send_compression_encodings;
1332 let inner = self.inner.clone();
1333 let fut = async move {
1334 let inner = inner.0;
1335 let method = SubscribeModeSvc(inner);
1336 let codec = tonic::codec::ProstCodec::default();
1337 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1338 accept_compression_encodings,
1339 send_compression_encodings,
1340 );
1341 let res = grpc.server_streaming(method, req).await;
1342 Ok(res)
1343 };
1344 Box::pin(fut)
1345 }
1346 "/mavsdk.rpc.camera.CameraService/SubscribeInformation" => {
1347 #[allow(non_camel_case_types)]
1348 struct SubscribeInformationSvc<T: CameraService>(pub Arc<T>);
1349 impl<T: CameraService>
1350 tonic::server::ServerStreamingService<super::SubscribeInformationRequest>
1351 for SubscribeInformationSvc<T>
1352 {
1353 type Response = super::InformationResponse;
1354 type ResponseStream = T::SubscribeInformationStream;
1355 type Future =
1356 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
1357 fn call(
1358 &mut self,
1359 request: tonic::Request<super::SubscribeInformationRequest>,
1360 ) -> Self::Future {
1361 let inner = self.0.clone();
1362 let fut = async move { (*inner).subscribe_information(request).await };
1363 Box::pin(fut)
1364 }
1365 }
1366 let accept_compression_encodings = self.accept_compression_encodings;
1367 let send_compression_encodings = self.send_compression_encodings;
1368 let inner = self.inner.clone();
1369 let fut = async move {
1370 let inner = inner.0;
1371 let method = SubscribeInformationSvc(inner);
1372 let codec = tonic::codec::ProstCodec::default();
1373 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1374 accept_compression_encodings,
1375 send_compression_encodings,
1376 );
1377 let res = grpc.server_streaming(method, req).await;
1378 Ok(res)
1379 };
1380 Box::pin(fut)
1381 }
1382 "/mavsdk.rpc.camera.CameraService/SubscribeVideoStreamInfo" => {
1383 #[allow(non_camel_case_types)]
1384 struct SubscribeVideoStreamInfoSvc<T: CameraService>(pub Arc<T>);
1385 impl<T: CameraService>
1386 tonic::server::ServerStreamingService<
1387 super::SubscribeVideoStreamInfoRequest,
1388 > for SubscribeVideoStreamInfoSvc<T>
1389 {
1390 type Response = super::VideoStreamInfoResponse;
1391 type ResponseStream = T::SubscribeVideoStreamInfoStream;
1392 type Future =
1393 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
1394 fn call(
1395 &mut self,
1396 request: tonic::Request<super::SubscribeVideoStreamInfoRequest>,
1397 ) -> Self::Future {
1398 let inner = self.0.clone();
1399 let fut =
1400 async move { (*inner).subscribe_video_stream_info(request).await };
1401 Box::pin(fut)
1402 }
1403 }
1404 let accept_compression_encodings = self.accept_compression_encodings;
1405 let send_compression_encodings = self.send_compression_encodings;
1406 let inner = self.inner.clone();
1407 let fut = async move {
1408 let inner = inner.0;
1409 let method = SubscribeVideoStreamInfoSvc(inner);
1410 let codec = tonic::codec::ProstCodec::default();
1411 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1412 accept_compression_encodings,
1413 send_compression_encodings,
1414 );
1415 let res = grpc.server_streaming(method, req).await;
1416 Ok(res)
1417 };
1418 Box::pin(fut)
1419 }
1420 "/mavsdk.rpc.camera.CameraService/SubscribeCaptureInfo" => {
1421 #[allow(non_camel_case_types)]
1422 struct SubscribeCaptureInfoSvc<T: CameraService>(pub Arc<T>);
1423 impl<T: CameraService>
1424 tonic::server::ServerStreamingService<super::SubscribeCaptureInfoRequest>
1425 for SubscribeCaptureInfoSvc<T>
1426 {
1427 type Response = super::CaptureInfoResponse;
1428 type ResponseStream = T::SubscribeCaptureInfoStream;
1429 type Future =
1430 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
1431 fn call(
1432 &mut self,
1433 request: tonic::Request<super::SubscribeCaptureInfoRequest>,
1434 ) -> Self::Future {
1435 let inner = self.0.clone();
1436 let fut = async move { (*inner).subscribe_capture_info(request).await };
1437 Box::pin(fut)
1438 }
1439 }
1440 let accept_compression_encodings = self.accept_compression_encodings;
1441 let send_compression_encodings = self.send_compression_encodings;
1442 let inner = self.inner.clone();
1443 let fut = async move {
1444 let inner = inner.0;
1445 let method = SubscribeCaptureInfoSvc(inner);
1446 let codec = tonic::codec::ProstCodec::default();
1447 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1448 accept_compression_encodings,
1449 send_compression_encodings,
1450 );
1451 let res = grpc.server_streaming(method, req).await;
1452 Ok(res)
1453 };
1454 Box::pin(fut)
1455 }
1456 "/mavsdk.rpc.camera.CameraService/SubscribeStatus" => {
1457 #[allow(non_camel_case_types)]
1458 struct SubscribeStatusSvc<T: CameraService>(pub Arc<T>);
1459 impl<T: CameraService>
1460 tonic::server::ServerStreamingService<super::SubscribeStatusRequest>
1461 for SubscribeStatusSvc<T>
1462 {
1463 type Response = super::StatusResponse;
1464 type ResponseStream = T::SubscribeStatusStream;
1465 type Future =
1466 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
1467 fn call(
1468 &mut self,
1469 request: tonic::Request<super::SubscribeStatusRequest>,
1470 ) -> Self::Future {
1471 let inner = self.0.clone();
1472 let fut = async move { (*inner).subscribe_status(request).await };
1473 Box::pin(fut)
1474 }
1475 }
1476 let accept_compression_encodings = self.accept_compression_encodings;
1477 let send_compression_encodings = self.send_compression_encodings;
1478 let inner = self.inner.clone();
1479 let fut = async move {
1480 let inner = inner.0;
1481 let method = SubscribeStatusSvc(inner);
1482 let codec = tonic::codec::ProstCodec::default();
1483 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1484 accept_compression_encodings,
1485 send_compression_encodings,
1486 );
1487 let res = grpc.server_streaming(method, req).await;
1488 Ok(res)
1489 };
1490 Box::pin(fut)
1491 }
1492 "/mavsdk.rpc.camera.CameraService/SubscribeCurrentSettings" => {
1493 #[allow(non_camel_case_types)]
1494 struct SubscribeCurrentSettingsSvc<T: CameraService>(pub Arc<T>);
1495 impl<T: CameraService>
1496 tonic::server::ServerStreamingService<
1497 super::SubscribeCurrentSettingsRequest,
1498 > for SubscribeCurrentSettingsSvc<T>
1499 {
1500 type Response = super::CurrentSettingsResponse;
1501 type ResponseStream = T::SubscribeCurrentSettingsStream;
1502 type Future =
1503 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
1504 fn call(
1505 &mut self,
1506 request: tonic::Request<super::SubscribeCurrentSettingsRequest>,
1507 ) -> Self::Future {
1508 let inner = self.0.clone();
1509 let fut =
1510 async move { (*inner).subscribe_current_settings(request).await };
1511 Box::pin(fut)
1512 }
1513 }
1514 let accept_compression_encodings = self.accept_compression_encodings;
1515 let send_compression_encodings = self.send_compression_encodings;
1516 let inner = self.inner.clone();
1517 let fut = async move {
1518 let inner = inner.0;
1519 let method = SubscribeCurrentSettingsSvc(inner);
1520 let codec = tonic::codec::ProstCodec::default();
1521 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1522 accept_compression_encodings,
1523 send_compression_encodings,
1524 );
1525 let res = grpc.server_streaming(method, req).await;
1526 Ok(res)
1527 };
1528 Box::pin(fut)
1529 }
1530 "/mavsdk.rpc.camera.CameraService/SubscribePossibleSettingOptions" => {
1531 #[allow(non_camel_case_types)]
1532 struct SubscribePossibleSettingOptionsSvc<T: CameraService>(pub Arc<T>);
1533 impl<T: CameraService>
1534 tonic::server::ServerStreamingService<
1535 super::SubscribePossibleSettingOptionsRequest,
1536 > for SubscribePossibleSettingOptionsSvc<T>
1537 {
1538 type Response = super::PossibleSettingOptionsResponse;
1539 type ResponseStream = T::SubscribePossibleSettingOptionsStream;
1540 type Future =
1541 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
1542 fn call(
1543 &mut self,
1544 request: tonic::Request<super::SubscribePossibleSettingOptionsRequest>,
1545 ) -> Self::Future {
1546 let inner = self.0.clone();
1547 let fut = async move {
1548 (*inner).subscribe_possible_setting_options(request).await
1549 };
1550 Box::pin(fut)
1551 }
1552 }
1553 let accept_compression_encodings = self.accept_compression_encodings;
1554 let send_compression_encodings = self.send_compression_encodings;
1555 let inner = self.inner.clone();
1556 let fut = async move {
1557 let inner = inner.0;
1558 let method = SubscribePossibleSettingOptionsSvc(inner);
1559 let codec = tonic::codec::ProstCodec::default();
1560 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1561 accept_compression_encodings,
1562 send_compression_encodings,
1563 );
1564 let res = grpc.server_streaming(method, req).await;
1565 Ok(res)
1566 };
1567 Box::pin(fut)
1568 }
1569 "/mavsdk.rpc.camera.CameraService/SetSetting" => {
1570 #[allow(non_camel_case_types)]
1571 struct SetSettingSvc<T: CameraService>(pub Arc<T>);
1572 impl<T: CameraService> tonic::server::UnaryService<super::SetSettingRequest> for SetSettingSvc<T> {
1573 type Response = super::SetSettingResponse;
1574 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1575 fn call(
1576 &mut self,
1577 request: tonic::Request<super::SetSettingRequest>,
1578 ) -> Self::Future {
1579 let inner = self.0.clone();
1580 let fut = async move { (*inner).set_setting(request).await };
1581 Box::pin(fut)
1582 }
1583 }
1584 let accept_compression_encodings = self.accept_compression_encodings;
1585 let send_compression_encodings = self.send_compression_encodings;
1586 let inner = self.inner.clone();
1587 let fut = async move {
1588 let inner = inner.0;
1589 let method = SetSettingSvc(inner);
1590 let codec = tonic::codec::ProstCodec::default();
1591 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1592 accept_compression_encodings,
1593 send_compression_encodings,
1594 );
1595 let res = grpc.unary(method, req).await;
1596 Ok(res)
1597 };
1598 Box::pin(fut)
1599 }
1600 "/mavsdk.rpc.camera.CameraService/GetSetting" => {
1601 #[allow(non_camel_case_types)]
1602 struct GetSettingSvc<T: CameraService>(pub Arc<T>);
1603 impl<T: CameraService> tonic::server::UnaryService<super::GetSettingRequest> for GetSettingSvc<T> {
1604 type Response = super::GetSettingResponse;
1605 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1606 fn call(
1607 &mut self,
1608 request: tonic::Request<super::GetSettingRequest>,
1609 ) -> Self::Future {
1610 let inner = self.0.clone();
1611 let fut = async move { (*inner).get_setting(request).await };
1612 Box::pin(fut)
1613 }
1614 }
1615 let accept_compression_encodings = self.accept_compression_encodings;
1616 let send_compression_encodings = self.send_compression_encodings;
1617 let inner = self.inner.clone();
1618 let fut = async move {
1619 let inner = inner.0;
1620 let method = GetSettingSvc(inner);
1621 let codec = tonic::codec::ProstCodec::default();
1622 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1623 accept_compression_encodings,
1624 send_compression_encodings,
1625 );
1626 let res = grpc.unary(method, req).await;
1627 Ok(res)
1628 };
1629 Box::pin(fut)
1630 }
1631 "/mavsdk.rpc.camera.CameraService/FormatStorage" => {
1632 #[allow(non_camel_case_types)]
1633 struct FormatStorageSvc<T: CameraService>(pub Arc<T>);
1634 impl<T: CameraService> tonic::server::UnaryService<super::FormatStorageRequest>
1635 for FormatStorageSvc<T>
1636 {
1637 type Response = super::FormatStorageResponse;
1638 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1639 fn call(
1640 &mut self,
1641 request: tonic::Request<super::FormatStorageRequest>,
1642 ) -> Self::Future {
1643 let inner = self.0.clone();
1644 let fut = async move { (*inner).format_storage(request).await };
1645 Box::pin(fut)
1646 }
1647 }
1648 let accept_compression_encodings = self.accept_compression_encodings;
1649 let send_compression_encodings = self.send_compression_encodings;
1650 let inner = self.inner.clone();
1651 let fut = async move {
1652 let inner = inner.0;
1653 let method = FormatStorageSvc(inner);
1654 let codec = tonic::codec::ProstCodec::default();
1655 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1656 accept_compression_encodings,
1657 send_compression_encodings,
1658 );
1659 let res = grpc.unary(method, req).await;
1660 Ok(res)
1661 };
1662 Box::pin(fut)
1663 }
1664 _ => Box::pin(async move {
1665 Ok(http::Response::builder()
1666 .status(200)
1667 .header("grpc-status", "12")
1668 .header("content-type", "application/grpc")
1669 .body(empty_body())
1670 .unwrap())
1671 }),
1672 }
1673 }
1674 }
1675 impl<T: CameraService> Clone for CameraServiceServer<T> {
1676 fn clone(&self) -> Self {
1677 let inner = self.inner.clone();
1678 Self {
1679 inner,
1680 accept_compression_encodings: self.accept_compression_encodings,
1681 send_compression_encodings: self.send_compression_encodings,
1682 }
1683 }
1684 }
1685 impl<T: CameraService> Clone for _Inner<T> {
1686 fn clone(&self) -> Self {
1687 Self(self.0.clone())
1688 }
1689 }
1690 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
1691 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1692 write!(f, "{:?}", self.0)
1693 }
1694 }
1695 impl<T: CameraService> tonic::transport::NamedService for CameraServiceServer<T> {
1696 const NAME: &'static str = "mavsdk.rpc.camera.CameraService";
1697 }
1698}