You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
3.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __PROTOCOL_EUROPEAN_GENERAL__
  2. #define __PROTOCOL_EUROPEAN_GENERAL__
  3. #include "../../components/base/basicFunctionality.h"
  4. #define PROTOCOL_TYPE_3D true
  5. #define PROTOCOL_TYPE_2D false
  6. #define SERVICE_URL_TEMPLATE_NOTIFY "/simple-event/notify"
  7. #define SERVICE_URL_TEMPLATE_STATUS "/sensors/lidar%dd/%s/status"
  8. #define SERVICE_URL_TEMPLATE_FAULT "/sensors/lidar%dd/%s/fault"
  9. #define SERVICE_URL_TEMPLATE_EVENT "/sensors/lidar%dd/%s/event"
  10. #define SERVICE_URL_TEMPLATE_CALLBACK "/sensors/lidar%dd/%s/httpcallback"
  11. #define SERVICE_URL_TEMPLATE_CLOCKSYNC "/sensors/lidar%dd/%s/clocksync"
  12. #define DFSL_HARDWARE_TYPE "SensorNode"
  13. #ifdef PRU_SLAVE
  14. #define DFSL_SOURCE_NAME_ "SLAVE_SENSOR"
  15. #else
  16. #define DFSL_SOURCE_NAME_ "MASTER_SENSOR"
  17. #endif
  18. #define DFSL_CATEGORY_ALARM_3D "dfsl#intruder-drone-detected"
  19. #define DFSL_CATEGORY_ALARM_2D "dfsl#intruder-human-detected"
  20. #define DFSL_CATEGORY_STATUS "dfsl#sensor-status-message"
  21. #define DFSL_CATEGORY_ERROR "dfsl#sensor-error-message"
  22. #define DFRL_PROVIDER_ID "DFSL"
  23. #define DFSL_DATA_TYPE_TARGET "EventLidarTarget"
  24. #define DFSL_DATA_TYPE_STATUS "EventLidarStatus"
  25. #define DFSL_DATA_TYPE_ERROR "EventLidarFault"
  26. // defender-eps.eng.it
  27. #define DFSL_DEFENDER_DEFAULT_URL "/defender-eps/rest/simple-event/notify"
  28. #define DFSL_INFOSTRESS_DEFAULT_KAFKA_TOPIC "DFSL_TEST"
  29. typedef enum E_DEFENDER_CATEGORY
  30. {
  31. DC_ERROR = 0,
  32. DC_STATUS = 1,
  33. DC_ALARM = 2,
  34. DC_ALARM_3D = 3
  35. } defenderCategoryTypes;
  36. #define DFSL_DEVICE_ "DFSL Lidar Sensor"
  37. #define DFSL_LOCATION_DTO "{\"point\": [ %2.5f, %2.5f ] }"
  38. #define DFSL_SENSOR_SOURCE_DTO "{ \"type\": \"%s\", \"providerId\": \"%s\", \"sensorNodeId\" : \"%s\" }"
  39. #define DFSL_2D_TARGET_DTO "{ \"AZ\": %d, \"Range\": %d, \"Width\": %d }"
  40. #define DFSL_3D_TARGET_DTO "{ \"AZ\": %d, \"EL\": %d, \"Range\": %d }"
  41. #define DFSL_STATUS_DTO "{ \"created\": \"%s\", \"name\": \"status\", \"value\": \"%s\" }"
  42. #define DFSL_ERROR_DTO "{ \"created\": \"%s\", \"name\": \"code\", \"value\": \"%d\", \"description\": \"%s\" }"
  43. #define DFSL_SE_ENVELOPE \
  44. "{\"category\": \"%s\",\"severity\": \"%s\"," \
  45. "\"ceiId\": \"ENGIE_CEI\"," \
  46. "\"startTime\": \"%s\",\"endTime\": \"%s\", \"location\": %s, " \
  47. "\"radius\": 0, \"data\": [ %s ]}"
  48. #define PACKAGE_SE_TARGET_DATA_ELEMENT \
  49. "{\"description\": \"%s\", \"created\": \"%s\", \"source\": %s," \
  50. " \"name\": \"%s\", \"type\": \"%s\", \"lidarSensorEventId\": \"%s\", \"targets\": [%s] }"
  51. #define PACKAGE_SE_STATUS_DATA_ELEMENT \
  52. "{\"description\": \"%s\", \"created\": \"%s\", \"source\": %s, " \
  53. " \"name\": \"%s\", \"type\": \"%s\", \"lidarSensorEventId\": \"%s\", \"measurements\": [%s] }"
  54. #define PACKAGE_INFOSTRESS_DATA_2D \
  55. "{\"id\": \"%s\", \"version\": \"1.0\", \"partner\": \"DFSL\"," \
  56. "\"device\": \"%s\", \"azimuth\": %0.3f, " \
  57. "\"range\": %0.3f, \"width\": %d }"
  58. #define PACKAGE_INFOSTRESS_DATA_3D \
  59. "{\"id\": \"%s\", \"version\": \"1.0\", \"partner\": \"DFSL\"," \
  60. "\"device\": \"%s\", \"azimuth\": %0.3f, \"elevation\": %0.3f, " \
  61. "\"range\": %0.3f }"
  62. #define OS_SCANNER_NAME_SIZE 128
  63. #define OS_CEP_ADDRESS_SIZE 128
  64. #ifdef __linux__
  65. unsigned long long getSHDTimeValue(void);
  66. #else
  67. unsigned __int64 getSHDTimeValue(void);
  68. #endif
  69. CSTR getSHDTimeStamp(void);
  70. bool correctSHDTime(int diff);
  71. extern CSTR defenderStatusMode[];
  72. extern CSTR defenderFaultCode[];
  73. extern CSTR defenderCategories[];
  74. extern CSTR defenderTypeDescription[];
  75. extern CSTR defenderTypeSeverity[];
  76. #endif