| 281 | } |
| 282 | |
| 283 | async fn join_event( |
| 284 | &self, |
| 285 | _vars: &HashMap<String, String>, |
| 286 | pl: &integration::JoinEvent, |
| 287 | ) -> Result<()> { |
| 288 | let dev_info = pl |
| 289 | .device_info |
| 290 | .as_ref() |
| 291 | .ok_or_else(|| anyhow!("device_info is None"))?; |
| 292 | |
| 293 | let topic = self.get_event_topic(&dev_info.application_id, &dev_info.dev_eui, "join")?; |
| 294 | let b = match self.json { |
| 295 | true => serde_json::to_vec(&pl)?, |
| 296 | false => pl.encode_to_vec(), |
| 297 | }; |
| 298 | |
| 299 | self.publish_event(&topic, b).await |
| 300 | } |
| 301 | |
| 302 | async fn ack_event( |
| 303 | &self, |