Hello everyone,
I've built my PC application with mingw x64 gcc compiler on MSYS2. Libraries hid-api and dlpspec were also built using the same compiler and linked to the executable. I've reused API.cpp and USB.cpp from GUI sources.
In my current setup I've
1) built hidapi to a dll using this make file
2) built libdlpspec to .a file using provided build-lib.bat
3) Linked both the libraries to my executable
Problem: The application works only when resolution was at factory default (Column 228 or Hadamard 228). When this setting is changed to any value other than 228, I get a segmentation fault/stack collision at dlpspec_scan_interpret() api call. Strange.
Returned size of serialized TPL for all configurations (default, modified and new) is 3822 bytes (Same as Qt application). There seems to be no problem in other API calls.
Here is a short snippet of my code :
// All API calls are checked for errors, but the following snippet does not explicitly lists them void* scan_data = (scanData*)malloc(SCAN_DATA_BLOB_SIZE);
scanResults scan_result; NNO_PerformScan(false); // Wait for scan to complete scan_result_bytes = NNO_GetFileSizeToRead(NNO_FILE_SCAN_DATA); bytes_read = NNO_GetFile((unsigned char *)scan_data, scan_result_bytes); dlpspec_scan_interpret(scan_data, SCAN_DATA_BLOB_SIZE, &scan_result);
I tried debugging deep into dlpspec and tpl but did not find anything. Therefore posting here if anyone has came across this problem.