Skip to content

Commit

Permalink
Add bulk write to test
Browse files Browse the repository at this point in the history
  • Loading branch information
seanavery committed Apr 11, 2024
1 parent 69cbdd3 commit e2cb723
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_ch340.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ int main(int argc, char *argv[]) {

CH340 ch340;
int err = ch340.init(product, vendor);

if (err < 0) {
std::cout << "Error initializing CH340 device." << std::endl;
return 1;
}
std::cout << "CH340 device initialized." << std::endl;

// test write
// test read
unsigned char data[10] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A};
err = ch340.bulk_write(EP_DATA_OUT, data, 10, 1000);
if (err < 0) {
std::cout << "Error writing data to CH340 device." << std::endl;
return 1;
}
std::cout << "Data written to CH340 device." << std::endl;

std::cout << "Tests completed." << std::endl;
return 0;
}

0 comments on commit e2cb723

Please sign in to comment.