Geofencing C++

Namespaces

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

Classes

class  IgeofencingObserver
 Geofencing Observer base class. More...
 
class  Geofencing
 Allows to interact with geofencing server. More...
 
class  GeofencingClient
 Interacts with geofencing server. More...
 

Detailed Description

Geofencing API related documentation

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

Examples

  • Add a geofence defined as a point and a radius
    Add a geofence defined as a set of points:

    //#include <dpyutils/logging.h>
    #include <iostream>
    #include <dpy/geofencingApi.h>
    volatile bool waiting = true;
    void result_async_handler(boost::system::error_code ec)
    {
    if (ec) {
    std::cout << "\rError : " << ec.message() << std::endl;
    } else {
    std::cout << "\rAsynchronous operation forwarded successfully" << std::endl;
    }
    waiting = false;
    }
    main() {
    Geofencing geofencing;
    std::vector<std::pair<double, double>> positionList;
    positionList.push_back(std::pair<double, double>(41.651856,-4.728325));
    positionList.push_back(std::pair<double, double>(41.652217,-4.729280));
    positionList.push_back(std::pair<double, double>(41.652441,-4.727939));
    geofencing.asyncAddPolygon(result_async_handler,"geofence_area_polygon",1,"geofence_name",1,positionList);
    while (waiting == true)
    {
    }
    }

  • Add a geofence defined as a point and a radius
    Add a geofence defined as a point and a radius

    #include <iostream>
    #include <dpy/geofencingApi.h>
    volatile bool waiting = true;
    void result_async_handler(boost::system::error_code ec)
    {
    if (ec) {
    std::cout << "\rError : " << ec.message() << std::endl;
    } else {
    std::cout << "\rAsynchronous operation forwarded successfully" << std::endl;
    }
    waiting = false;
    }
    main() {
    Geofencing geofencing;
    geofencing.asyncAddCircle (result_async_handler,"geofence_area_circle",1,"geofence_name",1, std::pair<double, double>(41.651856,-4.728325),25);
    while (waiting == true)
    {
    }
    }

  • Feed a Custom Position (async method)
    This is an example of how to feed a Custom Position:

  • Feed a Custom Position (sync method)
    This is an example of how to feed a Custom Position:

  • Disable Feed Custom Position (async method)
    This is an example of how to disable Feed Custom Position:

  • Disable Feed Custom Position (sync method)
    This is an example of how to disable Feed Custom Position: