Adding bus parameter
//! # Configuration
//!
//! The service can be configured in the `/home/system/etc/config.toml` with the following fields:
-//! ```
+//!
+//! - `bus` - Specifies the UART bus the OEM6 is connected to
+//! - `ip` - Specifies the service's IP address
+//! - `port` - Specifies the port on which the service will be listening for UDP packets
+//!
+//! For example:
+//!
+//! ```toml
+//! [novatel-oem6-service]
+//! bus = "/dev/ttyS4"
+//!
//! [novatel-oem6-service.addr]
//! ip = "127.0.0.1"
//! port = 8082
//! ```
//!
-//! Where `ip` specifies the service's IP address, and `port` specifies the port which UDP requests should be sent to.
-//!
//! # Starting the Service
//!
//! The service should be started automatically by its init script, but may also be started manually:
//!
-//! ```
+//! ```toml
//! $ novatel-oem6-service
//! Kubos OEM6 service started
//! Listening on: 10.63.1.20:8082
@@ -251,8 +259,6 @@ use novatel_oem6_api::OEMResult;
use schema::{MutationRoot, QueryRoot};
use std::sync::Arc;
-// TODO: CHANGE THE UART BUS TO UART4!!!
-
fn main() -> OEMResult<()> {
Service::new(
Config::new("novatel-oem6-service"),
@@ -263,3 +269,19 @@ fn main() -> OEMResult<()> {
Ok(())
}
+
+/* TODO: Use once master has been merged into main service PR
+fn main() -> OEMResult<()> {
+ let config = Config::new("novatel-oem6-service");
+ let bus = config
+ .get("bus")
+ .expect("No OEM6 device path found in config");
+ let bus = bus.as_str()?;
+
+ let subsystem = Subsystem::new(bus, Arc::new(LockData::new()))?;
+
+ Service::new(config, subsystem, QueryRoot, MutationRoot).start();
+
+ Ok(())
+}
+*/
