mirror of
https://github.com/fbarresi/Sharp7.git
synced 2026-02-04 08:42:51 +00:00
@@ -1,6 +1,12 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
All notable changed to this project will be documented in this file.
|
All notable changed to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [1.1.81] - 18.05.2022
|
||||||
|
### Added
|
||||||
|
### Changed
|
||||||
|
### Fixed
|
||||||
|
- Removed obsolete SetBitAt [#27](https://github.com/fbarresi/Sharp7/issues/27)
|
||||||
|
|
||||||
## [1.1.80] - 18.05.2022
|
## [1.1.80] - 18.05.2022
|
||||||
### Added
|
### Added
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Sharp7.Tests
|
|||||||
[Fact] public void TestGetBitAt() { S7.GetBitAt(new byte[] {1,2,3,4}, 0, 0).ShouldBe(true); }
|
[Fact] public void TestGetBitAt() { S7.GetBitAt(new byte[] {1,2,3,4}, 0, 0).ShouldBe(true); }
|
||||||
[Fact] public void TestSetBitAt() {
|
[Fact] public void TestSetBitAt() {
|
||||||
var buffer = new byte[] {1,2,3,4};
|
var buffer = new byte[] {1,2,3,4};
|
||||||
S7.SetBitAt(ref buffer, 0, 1, true);
|
S7.SetBitAt(buffer, 0, 1, true);
|
||||||
buffer.ShouldBe(new byte[] {3, 2, 3, 4});
|
buffer.ShouldBe(new byte[] {3, 2, 3, 4});
|
||||||
}
|
}
|
||||||
[Fact] public void TestSetBitAtAsExtensionMethod() {
|
[Fact] public void TestSetBitAtAsExtensionMethod() {
|
||||||
|
|||||||
@@ -49,12 +49,6 @@ namespace Sharp7
|
|||||||
return (buffer[pos] & Mask[bit]) != 0;
|
return (buffer[pos] & Mask[bit]) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use SetBitAt as extension method")]
|
|
||||||
public static void SetBitAt(ref byte[] buffer, int pos, int bit, bool value)
|
|
||||||
{
|
|
||||||
buffer.SetBitAt(pos, bit, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetBitAt(this byte[] buffer, int pos, int bit, bool value)
|
public static void SetBitAt(this byte[] buffer, int pos, int bit, bool value)
|
||||||
{
|
{
|
||||||
byte[] Mask = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
|
byte[] Mask = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
|
||||||
|
|||||||
Reference in New Issue
Block a user