| 300 | } |
| 301 | |
| 302 | async fn ack_event( |
| 303 | &self, |
| 304 | _vars: &HashMap<String, String>, |
| 305 | pl: &integration::AckEvent, |
| 306 | ) -> Result<()> { |
| 307 | let dev_info = pl |
| 308 | .device_info |
| 309 | .as_ref() |
| 310 | .ok_or_else(|| anyhow!("device_info is None"))?; |
| 311 | |
| 312 | let topic = self.get_event_topic(&dev_info.application_id, &dev_info.dev_eui, "ack")?; |
| 313 | let b = match self.json { |
| 314 | true => serde_json::to_vec(&pl)?, |
| 315 | false => pl.encode_to_vec(), |
| 316 | }; |
| 317 | |
| 318 | self.publish_event(&topic, b).await |
| 319 | } |
| 320 | |
| 321 | async fn txack_event( |
| 322 | &self, |