Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Echelon Stride: test auto speed and inclination #1722

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/echelonrower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void echelonrower::forceResistance(resistance_t requestResistance) {
}

void echelonrower::sendPoll() {
uint8_t noOpData[] = {0xf0, 0xa0, 0x01, 0x00, 0x00};
uint8_t noOpData[] = {0xf0, 0xa0, 0x01, 0x00, 0x00};

noOpData[3] = counterPoll;

Expand All @@ -103,6 +103,20 @@ void echelonrower::sendPoll() {
if (!counterPoll) {
counterPoll = 1;
}

static uint8_t test = 0;
double requestSpeed = 5;

uint8_t noOpData1[] = {0xf0, test++, 0x02, 0x00, 0x00, 0x00};

noOpData1[3] = (uint8_t)(((uint16_t)(requestSpeed * 1000.0)) >> 8);
noOpData1[4] = ((uint8_t)(requestSpeed * 1000.0));

for (uint8_t i = 0; i < sizeof(noOpData1) - 1; i++) {
noOpData1[5] += noOpData1[i]; // the last byte is a sort of a checksum
}

writeCharacteristic(noOpData1, sizeof(noOpData1), QStringLiteral("force speed"), false, true);
}

void echelonrower::update() {
Expand Down
14 changes: 14 additions & 0 deletions src/echelonstride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ void echelonstride::sendPoll() {
if (!counterPoll) {
counterPoll = 1;
}

static uint8_t test = 0;
double requestSpeed = 5;

uint8_t noOpData1[] = {0xf0, test++, 0x02, 0x00, 0x00, 0x00};

noOpData1[3] = (uint8_t)(((uint16_t)(requestSpeed * 1000.0)) >> 8);
noOpData1[4] = ((uint8_t)(requestSpeed * 1000.0));

for (uint8_t i = 0; i < sizeof(noOpData1) - 1; i++) {
noOpData1[5] += noOpData1[i]; // the last byte is a sort of a checksum
}

writeCharacteristic(noOpData1, sizeof(noOpData1), QStringLiteral("force speed"), false, true);
}

void echelonstride::changeInclinationRequested(double grade, double percentage) {
Expand Down
Loading