pub struct DeviceServiceClient<T> { /* private fields */ }
Expand description
DeviceService is the service providing API methods for managing devices.
Implementations§
source§impl<T> DeviceServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> DeviceServiceClient<T>where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>( inner: T, interceptor: F ) -> DeviceServiceClient<InterceptedService<T, F>>where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub async fn create(
&mut self,
request: impl IntoRequest<CreateDeviceRequest>
) -> Result<Response<()>, Status>
pub async fn create( &mut self, request: impl IntoRequest<CreateDeviceRequest> ) -> Result<Response<()>, Status>
Create the given device.
sourcepub async fn get(
&mut self,
request: impl IntoRequest<GetDeviceRequest>
) -> Result<Response<GetDeviceResponse>, Status>
pub async fn get( &mut self, request: impl IntoRequest<GetDeviceRequest> ) -> Result<Response<GetDeviceResponse>, Status>
Get returns the device for the given DevEUI.
sourcepub async fn update(
&mut self,
request: impl IntoRequest<UpdateDeviceRequest>
) -> Result<Response<()>, Status>
pub async fn update( &mut self, request: impl IntoRequest<UpdateDeviceRequest> ) -> Result<Response<()>, Status>
Update the given device.
sourcepub async fn delete(
&mut self,
request: impl IntoRequest<DeleteDeviceRequest>
) -> Result<Response<()>, Status>
pub async fn delete( &mut self, request: impl IntoRequest<DeleteDeviceRequest> ) -> Result<Response<()>, Status>
Delete the device with the given DevEUI.
sourcepub async fn list(
&mut self,
request: impl IntoRequest<ListDevicesRequest>
) -> Result<Response<ListDevicesResponse>, Status>
pub async fn list( &mut self, request: impl IntoRequest<ListDevicesRequest> ) -> Result<Response<ListDevicesResponse>, Status>
Get the list of devices.
sourcepub async fn create_keys(
&mut self,
request: impl IntoRequest<CreateDeviceKeysRequest>
) -> Result<Response<()>, Status>
pub async fn create_keys( &mut self, request: impl IntoRequest<CreateDeviceKeysRequest> ) -> Result<Response<()>, Status>
Create the given device-keys.
sourcepub async fn get_keys(
&mut self,
request: impl IntoRequest<GetDeviceKeysRequest>
) -> Result<Response<GetDeviceKeysResponse>, Status>
pub async fn get_keys( &mut self, request: impl IntoRequest<GetDeviceKeysRequest> ) -> Result<Response<GetDeviceKeysResponse>, Status>
Get the device-keys for the given DevEUI.
sourcepub async fn update_keys(
&mut self,
request: impl IntoRequest<UpdateDeviceKeysRequest>
) -> Result<Response<()>, Status>
pub async fn update_keys( &mut self, request: impl IntoRequest<UpdateDeviceKeysRequest> ) -> Result<Response<()>, Status>
Update the given device-keys.
sourcepub async fn delete_keys(
&mut self,
request: impl IntoRequest<DeleteDeviceKeysRequest>
) -> Result<Response<()>, Status>
pub async fn delete_keys( &mut self, request: impl IntoRequest<DeleteDeviceKeysRequest> ) -> Result<Response<()>, Status>
Delete the device-keys for the given DevEUI.
sourcepub async fn flush_dev_nonces(
&mut self,
request: impl IntoRequest<FlushDevNoncesRequest>
) -> Result<Response<()>, Status>
pub async fn flush_dev_nonces( &mut self, request: impl IntoRequest<FlushDevNoncesRequest> ) -> Result<Response<()>, Status>
FlushDevNonces flushes the OTAA device nonces.
sourcepub async fn activate(
&mut self,
request: impl IntoRequest<ActivateDeviceRequest>
) -> Result<Response<()>, Status>
pub async fn activate( &mut self, request: impl IntoRequest<ActivateDeviceRequest> ) -> Result<Response<()>, Status>
Activate (re)activates the device with the given parameters (for ABP or for importing OTAA activations).
sourcepub async fn deactivate(
&mut self,
request: impl IntoRequest<DeactivateDeviceRequest>
) -> Result<Response<()>, Status>
pub async fn deactivate( &mut self, request: impl IntoRequest<DeactivateDeviceRequest> ) -> Result<Response<()>, Status>
Deactivate de-activates the device.
sourcepub async fn get_activation(
&mut self,
request: impl IntoRequest<GetDeviceActivationRequest>
) -> Result<Response<GetDeviceActivationResponse>, Status>
pub async fn get_activation( &mut self, request: impl IntoRequest<GetDeviceActivationRequest> ) -> Result<Response<GetDeviceActivationResponse>, Status>
GetActivation returns the current activation details of the device (OTAA or ABP).
sourcepub async fn get_random_dev_addr(
&mut self,
request: impl IntoRequest<GetRandomDevAddrRequest>
) -> Result<Response<GetRandomDevAddrResponse>, Status>
pub async fn get_random_dev_addr( &mut self, request: impl IntoRequest<GetRandomDevAddrRequest> ) -> Result<Response<GetRandomDevAddrResponse>, Status>
GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account.
sourcepub async fn get_metrics(
&mut self,
request: impl IntoRequest<GetDeviceMetricsRequest>
) -> Result<Response<GetDeviceMetricsResponse>, Status>
pub async fn get_metrics( &mut self, request: impl IntoRequest<GetDeviceMetricsRequest> ) -> Result<Response<GetDeviceMetricsResponse>, Status>
GetMetrics returns the device metrics. Note that this requires a device-profile with codec and measurements configured.
sourcepub async fn get_link_metrics(
&mut self,
request: impl IntoRequest<GetDeviceLinkMetricsRequest>
) -> Result<Response<GetDeviceLinkMetricsResponse>, Status>
pub async fn get_link_metrics( &mut self, request: impl IntoRequest<GetDeviceLinkMetricsRequest> ) -> Result<Response<GetDeviceLinkMetricsResponse>, Status>
GetLinkMetrics returns the device link metrics. This includes uplinks, downlinks, RSSI, SNR, etc…
sourcepub async fn enqueue(
&mut self,
request: impl IntoRequest<EnqueueDeviceQueueItemRequest>
) -> Result<Response<EnqueueDeviceQueueItemResponse>, Status>
pub async fn enqueue( &mut self, request: impl IntoRequest<EnqueueDeviceQueueItemRequest> ) -> Result<Response<EnqueueDeviceQueueItemResponse>, Status>
Enqueue adds the given item to the downlink queue.
sourcepub async fn flush_queue(
&mut self,
request: impl IntoRequest<FlushDeviceQueueRequest>
) -> Result<Response<()>, Status>
pub async fn flush_queue( &mut self, request: impl IntoRequest<FlushDeviceQueueRequest> ) -> Result<Response<()>, Status>
FlushQueue flushes the downlink device-queue.
sourcepub async fn get_queue(
&mut self,
request: impl IntoRequest<GetDeviceQueueItemsRequest>
) -> Result<Response<GetDeviceQueueItemsResponse>, Status>
pub async fn get_queue( &mut self, request: impl IntoRequest<GetDeviceQueueItemsRequest> ) -> Result<Response<GetDeviceQueueItemsResponse>, Status>
GetQueue returns the downlink device-queue.
Trait Implementations§
source§impl<T: Clone> Clone for DeviceServiceClient<T>
impl<T: Clone> Clone for DeviceServiceClient<T>
source§fn clone(&self) -> DeviceServiceClient<T>
fn clone(&self) -> DeviceServiceClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> RefUnwindSafe for DeviceServiceClient<T>where T: RefUnwindSafe,
impl<T> Send for DeviceServiceClient<T>where T: Send,
impl<T> Sync for DeviceServiceClient<T>where T: Sync,
impl<T> Unpin for DeviceServiceClient<T>where T: Unpin,
impl<T> UnwindSafe for DeviceServiceClient<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request