CamTool Sample#

CamTool is a command line tool that demonstrates the features and API’s of CameraSDK. The source code is demonstrating best practice usage of CameraSDK, encapsulated in a command line parser.

Before you dive into this sample project, you should have read C++ in the “Getting Started” section. This sample is based on the CMake project file, introduced in the “Getting Started” guide.

Download#

A ZIP file with the project can be found here

Tip

See the README.md file in the project, on how to build.

File overview#

  • Shell.h/cpp: A crude interactive shell for entering commands

  • *Commands.h/cpp: The implementation of camera related commands that are triggered from the shell. SDK is called from here

  • main.cpp: The entry point that initiates the Shell and setup the available Commands

Available commands#

This is a print of the help command’s output:

Available commands:
  capture      Trigger a capture on the open camera
  close        Close the currently opened camera
  exit         Quit the application
  fwupdate     <FWP_PATH> Send a firmware upgrade package to the open camera(s)
  help         Print this help text
  hostcapacity <capacity in MB> Tells the camera how much capacity this host has available for images
  image        Image browsing and preview
  list         Prints a list of visible camera (USB only)
  logs         <DEST_FILE> Save diagnostics log from camera(s)
  notif        Enable/Disable notifications
  open         [IP=X.X.X.X|serialno=<serialno>] [password=<password>] [retries=<num>] [timeout=<secs>] Open an IP or USB camera
  opened       List all opened cameras
  pending      List pending images count, for all cameras
  property     Control of properties
  quit         Quit the application
  save         <on|off> Save received images to CWD
  subscribe    <fullImages|liveView|previews> <on|off> Toggle subscriptions to full images, LiveView or previews.

Tip

On Linux, if you can not see any connected USB cameras, please refer to our Linux Troubleshooting guide.