Compare commits
1 commit
main
...
xmpp-send-
Author | SHA1 | Date | |
---|---|---|---|
f963d9c0b3 |
2 changed files with 6 additions and 11 deletions
|
@ -13,6 +13,7 @@ dbus-tokio = "0.7.5"
|
|||
tokio = { version = "1.19.2", features = [ "time", "macros", "rt-multi-thread" ] }
|
||||
futures = "0.3"
|
||||
futures-util = "0.3"
|
||||
tokio-xmpp = "3.2"
|
||||
xmpp = "0.3"
|
||||
xmpp-parsers = "0.19"
|
||||
log = "0.4"
|
||||
|
|
16
src/main.rs
16
src/main.rs
|
@ -26,7 +26,6 @@ use std::env::args;
|
|||
|
||||
use env_logger;
|
||||
|
||||
use futures_util::StreamExt;
|
||||
use tokio::{
|
||||
task::JoinHandle,
|
||||
time::Duration,
|
||||
|
@ -34,7 +33,7 @@ use tokio::{
|
|||
|
||||
use mmdbus::{
|
||||
dbus::{
|
||||
message::MatchRule,
|
||||
// message::MatchRule,
|
||||
nonblock::{
|
||||
SyncConnection, Proxy,
|
||||
stdintf::org_freedesktop_dbus::ObjectManager,
|
||||
|
@ -211,13 +210,7 @@ pub async fn main() -> Result<(), Error> {
|
|||
return Err(Error::InvalidArgs)
|
||||
}
|
||||
|
||||
// ModemManager
|
||||
let dbus = DBus::connect()?;
|
||||
|
||||
let mut interval = tokio::time::interval(Duration::from_secs(2));
|
||||
|
||||
let mr = MatchRule::new_signal("org.freedesktop.DBus.Properties", "PropertiesChanged");
|
||||
|
||||
let mut interval = tokio::time::interval(Duration::from_secs(5));
|
||||
|
||||
// XMPP
|
||||
let jid_str = args[1].as_str();
|
||||
|
@ -237,8 +230,9 @@ pub async fn main() -> Result<(), Error> {
|
|||
println!("Events: {:?}", events);
|
||||
},
|
||||
_ = interval.tick() => {
|
||||
let mm = ModemManager { dbus: dbus.clone() };
|
||||
let _ = print_foo(mm).await;
|
||||
println!("Foo1");
|
||||
// Uncomment to have tokio-xmpp stall right after successful bind.
|
||||
// xmpp.send_message(jid.clone(), MessageType::Chat, "en", "Bar").await;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue