Merge branch 'DataConverter' into develop

This commit is contained in:
shinichi
2020-09-11 12:39:43 +02:00
3 changed files with 23 additions and 5 deletions

View File

@@ -176,7 +176,7 @@ namespace Hardware
antMessage[12] = checksum;//reminder that i am dumb :P
bleBike?.WriteCharacteristic("6E40FEC3-B5A3-F393-E0A9-E50E24DCCA9E", antMessage);
bleBike.WriteCharacteristic("6e40fec3-b5a3-f393-e0a9-e50e24dcca9e", antMessage);
}
}
}

View File

@@ -51,17 +51,17 @@ namespace Hardware
Console.WriteLine($"Accumulated power: {accumPower} watt (Rollover 65536)");
int instantPower = (bytes[5]) | (bytes[6]>>4)<<8;
int instantPower = (bytes[5]) | (bytes[6] & 0b00001111)<<8;
if (instantPower != 0xFFF)
Console.WriteLine($"Instant power: {instantPower} watt (Range 0-4094)");
// other flags that are not really used but might be useful
int trainerStatus = bytes[6] & 0b00001111; // bit 4-7
int trainerStatus = bytes[6] & 0b11110000; // bit 4-7
int flags = bytes[7] >> 4;
int FEState = bytes[7] & 0b00001111;
break;
default:

View File

@@ -23,7 +23,25 @@ namespace ProftaakRH
}
bLEHandler.setResistance(25);
Console.ReadLine();
while (true)
{
string input = Console.ReadLine();
input.ToLower();
input.Trim();
if(input == "quit")
{
break;
}
try
{
int resistance = Int32.Parse(input);
bLEHandler.setResistance(resistance);
}
catch
{
//do nothing
}
}
}
}
}