mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
should be borrowing the name server object to make connections
This commit is contained in:
parent
bd54b48f8f
commit
8786b6db7b
4 changed files with 4 additions and 4 deletions
|
|
@ -138,7 +138,7 @@ pub struct MyServer {
|
||||||
callback_sid: Option<xous::SID>, // this is only necessary if you have callbacks
|
callback_sid: Option<xous::SID>, // this is only necessary if you have callbacks
|
||||||
}
|
}
|
||||||
impl MyServer {
|
impl MyServer {
|
||||||
pub fn new(xns: xous_names::XousNames) -> Result<Self, xous::Error> {
|
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
|
||||||
let conn = xns.request_connection_blocking(api::MY_SERVER_NAME).expect("Can't connect to MyServer");
|
let conn = xns.request_connection_blocking(api::MY_SERVER_NAME).expect("Can't connect to MyServer");
|
||||||
Ok(MyServer {
|
Ok(MyServer {
|
||||||
conn,
|
conn,
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ pub struct Com {
|
||||||
battstats_sid: Option<xous::SID>,
|
battstats_sid: Option<xous::SID>,
|
||||||
}
|
}
|
||||||
impl Com {
|
impl Com {
|
||||||
pub fn new(xns: xous_names::XousNames) -> Result<Self, xous::Error> {
|
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
|
||||||
let conn = xns.request_connection_blocking(api::SERVER_NAME_COM).expect("Can't connect to COM server");
|
let conn = xns.request_connection_blocking(api::SERVER_NAME_COM).expect("Can't connect to COM server");
|
||||||
Ok(Com {
|
Ok(Com {
|
||||||
conn,
|
conn,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ pub struct Gfx {
|
||||||
conn: xous::CID,
|
conn: xous::CID,
|
||||||
}
|
}
|
||||||
impl Gfx {
|
impl Gfx {
|
||||||
pub fn new(xns: xous_names::XousNames) -> Result<Self, xous::Error> {
|
pub fn new(&xns: xous_names::XousNames) -> Result<Self, xous::Error> {
|
||||||
let conn = xns.request_connection_blocking(api::SERVER_NAME_GFX).expect("Can't connect to GFX");
|
let conn = xns.request_connection_blocking(api::SERVER_NAME_GFX).expect("Can't connect to GFX");
|
||||||
Ok(Gfx {
|
Ok(Gfx {
|
||||||
conn,
|
conn,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ pub struct Trng {
|
||||||
conn: CID,
|
conn: CID,
|
||||||
}
|
}
|
||||||
impl Trng {
|
impl Trng {
|
||||||
pub fn new(xns: xous_names::XousNames) -> Result<Self, xous::Error> {
|
pub fn new(&xns: xous_names::XousNames) -> Result<Self, xous::Error> {
|
||||||
let conn = xns.request_connection_blocking(api::SERVER_NAME_TRNG).expect("Can't connect to TRNG server");
|
let conn = xns.request_connection_blocking(api::SERVER_NAME_TRNG).expect("Can't connect to TRNG server");
|
||||||
Ok(Trng {
|
Ok(Trng {
|
||||||
conn
|
conn
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue