Skip to content

Commit

Permalink
Restore ByteCommsSensorBase and PollingSensorBase
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianstevens committed Apr 24, 2023
1 parent f4ae846 commit c964273
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ public abstract class ByteCommsSensorBase<UNIT> :
/// </summary>
protected IByteCommunications? Peripheral { get; set; }

/// <summary>
/// The read buffer
/// </summary>
protected Memory<byte> ReadBuffer { get; private set; }

/// <summary>
/// The write buffer
/// </summary>
protected Memory<byte> WriteBuffer { get; private set; }

/// <summary>
/// Creates a new ByteCommsSensorBase object
/// </summary>
Expand Down Expand Up @@ -54,6 +64,17 @@ protected ByteCommsSensorBase(
Init(readBufferSize, writeBufferSize);
}

/// <summary>
/// ByteCommsSensorBase abstract ctor with no bus
/// </summary>
/// <param name="readBufferSize">Read buffer size</param>
/// <param name="writeBufferSize">Write buffer size</param>
protected ByteCommsSensorBase(
int readBufferSize = 8, int writeBufferSize = 8)
{
Init(readBufferSize, writeBufferSize);
}

/// <summary>
/// Simple constructor for peripherals that don't use a bus
/// and don't need an IByteCommunications
Expand Down
10 changes: 0 additions & 10 deletions Source/Meadow.Foundation.Core/PollingSensorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ public abstract class PollingSensorBase<UNIT>
: SamplingSensorBase<UNIT>, ISamplingSensor<UNIT>
where UNIT : struct
{
/// <summary>
/// The read buffer
/// </summary>
protected Memory<byte> ReadBuffer { get; private set; }

/// <summary>
/// The write buffer
/// </summary>
protected Memory<byte> WriteBuffer { get; private set; }

/// <summary>
/// Starts updating the sensor on the updateInterval frequency specified.
///
Expand Down

0 comments on commit c964273

Please sign in to comment.