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

Make the build warning free #69

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions examples/seek_create_flat_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ int main(int argc, char** argv)
try {
parser.ParseCLI(argc, argv);
}
catch (args::Help) {
// Parse arguments
// ericb 2022 01 17 : fix warnings
// See : https://stackoverflow.com/questions/62030341/what-is-this-catching-polymorphic-type-x-by-value-wcatch-value
catch (args::Help const &) {
std::cout << parser;
return 0;
}
catch (args::ParseError e) {
catch (args::ParseError const & e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return 1;
}
catch (args::ValidationError e) {
catch (args::ValidationError const & e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return 1;
Expand Down
8 changes: 5 additions & 3 deletions examples/seek_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,21 @@ int main(int argc, char** argv)
args::ValueFlag<int> _rotate(parser, "rotate", "Rotation - 0, 90, 180 or 270 (default) degrees", { 'r', "rotate" });

// Parse arguments
// ericb 2022 01 17 : fix warnings
// See : https://stackoverflow.com/questions/62030341/what-is-this-catching-polymorphic-type-x-by-value-wcatch-value
try {
parser.ParseCLI(argc, argv);
}
catch (args::Help) {
catch (args::Help const &) {
std::cout << parser;
return 0;
}
catch (args::ParseError e) {
catch (args::ParseError const & e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return 1;
}
catch (args::ValidationError e) {
catch (args::ValidationError const & e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return 1;
Expand Down
6 changes: 3 additions & 3 deletions examples/seek_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,16 @@ int main(int argc, char** argv) {
try {
parser.ParseCLI(argc, argv);
}
catch (args::Help) {
catch (args::Help const &) {
std::cout << parser;
return 0;
}
catch (args::ParseError e) {
catch (args::ParseError const & e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return 1;
}
catch (args::ValidationError e) {
catch (args::ValidationError const & e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return 1;
Expand Down
72 changes: 42 additions & 30 deletions src/SeekDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
#include <vector>
#include <cstdint>

#define SEEK_VENDOR_ID 0x289d

enum USB_ProductId {
SEEK_COMPACT_PID = 0x0010,
SEEK_COMPACT_PRO_PID = 0x0011,
MAX_SEEK_PRODUCT_ID = SEEK_COMPACT_PRO_PID + 1
};


/* forward struct declarations for libusb stuff */
struct libusb_context;
struct libusb_device_handle;
Expand All @@ -17,43 +26,43 @@ namespace LibSeek {

struct DeviceCommand {
enum Enum {
BEGIN_MEMORY_WRITE = 82,
COMPLETE_MEMORY_WRITE = 81,
GET_BIT_DATA = 59,
GET_CURRENT_COMMAND_ARRAY = 68,
GET_DATA_PAGE = 65,
GET_DEFAULT_COMMAND_ARRAY = 71,
GET_ERROR_CODE = 53,
GET_FACTORY_SETTINGS = 88,
GET_FIRMWARE_INFO = 78,
GET_IMAGE_PROCESSING_MODE = 63,
GET_OPERATION_MODE = 61,
GET_RDAC_ARRAY = 77,
GET_SHUTTER_POLARITY = 57,
GET_VDAC_ARRAY = 74,
READ_CHIP_ID = 54,
RESET_DEVICE = 89,
TOGGLE_SHUTTER = 55,
SET_SHUTTER_POLARITY = 56,
GET_SHUTTER_POLARITY = 57,
SET_BIT_DATA_OFFSET = 58,
SET_CURRENT_COMMAND_ARRAY = 67,
SET_CURRENT_COMMAND_ARRAY_SIZE = 66,
GET_BIT_DATA = 59,
SET_OPERATION_MODE = 60,
GET_OPERATION_MODE = 61,
SET_IMAGE_PROCESSING_MODE = 62,
GET_IMAGE_PROCESSING_MODE = 63,
SET_DATA_PAGE = 64,
SET_DEFAULT_COMMAND_ARRAY = 70,
GET_DATA_PAGE = 65,
SET_CURRENT_COMMAND_ARRAY_SIZE = 66,
SET_CURRENT_COMMAND_ARRAY = 67,
GET_CURRENT_COMMAND_ARRAY = 68,
SET_DEFAULT_COMMAND_ARRAY_SIZE = 69,
SET_FACTORY_SETTINGS = 87,
SET_FACTORY_SETTINGS_FEATURES = 86,
SET_FIRMWARE_INFO_FEATURES = 85,
SET_IMAGE_PROCESSING_MODE = 62,
SET_OPERATION_MODE = 60,
SET_RDAC_ARRAY = 76,
SET_RDAC_ARRAY_OFFSET_AND_ITEMS = 75,
SET_SHUTTER_POLARITY = 56,
SET_VDAC_ARRAY = 73,
SET_DEFAULT_COMMAND_ARRAY = 70,
GET_DEFAULT_COMMAND_ARRAY = 71,
SET_VDAC_ARRAY_OFFSET_AND_ITEMS = 72,
START_GET_IMAGE_TRANSFER = 83,
TARGET_PLATFORM = 84,
TOGGLE_SHUTTER = 55,
SET_VDAC_ARRAY = 73,
GET_VDAC_ARRAY = 74,
SET_RDAC_ARRAY_OFFSET_AND_ITEMS = 75,
SET_RDAC_ARRAY = 76,
GET_RDAC_ARRAY = 77,
GET_FIRMWARE_INFO = 78,
UPLOAD_FIRMWARE_ROW_SIZE = 79,
WRITE_MEMORY_DATA = 80,
COMPLETE_MEMORY_WRITE = 81,
BEGIN_MEMORY_WRITE = 82,
START_GET_IMAGE_TRANSFER = 83,
TARGET_PLATFORM = 84,
SET_FIRMWARE_INFO_FEATURES = 85,
SET_FACTORY_SETTINGS_FEATURES = 86,
SET_FACTORY_SETTINGS = 87,
GET_FACTORY_SETTINGS = 88,
RESET_DEVICE = 89,
};
};

Expand All @@ -66,8 +75,11 @@ class SeekDevice
* product_id: usb product id
* timeout: timeout usb requests
*/
#ifdef TEST_CHECK_SEEK_CAMERA_PRODUCT_ID
SeekDevice(int timeout=500);
#else
SeekDevice(int vendor_id, int product_id, int timeout=500);

#endif
~SeekDevice();

/*
Expand Down