panda-official / TimeSwipe

PANDA Timeswipe driver and firmware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add vector to TimeSwipe driver?!

IngoKaiser opened this issue · comments

Running this code:

#include <iostream>
#include <thread>
#include <chrono>
#include <vector>
#include "timeswipe.hpp"

int main(int argc, char *argv[])
{
    TimeSwipe tswipe;

    tswipe.SetBridge(0);
    tswipe.SetSensorOffsets(0,0,0,0);
    tswipe.SetSensorGains(1,1,1,1);
    tswipe.SetSensorTransmissions(1,1,1,1);

    int count = 0;
    tswipe.Start([&](auto&& records, uint64_t errors) {
            for (size_t i = 0; i < records.size(); i++) {
                count = count + 1;
            }
    });

    std::this_thread::sleep_for(std::chrono::seconds(10));
    tswipe.Stop();
    std::cout << "count: " << count << std::endl;
    return 0;
}

I need to include vector. Could we just add this to driver?

Add std lib dependencies into the "timeswipe.hpp" in commit:
866f264