Imager Scan Engine C++

Namespaces

 dpyImagerscanengine
 Deepsy Imagerscanengine namespace that includes the different enums, structs or method signatures that should be used.
 

Classes

class  ImagerScanEngine
 Allows to interact with the Imager Scan Engine service. More...
 

Detailed Description

Imager Scan Engine API related documentation

A quick overview of basic Imager Scan Engine API capabilities and examples is given.
If you find Imager Scan Engine API useful and would like to know more details, please check out further sections of the Imager Scan Engine API documentation or contact the Deepsy platform team.

Examples

  • Creating a Imager Scan Engine object

    #include <dpy/imagerScanEngineApi.h>


  • Reboot the Imager Scan Engine
    This functionality allows to reboot the Imager Scan Engine. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncReboot(requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Select read mode
    This functionality allows to select a read mode. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncSetReadMode(dpyImagerscanengine::ReadMode::DISABLE, requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Enables or disables illumination properties
    This functionality allows to enable or disable illumination properties. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncSetIlluminationProperties(dpyImagerscanengine::Illumination::BLINK, requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Set brightness properties
    This functionality allows to set brightness properties. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncSetBrightnessProperties(dpyImagerscanengine::Brightness::STANDARD, requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Set detection mode properties
    This functionality allows to set detection properties. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncSetDetectionProperties(dpyImagerscanengine::DetectionMode::NO_ILLUMINATION, requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Set sensitivity properties
    This functionality allows to set sensitivity properties. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncSetSensitivityProperties(dpyImagerscanengine::SensitivityMode::SENSITIVE, requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Set reread timeout value
    This functionality allows to set the minimum time between two equal barcode readings. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncSetRereadTimeoutProperties(10, requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Enables or disables horizontal and vertical mirrored image settings
    This functionality allows to enable or disable mirrored image settings. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncSetImageMirroredSettings(dpyImagerscanengine::Rotation::HORIZONTAL_VERTICAL, requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Get scanner list events
    This functionality allows to get plugged or removed scanner events. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void listEventsHandler(const boost::system::error_code& rEc, dpyImagerscanengine::ListEvent event)
    {
    if (rEc) {
    std::cout << "Error : " << rEc.message() << std::endl;
    } else {
    std::cout << "Scanner plugged" << std::endl;
    }else{
    std::cout << "Scanner unplugged" << std::endl;
    }
    }
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncGetListEvents(listEventsHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Get scanner information
    This functionality allows to get scanner information. An example on how to get this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void scannerInfoHandler(const boost::system::error_code& rEc, dpyImagerscanengine::ScannerInfo info)
    {
    std::string readmode;
    std::string illumination;
    std::string detectMode;
    std::string brightness;
    std::string senseMode;
    int rereadTimeout;
    std::string rotation;
    if (rEc) {
    std::cout << "Error : " << rEc.message() << std::endl;
    } else {
    switch (info.readmode) {
    readmode = "Manual";
    break;
    readmode = "Autotrigger";
    break;
    readmode = "Disable";
    break;
    }
    switch (info.illumination) {
    illumination = "Enable";
    break;
    illumination = "Disable";
    break;
    illumination = "Blink";
    break;
    }
    switch (info.detectMode) {
    detectMode = "White illumination";
    break;
    detectMode = "No illumination";
    break;
    detectMode = "Green aiming";
    break;
    }
    switch (info.brightness) {
    brightness = "Low";
    break;
    brightness = "Standard";
    break;
    }
    switch (info.senseMode) {
    senseMode = "Insensitive";
    break;
    senseMode = "Normal";
    break;
    senseMode = "Sensitive";
    break;
    }
    rereadTimeout = info.rereadTimeout;
    switch (info.rotation) {
    rotation = "Horizontal and Vertical";
    break;
    rotation = "Horizontal";
    break;
    rotation = "Vertical";
    break;
    rotation = "None";
    break;
    }
    std::cout << "Current Read Mode: " << readmode << std::endl;
    std::cout << "Current Illumination Mode: " << illumination << std::endl;
    std::cout << "Current Detection Mode: " << detectMode << std::endl;
    std::cout << "Current Brightness Mode: " << brightness << std::endl;
    std::cout << "Current Sensitivity Mode: " << senseMode << std::endl;
    std::cout << "Current Reread Timeout: " << rereadTimeout << std::endl;
    std::cout << "Current Image Rotation Mode: " << rotation << std::endl;
    waiting = false;
    }
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncGetScannerInfo(scannerInfoHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Get last scanned code
    This functionality allows to get the last scanned code. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void scannedCodesHandler(const boost::system::error_code& rEc, const std::string& rReadCode)
    {
    if (rEc) {
    std::cout << "Error : " << rEc.message() << std::endl;
    } else {
    std::cout << "Code read successfully, content: " << rReadCode << std::endl;
    }
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncGetLastScannedCode(scannedCodesHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Get scanned codes
    This functionality allows to get scanned codes. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void scannedCodesHandler(const boost::system::error_code& rEc, const std::string& rReadCode)
    {
    if (rEc) {
    std::cout << "Error : " << rEc.message() << std::endl;
    } else {
    std::cout << "Code read successfully, content: " << rReadCode << std::endl;
    }
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    scanEngine.asyncGetScannedCodes(scannedCodesHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }

  • Save image
    This functionality allows to capture an image and save it. An example on how to set this functionality is provided:

    #include <iostream>
    #include <dpy/imagerscanengineApi.h>
    #include <boost/thread.hpp>
    bool waiting = true;
    void requestHandler(boost::system::error_code error_code)
    {
    std::cout << "Result = " << error_code.value() << " , " << error_code.message().c_str() << std::endl;
    waiting = false;
    }
    int main(int argc, char *argv[])
    {
    ImagerScanEngine scanEngine;
    std::string imagePath = "/tmp/imageExample.bmp";
    scanEngine.asyncSaveImage(imagePath, requestHandler);
    while(waiting)
    {
    boost::this_thread::sleep_for(boost::chrono::seconds(1));
    }
    return 0;
    }