@@ -18,8 +18,8 @@ public class RFIDControllerMfrc522
18
18
19
19
#region Private Members
20
20
21
- private readonly SpiChannel SpiPort = null ;
22
- private readonly GpioPin OutputPort = null ;
21
+ private readonly SpiChannel _spiPort ;
22
+ private readonly GpioPin _outputPort ;
23
23
24
24
#endregion
25
25
@@ -43,8 +43,8 @@ public RFIDControllerMfrc522()
43
43
public RFIDControllerMfrc522 ( SpiChannel spiPort , int spiFrquency , GpioPin outputPort )
44
44
{
45
45
Pi . Spi . Channel0Frequency = spiFrquency ;
46
- SpiPort = spiPort ;
47
- OutputPort = outputPort ;
46
+ _spiPort = spiPort ;
47
+ _outputPort = outputPort ;
48
48
InitializeComponent ( ) ;
49
49
}
50
50
@@ -551,7 +551,7 @@ public byte ReadRegister(Register register)
551
551
{
552
552
var address = ( byte ) register ;
553
553
var addressPayload = ( byte ) ( ( ( address << 1 ) & 0x7E ) | 0x80 ) ;
554
- var readValue = SpiPort . SendReceive ( new byte [ ] { addressPayload , 0 } ) ;
554
+ var readValue = _spiPort . SendReceive ( new byte [ ] { addressPayload , 0 } ) ;
555
555
return readValue [ 1 ] ;
556
556
}
557
557
@@ -563,7 +563,7 @@ public byte ReadRegister(Register register)
563
563
/// <returns>A standard controller response</returns>
564
564
public RfidResponse CardSendData ( Command command , byte [ ] sendData )
565
565
{
566
- const byte MaximumLength = 16 ;
566
+ const byte maximumLength = 16 ;
567
567
568
568
var backData = new List < byte > ( ) ;
569
569
byte receivedBitCount = 0 ;
@@ -640,8 +640,8 @@ public RfidResponse CardSendData(Command command, byte[] sendData)
640
640
if ( currentRegisterValue == 0 )
641
641
currentRegisterValue = 1 ;
642
642
643
- if ( currentRegisterValue > MaximumLength )
644
- currentRegisterValue = MaximumLength ;
643
+ if ( currentRegisterValue > maximumLength )
644
+ currentRegisterValue = maximumLength ;
645
645
646
646
i = 0 ;
647
647
while ( i < currentRegisterValue )
@@ -875,8 +875,8 @@ public byte[] DumpRegisters(byte[] authKey, byte[] cardUniqueId)
875
875
/// </summary>
876
876
private void InitializeComponent ( )
877
877
{
878
- OutputPort . PinMode = GpioPinDriveMode . Output ;
879
- OutputPort . Write ( true ) ;
878
+ _outputPort . PinMode = GpioPinDriveMode . Output ;
879
+ _outputPort . Write ( true ) ;
880
880
881
881
Reset ( ) ;
882
882
@@ -897,7 +897,7 @@ private void InitializeComponent()
897
897
/// <param name="value">The value.</param>
898
898
private void WriteRegister ( byte register , byte value )
899
899
{
900
- SpiPort . Write ( new byte [ ]
900
+ _spiPort . Write ( new byte [ ]
901
901
{
902
902
( byte ) ( ( register << 1 ) & 0x7E ) ,
903
903
value
0 commit comments