MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / location_event

Method location_event

chirpstack/src/integration/mqtt.rs:378–396  ·  view source on GitHub ↗
(
        &self,
        _vars: &HashMap<String, String>,
        pl: &integration::LocationEvent,
    )

Source from the content-addressed store, hash-verified

376 }
377
378 async fn location_event(
379 &self,
380 _vars: &HashMap<String, String>,
381 pl: &integration::LocationEvent,
382 ) -> Result<()> {
383 let dev_info = pl
384 .device_info
385 .as_ref()
386 .ok_or_else(|| anyhow!("device_info is None"))?;
387
388 let topic =
389 self.get_event_topic(&dev_info.application_id, &dev_info.dev_eui, "location")?;
390 let b = match self.json {
391 true => serde_json::to_vec(&pl)?,
392 false => pl.encode_to_vec(),
393 };
394
395 self.publish_event(&topic, b).await
396 }
397}
398
399async fn message_callback(

Callers 2

_location_eventFunction · 0.45
test_mqttFunction · 0.45

Calls 3

as_refMethod · 0.80
get_event_topicMethod · 0.80
publish_eventMethod · 0.45

Tested by 1

test_mqttFunction · 0.36