feat(sdk): connect + Power/Settings клиенты (bus-тест — План 3)
connect (system/session по SHTURMAN_BUS); PowerClient/SettingsClient — типизированные обёртки proxy. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Alexander <akotenev2003@gmail.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
//! Бутстрап D-Bus-соединения. Прод/VM — **системная шина устройства** (ipc §1);
|
||||
//! dev/тесты — сессионная (env `SHTURMAN_BUS=session`, см. План 3).
|
||||
|
||||
use zbus::Connection;
|
||||
|
||||
/// Подключиться к шине Штурмана.
|
||||
/// По умолчанию — системная; `SHTURMAN_BUS=session` → сессионная (герметичные тесты/dev).
|
||||
pub async fn connect() -> zbus::Result<Connection> {
|
||||
match std::env::var("SHTURMAN_BUS").as_deref() {
|
||||
Ok("session") => Connection::session().await,
|
||||
_ => Connection::system().await,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user