should be borrowing the name server object to make connections

This commit is contained in:
bunnie 2021-04-04 02:15:29 +08:00
parent bd54b48f8f
commit 8786b6db7b
4 changed files with 4 additions and 4 deletions

View file

@ -138,7 +138,7 @@ pub struct MyServer {
callback_sid: Option<xous::SID>, // this is only necessary if you have callbacks
}
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");
Ok(MyServer {
conn,

View file

@ -42,7 +42,7 @@ pub struct Com {
battstats_sid: Option<xous::SID>,
}
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");
Ok(Com {
conn,

View file

@ -16,7 +16,7 @@ pub struct Gfx {
conn: xous::CID,
}
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");
Ok(Gfx {
conn,

View file

@ -8,7 +8,7 @@ pub struct Trng {
conn: CID,
}
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");
Ok(Trng {
conn