Skip to content

Commit 285410a

Browse files
authored
Merge pull request #33 from Jim-Hodapp-Coaching/refine_module_privacy
Tighten scope of modules, enums, structs and trait symbols across the entire crate
2 parents 7ef74ee + b9135db commit 285410a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

esp32-wroom-rp/src/protocol.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ pub const MAX_NINA_PARAM_LENGTH: usize = 255;
1010

1111
#[repr(u8)]
1212
#[derive(Copy, Clone, Debug)]
13-
pub enum NinaCommand {
13+
pub(crate) enum NinaCommand {
1414
GetFwVersion = 0x37u8,
1515
SetPassphrase = 0x11u8,
1616
GetConnStatus = 0x20u8,
1717
Disconnect = 0x30u8,
1818
}
1919

20-
pub trait NinaParam {
20+
pub(crate) trait NinaParam {
2121
// Length of parameter in bytes
2222
type LengthAsBytes: IntoIterator<Item = u8>;
2323

@@ -33,7 +33,7 @@ pub trait NinaParam {
3333
}
3434

3535
// Used for Nina protocol commands with no parameters
36-
pub struct NinaNoParams {
36+
pub(crate) struct NinaNoParams {
3737
_placeholder: u8,
3838
}
3939

@@ -62,25 +62,25 @@ impl NinaParam for NinaNoParams {
6262
}
6363

6464
// Used for single byte params
65-
pub struct NinaByteParam {
65+
pub(crate) struct NinaByteParam {
6666
length: u8,
6767
data: Vec<u8, 1>,
6868
}
6969

7070
// Used for 2-byte params
71-
pub struct NinaWordParam {
71+
pub(crate) struct NinaWordParam {
7272
length: u8,
7373
data: Vec<u8, 2>,
7474
}
7575

7676
// Used for params that are smaller than 255 bytes
77-
pub struct NinaSmallArrayParam {
77+
pub(crate) struct NinaSmallArrayParam {
7878
length: u8,
7979
data: Vec<u8, MAX_NINA_PARAM_LENGTH>,
8080
}
8181

8282
// Used for params that can be larger than 255 bytes up to MAX_NINA_PARAM_LENGTH
83-
pub struct NinaLargeArrayParam {
83+
pub(crate) struct NinaLargeArrayParam {
8484
length: u16,
8585
data: Vec<u8, MAX_NINA_PARAM_LENGTH>,
8686
}
@@ -220,7 +220,7 @@ impl NinaParam for NinaLargeArrayParam {
220220
}
221221
}
222222

223-
pub trait ProtocolInterface {
223+
pub(crate) trait ProtocolInterface {
224224
fn init(&mut self);
225225
fn reset<D: DelayMs<u16>>(&mut self, delay: &mut D);
226226
fn get_fw_version(&mut self) -> Result<FirmwareVersion, self::Error>;
@@ -230,7 +230,7 @@ pub trait ProtocolInterface {
230230
}
231231

232232
#[derive(Debug, Default)]
233-
pub struct NinaProtocolHandler<B, C> {
233+
pub(crate) struct NinaProtocolHandler<B, C> {
234234
/// A Spi or I2c instance
235235
pub bus: B,
236236
/// An EspControlPins instance

esp32-wroom-rp/src/protocol/operation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const MAX_NUMBER_OF_PARAMS: usize = 4;
66
// Encapsulates all information needed to execute commands against Nina Firmware.
77
// along with user supplied data. Ex. SSID, passphrase, etc.
88

9-
pub struct Operation<P> {
9+
pub(crate) struct Operation<P> {
1010
pub params: Vec<P, MAX_NUMBER_OF_PARAMS>,
1111
pub command: NinaCommand,
1212
pub has_params: bool,

0 commit comments

Comments
 (0)