Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
fix: make methods public
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropix126 committed Feb 5, 2024
1 parent 1720fcc commit b7ff159
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/pros/src/devices/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,25 +197,25 @@ impl Controller {
}
}

fn connected(&self) -> Result<bool, ControllerError> {
pub fn connected(&self) -> Result<bool, ControllerError> {
Ok(bail_on!(PROS_ERR, unsafe {
pros_sys::controller_is_connected(self.id as _)
}))
}) != 0)
}

fn battery_capacity(&self) -> Result<i32, ControllerError> {
pub fn battery_capacity(&self) -> Result<i32, ControllerError> {
Ok(bail_on!(PROS_ERR, unsafe {
pros_sys::controller_get_battery_capacity(self.id as _)
}))
}

fn battery_level(&self) -> Result<i32, ControllerError> {
pub fn battery_level(&self) -> Result<i32, ControllerError> {
Ok(bail_on!(PROS_ERR, unsafe {
pros_sys::controller_get_battery_level(self.id as _)
}))
}

fn rumble(&mut self, pattern: &str) -> Result<(), ControllerError> {
pub fn rumble(&mut self, pattern: &str) -> Result<(), ControllerError> {
bail_on!(PROS_ERR, unsafe {
pros_sys::controller_rumble(
self.id as _,
Expand All @@ -228,23 +228,23 @@ impl Controller {
Ok(())
}

fn clear_line(&mut self, line: u8) -> Result<(), ControllerError> {
pub fn clear_line(&mut self, line: u8) -> Result<(), ControllerError> {
bail_on!(PROS_ERR, unsafe {
pros_sys::controller_clear_line(self.id as _, line)
});

Ok(())
}

fn clear_screen(&mut self) -> Result<(), ControllerError> {
pub fn clear_screen(&mut self) -> Result<(), ControllerError> {
bail_on!(PROS_ERR, unsafe {
pros_sys::controller_clear(self.id as _)
});

Ok(())
}

fn set_text(&mut self, text: &str, line: u8, col: u8) -> Result<(), ControllerError> {
pub fn set_text(&mut self, text: &str, line: u8, col: u8) -> Result<(), ControllerError> {
bail_on!(PROS_ERR, unsafe {
pros_sys::controller_set_text(
self.id as _,
Expand Down

0 comments on commit b7ff159

Please sign in to comment.