CTC PUSH

Scope

This document provides details of the PUSH-based message streaming channels (Custom Destination Streaming) offered by CalAmp. It details how you configure the custom destinations, the different type of custom destinations supported, the different parameters needed for different types of destinations, how often the data is pushed, and the content-type and schema of the data pushed to the custom destination.

Destination Configuration

You can set up any CTC account with a custom destination to push device messages to, if the account has the appropriate subscription.

Subscriptions with PUSH Support
For the Custom Destination Streaming feature to be enabled for an account, one of the following subscriptions needs to be assigned to it: Connect Basic Push or Connect Pro Push.

📘

NOTE:

Changes to subscriptions on accounts can take up to 24 hours to propagate through the system.

Supported Destination Types
CTC currently supports the following destination types:

  • AWS_SQS: Only standard queues are currently supported. FIFO (first in first out) queues are not supported.
  • AWS_KINESIS: The Amazon Kinesis Client Library (Amazon KCL) is used to consume and process messages from the Kinesis data stream.
  • KAFKA_SASL_SCRAM: A Kafka cluster supporting SASL_SCRAM is used as the authentication mechanism (by default, SCRAM-SHA-512). Clusters supporting SCRAM-SHA-216 can be configured with the property sasl.mechanism. AWS MSK is supported.
  • KAFKA_SASL_PLAIN: A Kafka cluster supporting SASL_PLAIN is used as the authentication mechanism. Confluent Cloud and Azure Event Hub with a shared access signature are supported.

Kafka Certificates
Make sure that the certificates used to configure Kafka clusters were issued by globally trusted providers. CTC also supports self-hosted Kafka instances with the authentication modes mentioned earlier, with globally trusted providers.

Destination Setup API

URL: https://<host:port>/connect/services/accounts/{accountId}/messageendpoint
Method: POST
HTTP request headers:

  • calamp-services-app: the application key of the CTC application for which the request is made
  • Content-Type: application/json
  • Set-Cookie: authToken= (the authentication token generated by CTC when a user logs in)

Request Payload
The request payload is the JSON document that describes the message endpoint information, including the owning account and the endpoint configuration.

{
    "messageEndpoint": {
        "groups": null,
        "configuration": {
        	"type": "AWS_KINESIS",
            "awsAccessKeyId": "<AWS_ACCESS_KEY>",
            "awsSecretAccessKey": "<AWS_SECRET_ACCESS_KEY>",
            "region": "<AWS_REGION>",
            "streamName": "<AWS_KINESIS_STREAM_NAME>"
        },
        "status": "Enabled"
    }
}
{
    "messageEndpoint": {
        "groups": null,
        "configuration": {
        	"type": "AWS_SQS",
            "awsAccessKeyId": "<AWS_ACCESS_KEY>",
            "awsSecretAccessKey": "<AWS_SECRET_ACCESS_KEY>",
            "region": "<AWS_REGION>",
            "queueName": "<AWS_SQS_NAME>"
        },
        "status": "Enabled"
    }
}
{
    "messageEndpoint": {
        "groups": null,
        "configuration": {
           "type": "KAFKA_SASL_SCRAM",
           "bootstrapServers": "<BOOTSTRAP_SERVERS_STRING>",
           "topicName": "<KAFKA_TOPIC_NAME>",
           "username": "<USERNAME>",
           "password": "<PASSWORD>",
           "kafkaProducerProperties": {
                 "acks": "<0, 1, or all>",
                 "sasl.mechanism": "SCRAM-SHA-216"	
           },
        },
        "status": "Enabled"
    }
}
{
    "messageEndpoint": {
        "groups": null,
        "configuration": {
        	"type": "KAFKA_SASL_PLAIN",
            "bootstrapServers": "<BOOTSTRAP_SERVERS_STRING>",
            "topicName": "<KAFKA_TOPIC_NAME>",
            "username": "<USERNAME>",
            "password": "<PASSWORD>",
        },
        "status": "Enabled"
    }
}

The supplied credentials should allow CTC to write to the configured destination.

📘

NOTE:

For brevity and generality, the https scheme, the host name, and the port are omitted from further examples. Instead, the endpoints and URLs will show only the context, path, and other relevant parameters.

Message Streaming Frequency

How often messages are pushed to your custom destination depends on the destination type. CTC pushes each message as it arrives and finishes processing. There are some optimizations built into the producer libraries, and destinations themselves might have some restrictions. These are the current frequencies:

  • AWS_SQS: Messages are pushed as they arrive.
  • AWS_KINESIS: Messages are pushed at least every 100 ms; if the combined size of the batch reaches 256KB; or the number of messages in the batch reaches 500.
  • Kafka: You can control the frequency of writing the message by Kafka producer properties in the configuration attribute.

Compression

For Kafka, you can control compression using the compression.type property. The message size is governed by the broker configuration for the respective cluster. There is no schema change for compressed versus uncompressed messages when you are using Kafka.

Compression is enabled for messages that exceed the SQS or Kinesis default size limits. SQS by default supports a maximum message size of 256kb, and Kinesis supports a maximum message size of 1MB. To overcome this message size limitation, CTC will perform message compression if necessary, which will require clients to decompress the messages to process them.

📘

NOTE:

Messages that don’t exceed the size limits are not compressed.

The messages are compressed using a ZLIB compression library algorithm and then Base64 encoded. The UTF-8 character set is used for character encoding.

To decompress and process a compressed message, follow these steps:

  1. Read the message from SQS or Kinesis.
  2. Convert it into a JSON object.
  3. Read the compressedMessage property. If the compressedMessage property is not null, it is a compressed message; otherwise, it is an uncompressed message.
  4. You can read the length of a compressed message before compression in the uncompressedMessageSize property.
  5. Decode the compressed message content with a Base64 decoder.
  6. Decompress the compressed message using the ZLIB compression library algorithm.
  7. After the message is decompressed, convert it into a string using the UTF-8 character set to read the actual message.

Compressed Message Schema

{
  "version": "type: string",
 
  // meta information about the device message
  "header": {
    "deviceIdType": "type: string",
    "deviceId": "type: string",
    "messageType": "type: string; description: an enumeration type like [EVENT_REPORT, USER, APPLICATION, ID_REPORT, EXTENDED_ID_REPORT, DEVICE_COMMAND, AEMP ...]",
    "lmdirectMessageType": "type: int; description: integer value for the message type per LMDirect protocol spec",
    "messageSequenceNumber": "type: int; description: the sequence number of the message",
    "messageTime": "type: long",
    "messageReceivedTime": "type: long",
    "messageUuid": "type:string; description: the message UUID",
    "rawDeviceHexMessage": "type: string",
    "optionExtensions": {
   	   "vin": "string",
	     "esn": "string"
    },
    "deviceAirId": "type: string",
    "enriched": "type: boolean",
    "deviceEsn": "type: string"
  },
     
     // compression attributes, only visible for compressed messages
    "uncompressedMessageSize": "type: integer; description: integer value for the message size before compression",

  "compressedMessage": "type:string; description: the compressed message which holds the entire actual message in compressed format"

}

Uncompressed Message Schema

{
  "version": "type: string",
 
  // meta information about the device message
  "header": {
    "deviceIdType": "type: string",
    "deviceId": "type: string",
    "mobileId": "type: string",
    "mobileIdTypeString": "type: string",
    "messageType": "type: string; description: an enumeration type like [EVENT_REPORT, USER, APPLICATION, ID_REPORT, EXTENDED_ID_REPORT, DEVICE_COMMAND, AEMP ...]",
    "lmdirectMessageType": "type: int; description: integer value for the message type per LMDirect protocol spec",
    "messageSequenceNumber": "type: int; description: the sequence number of the message",
    "messageTime": "type: long",
    "messageReceivedTime": "type: long",
    "messageUuid": "type:string; description: the message UUID",
    "rawDeviceHexMessage": "type: string",
    "optionExtensions": {
       "vin": "string",
       "esn": "string"
    },
    "deviceAirId": "type: string",
    "enriched": "type: boolean",
      "deviceEsn": "type: string"
  },

  // entity associations
  "associations": {
    "device": {
      "href": "type:string",
      "rel": "string",
      "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
      "title": "type:string; generally the name of the resource this link is for"
    },
 
    "account": {
      "href": "type:string",
      "rel": "string",
      "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
      "title": "type:string; generally the name of the resource this link is for"
    },
 
    "asset": {
      "link": {
        "href": "type:string",
        "rel": "string",
        "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
        "title": "type:string; generally the name of the resource this link is for"
      },
      "vin": "type: string",
      "category": "type:string",
      "type": "type: string",
      "externalId": "type: string",
      "route": {
        "href": "type:string",
        "rel": "string",
        "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
        "title": "type:string; generally the name of the resource this link is for"
      },
 
      "operators": [{
        "href": "type:string",
        "rel": "string",
        "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
        "title": "type:string; generally the name of the resource this link is for",
        "category": "type:string",
        "type": "type:string"
        "externalId": "type:string"
}]
    },
 
    "ioProfile": {
      "href": "type:string",
      "rel": "string",
      "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
      "title": "type:string; generally the name of the resource this link is for"
    },
 
    "pegBehavior": {
      "href": "type:string",
      "rel": "string",
      "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
      "title": "type:string; generally the name of the resource this link is for"
    },
    
      "reportingDevice": {
      "href": "type:string",
      "rel": "string",
      "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
      "title": "type:string; generally the name of the resource this link is for"
    },       
          "groups": [{
        "href": "type:string",
        "rel": "string",
        "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
        "title": "type:string; generally the name of the resource this link is for"
      }]

  },
 
  "content": {
    "created": "type: date",
    // device state info.
    "gps": {
      "timeOfFix": "type: datetime",
      "latitude":"type: double",
      "longitude": "type: double",
      "altitude": { "units": "string", "value": "string"},
      "hdop": "type: double",
      "heading": "type: int",
      "speed": { "units": "string", "value": "string"},
      "satellites": "type: int",
      "computedFixStatus": "type: boolean",  /* derived value from the gpsFixStatus bitmap field with some internal algorithm */
      "fixStatus": {
        "predicted": "type: boolean",
        "differentiallyCorrected": "type: boolean",
        "lastKnown": "type: boolean",
        "invalidFix": "type: boolean",
        "twoDFix": "type: boolean",
        "historic": "type: boolean",
        "invalidTime": "type: boolean"
      },
      "antennaStatus": "type: boolean",   // taken from the gpsAntennaStatus field from the commGpsSatus field
      "receiverTracking": "type: boolean", // taken from the gpsAntennaStatus field from the commGpsSatus field
      "receiverSeftTest": "type: boolean" // LMU32 only; refer to the 2017 version of LMDirect protocol specification page 146
    },
 
    "wirelessModem": {
      "carrier": "type: int",
      "rssi": { "units": "type: string", "value": "type: string" },
      "available": "type: boolean",
      "networkService": "type: boolean",
      "dataService": "type: boolean",
      "connected": "type: boolean",
      "voiceCallIsActive": "type: boolean",
      "roaming": "type: boolean",
      "networkTechnology": "type: string" // 2G, 3G, LTE, Reserved
    },
 
    "otaUpdateStatus": "type: boolean", // LMU32 only; refer to the 2017 version of LMDirect protocol specification, page 146
 
    "inputs": {
      // key value pairs
      "ignition": "value",
      "input pin#2": "value",
      "input pin#3": "value",
      "input pin#4": "value",
      "input pin#5": "value",
      "input pin#6": "value",
      "input pin#7": "value",
      "value": "type: string",
      "workingIdle": "value"
    },
       
    // common enrichments
    "location": {  
      "address1": "type: string",
      "address2": "type: string",
      "addressLatitude": "type: double",
      "addressLongitude": "type: double",
      "street": "type: string", 
      "city": "type: string",
      "county": "type: string",
      "stateProvinceCd": "type: string",
      "state": "type: string",
      "postalCode": "type: string",
      "country": "type: string",
      "crossStreet": "type: string",
      "crossStreetDistance": "type: double",
      "postedSpeedLimit": "type: int",
      "roadTypeCode": "type: string",
      "speedLimitUnits": "type: string",
      "tollRoadFlag": "type: string",
      "timeZoneOffset": "type: string",
      "timeZoneId": "type: string"
    },
 
    // Server Side Geozone Or LandMark
    "serverGeozones": [{
      "id": "type: int",
      "name": "type: string",
      "description": "type: string"
    }],
 
    "accumulators ": [{
      "label": "type: string",
      "value": "type: string",
      "index": "type: string",
      "units": "type: string",
      "type" : "type: string",
            "multi": [{
"value": "type: string",
"type" : "type: string", 
"units": "type: string"
       }]
    }],
 
    "weather": {
      "skyCondition": "type: string",
      "weatherIcon": "type: integer",
      "precipitation": "type: string",
      "severity": "type: integer",
      "iconCodeExtend": "type: integer"
    },
 
    // message type-specific content and enrichments
    "EVENT_REPORT": {
      "eventCode": "type: string",
      "eventLabel": "type: string",
      "engineHourOffset": "type: long",
      "odometerOffset": "type: float",
       
      // The following are additional information derived from the accumulators.
      "inputChanged": { // the list of inputs that change state; the value is the current value
       // key value pairs
        "input#1": "value",
        "input#2": "value",
        ...
      },
      "vbusIndicators": {
        "_comment": "VbusIndicator 0; only this being exposed to AO, AE",
        "ignitionStatus": "type: boolean",
        "milStatus": "type: boolean",
        "airbagDashIndicator": "type: boolean",
        "absDashIndicator": "type: boolean",
        "ptoStatus": "type: boolean",
        "seatBeltFastened": "type: boolean",
        "brakePedalPressed": "type: boolean",
        "absActiveLamp": "type: boolean",
        "cruiseControlStatus": "type: boolean",
        "oilPressureLamp": "type: boolean",
        "parkBrakeLight": "type: boolean",
        "coolantHotLight": "type: boolean",
        "tpmsStatus": "type: boolean",
       
        "_comment": "VbusIndicator 1",
        "misfireMonitor": "type: boolean",
        "fuelSystemMonitor": "type: boolean",
        "comprehensiveComponentMonitor": "type: boolean",
        "catalystMonitor": "type: boolean",
        "heatedCatalystMonitor": "type: boolean",
        "evaporativeSystemMonitor": "type: boolean",
        "secondaryAirSystemMonitor": "type: boolean",
        "acSystemRefrigerantMonitor": "type: boolean",
        "oxygenSensorMonitor": "type: boolean",
        "oxygenSensorHeatedMonitor": "type: boolean",
        "egrSystemMonitor": "type: boolean",
        "o2SensorCircuitNoActivity": "type: boolean",
        "o2SensorHeaterCircuitMalfunction": "type: boolean",
        "ho2SHeaterControlMalfunction": "type: boolean",
        "ho2SHeaterResistanceMalfunction": "type: boolean"
      },
      "acceleration": {
        "label": "type: string",
        "accelerationMagnitude": {
            "units": "type: string",
            "value": "type: string" 
        },
        "duration": {
            "units": "type: string",
            "value": "type: string" 
        },
        "startingSpeed": {
            "units": "type: string",
            "value": "type: string" 
        },
        "calibration": {
            "units": "type: string",
            "value": "type: string" 
        }
      },
      "geoZoneEvents": [{
        "zoneId": "type: int",
        "zoneName": "type: string",
        "pegIndex": "type: int",
        "eventType": "type: string enum ['ENTRY', 'EXIT']",
        "noChange": "type: boolean" //"If TRUE then it indicates the previous and current geozone state bitmaps are the same"
      }],
      "speedEvent": {
        "duration": {
            "units": "type: string",
            "value": "type: string" 
        },
        "maxSpeed": {
            "units": "type: string",
            "value": "type: string" 
        }
      },
"electedValues": {
        "speed": {
            "units": "type: string",
            "value": "type: string" 
        },
        "odometer": {
            "units": "type: string",
            "value": "type: string" 
        },
   "engineHour": {
            "units": "type: string",
            "value": "type: string" 
        }
      }
    },
 
    "USER": {
      "userMessageId": "type: int",
      "userMessageRoute": "type: int",
      "userMessageLength": "type: int",
      "userMessage": "type: string",
      "rawUserHexMessage": "type: string"
    },
 
    "APPLICATION": {
      "@class":"APPLICATION",
      "type": "type: string", // the type should be one of the following, based on the type value, only one of the following element should follow.[DTC,VEHICLE_BUS_CAPABILITIES,MOTION_LOG,SELF_DESCRIBING_JPOD,JPOD2DTC_REPORT,JBUS,VIDEO_EVENT]
      "appType: "type: string",
      "rawAppHexMessage": "type: string",
      "appMessageTypeId": "type: int" // LMDirect application message subtype
      "appMessageType": "type: string eum", // depend on the type, one of the following specific message content should be present
      "appMessageLength": "type: string",
      "appMessageMessage": "type: Array[string]",
 
      "DTC": { //type: 132, VBus DTC Report
        "@class": "DTC",
        "codes": [{
          "code": "type: string",
          "description": "type: string",
          "type": "type: integer",
          "typeDescription": "type: string"
        }],
        "reportTypeCode": "type: int",
        "reportTypeDescription": "type: string"
      },
 
      "VEHICLE_BUS_CAPABILITIES": { // type: 131, Vehicle ID Report
        "@class": "VEHICLE_BUS_CAPABILITIES",
        "absActiveLampIndicator": "type: boolean",
        "absDashIndicator": "type: boolean",
        "acSystemRefrigerantMonitor": "type: boolean",
        "airBagDashIndicator": "type: boolean",
        "ambientAirTempSupported": "type: boolean",
        "barometricPressureSupported": "type: boolean",
        "batteryVoltageSupported": "type: boolean",
        "brakeIndicatorLightStatus": "type: boolean",
        "brakeSwitchStatusIndicator": "type: boolean",
        "calculatedFuelUsageSupported": "type: boolean",
        "canBusErrorTypeSupported": "type: boolean",
        "canBusModeSupported": "type: boolean",
        "canRecSupported": "type: boolean",
        "canTecSupported": "type: boolean",
        "catalystMonitor": "type: boolean",
        "comprehensiveComponentMonitor": "type: boolean",
        "coolantHotLightStatus": "type: boolean",
        "created": "type: string",
        "cruiseControlStatus": "type: boolean",
        "dtcCountSupported": "type: boolean",
        "egrSystemMonitor": "type: boolean",
        "engine": "type: string",
        "engineCoolantTemperatureSupported": "type: boolean",
        "engineOilTempSupported": "type: boolean",
        "engineRunTimeSupported": "type: boolean",
        "engineSize": "type: string",
        "engineSpeedSupported": "type: boolean",
        "engineStateSupported": "type: boolean",
        "ho2SHeaterControlMalfunction": "type: boolean",
        "ho2SHeaterResistanceMalfunction": "type: boolean",
        "evaporativeSystemMonitor": "type: boolean",
        "fuelEconomySupported": "type: boolean",
        "fuelLevelRemaining3030Supported": "type: boolean",
        "fuelLevelRemainingSupported": "type: boolean",
        "fuelLevelSupported": "type: boolean",
        "fuelRateSupported": "type: boolean",
        "fuelSystemMonitorStatus": "type: boolean",
        "fuelType": "type: string",
        "heatedCatalystMonitor": "type: boolean",
        "ignitionStatus": "type: boolean",
        "maintenanceRequired": "type: boolean",
        "make": "type: string",
        "manufacturer": "type: string",
        "messageUuid": "type: string",
        "milStatus": "type: boolean",
        "misfireMonitorStatus": "type: boolean",
        "model": "type: string",
        "o2SensorCircuitNoActivity": "type: boolean",
        "o2SensorHeaterCircuitMalfunction": "type: boolean",
        "obdProtocol": "type: string",
        "odometerSupported": "type: boolean",
        "oilPressureLampIndicator": "type: boolean",
        "oxygenSensorHeatedMonitor": "type: boolean",
        "oxygenSensorMonitor": "type: boolean",
        "ptoStatus": "type: boolean",
        "seatBeltFastenedIndicator": "type: boolean",
        "secondaryAirSystemMonitor": "type: boolean",
        "serviceIntervalDaysRemainingSupported": "type: boolean",
        "serviceIntervalInspectionDistanceSupported": "type: boolean",
        "serviceIntervalOilDaysSupported": "type: boolean",
        "serviceIntervalOilDistanceSupported": "type: boolean",
        "throttlePositionSupported": "type: boolean",
        "transmissionGearSupported": "type: boolean",
        "trim": "type: string",
        "tripFuelConsumptionSupported": "type: boolean",
        "tripOdometerSupported": "type: boolean",
        "turnSignalStatusSupported": "type: boolean",
        "vehicleSpeedSupported": "type: boolean",
        "vinRegion": "type: string",
        "year": "type: string"
      },
 
      "MOTION_LOG": {
        "@class": "MOTION_LOG",
        "recordType": "type: int",
        "info": [{ // type: 122, Motion Log Report
          "forwardAcceleration": "type: string",
          "lateralAcceleration": "type: string",
          "verticalAcceleration": "type: string",
          "systemTick": "type: int",
          "accelerationAmplitude": "type: string",
          "vehicleBusRPM": "type: string",
          "vehicleBusSpeed": "type: string"
        }]
      },
 
      "SELF_DESCRIBING_JPOD": { // type: 142, Vbus group data Report; DTC2Report type in RS swagger.
        "@class": "SELF_DESCRIBING_JPOD",
        "dataOptionsValue": "type: int",
        "sizeFieldIncluded": "type: boolean",
        "parameterDataSourceFieldIncluded": "type: boolean",
        "parameterSourceAddressFieldIncluded": "type: boolean",
        "paramaterIDFieldIncluded": "type: boolean",
        "dataPostionFieldIncluded": "type: boolean",
        "reportID": "type: int",
        "machineState": "type: int",
        "parameterGroup": "type: int",
        "parameterList": [{
          "dataReportParameter":{
            "parameterSize": "type: int",
            "parameterDataSourceValue": "type: int",
            "dataSourceDesc": "type: string",
            "parameterSourceAddressValue": "type: int",
            "sourceAddressDesc": "type: string",
            "responseSourceAddress": "type: string",
            "parameterIDValue": "type: int",
            "pgnLabel": "type: string",
            "dataPosition": "type: int",
            "dataPositionDesc": "type: string",
            "parameterBitCount": "type: string",
            "parameterValueHexValue": "type: string",
            "spnDetail": {
              "label": "type: string",
              "value": "type: string",
              "units": "type: string"
            }
          }
        }]
      },
   
      "JPOD2DTC_REPORT": [{ // type: 138, Vbus Diagnostics Report
        "@class": "JPOD2DTC_REPORT",
        "typeHexValue": "type: string",
        "hasSourceAddress": "type: boolean",
        "unreportedDTCsOnly": "type: boolean",
        "length": "type: int",
        "lampHexValue": "type: string",
        "flashLampHexValue": "type: string",
        "codes": [{
          "sourceAddress": "type: int",
          "spn": "type: int",
          "fmi": "type: int",
          "conversionMethod": "type: int",
          "occurrenceCount": "type: int",
          "spnDescription": "type: string",
          "fmiDescription": "type: string"
        }]
      }],
 
      "JBUS": { // type: 130, VBUS Data Report
        "@class":"JBUS",
        "type": "type: string", // the type should be one of the following; based on the type value, only one of the following element should follow. [EVENT, DTC1939_EVENT, DTC1708_EVENT, DAILY_REPORT, CONSTRUCTION_DAILY_REPORT, CONSTRUCTION_DAILY_USAGE_REPORT, CONSTRUCTION_HOURLY_REPORT, HYDRAULIC_REPORT, FAULT_REPORT, DISCOVERY_REPORT, HOURLY_REPORT]
        "EVENT": [{ // the current JbusEvent
          "batteryVoltage": "type: double",
          "engineCoolantTemperature": "type: int",
          "engineOilTemperature": "type: double",
          "engineSpeed": "type: double",
          "highResolutionOdometer": "type: double",
          "jbusProtocol": "type: string",
          "odometer": "type: double",
          "seatBeltUsed": "type: boo",
          "switchedBatteryVoltage": "type: double",
          "totalEngineHours": "type: double",
          "totalFuel": "type: double",
          "totalIdleFuel": "type: double",
          "totalIdleHours": "type: double",
          "vin": "type: string"
         }],
        "DTC1939_EVENT": {
            "@class": "DTC1939_EVENT",
            "sourceAddress": "type: int",
            "jbusDtc1939ProtocolEvents":[{
                "jbusDtc1939Protocol": {
                    "spn": "type: int",
                    "fmi": "type: int",
                    "oc": "type: int",
                    "spnDescription": "type: string",
                    "fmiDescription": "type: string"
                }
            }]
        },
        "DTC1708_EVENT": {
            "@class": "DTC1708_EVENT",
            "sourceAddress": "type: int",
            "jbusDtc1708ProtocolEvents":[{
                "jbusDtc1708Protocol": {
                    "fmi": "type: int",
                    "pid": "type: int",
                    "oc": "type: int",
                    "csf": "type: boolean",
                    "dct": "type: boolean",
                    "lci": "type: boolean"
                }
            }]
        },
        "DAILY_REPORT": {
            "@class": "DAILY_REPORT",
            "engineTotalHours": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineIdleHours": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineIdleFuel": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineOilLevel": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineCoolantLevel": {
                "value": "type: string",
                "units": "type: string"
            },
            "noxTankLevel": {
                "value": "type: string",
                "units": "type: string"
            }
        },
        "DTC_MESSAGE": {},
        "CONSTRUCTION_DAILY_REPORT": {
            "@class": "CONSTRUCTION_DAILY_REPORT",
            "machineState":{
                "engineStatus": "type: boolean",
                "ptoStatus": "type: boolean",
                "moving": "type: boolean",
                "j1708MsgRecvd": "type: boolean",
                "j1939MsgRecvd": "type: boolean"
            },
            "engineTotalFuelUsed": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgEngineFuelRate": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgActualEngineTorque": {
                "value": "type: string",
                "units": "type: string"
            },
            "minEngineSpeed": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxEngineSpeed": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgEngineSpeed": {
                "value": "type: string",
                "units": "type: string"
            },
            "minDEFConcentration": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgDEFConcentration": {
                "value": "type: string",
                "units": "type: string"
            },
            "minDEFTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxDEFTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgDEFTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "minEngineOilPressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxEngineOilPressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgEngineOilPressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "minEngineOilTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxEngineOilTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgEngineOilTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "minEngineCoolantTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxEngineCoolantTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgEngineCoolantTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "minEngineFuelTempr1": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxEngineFuelTempr1": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgEngineFuelTempr1": {
                "value": "type: string",
                "units": "type: string"
            },
            "minAmbientAirTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxAmbientAirTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgAmbientAirTempr": {
                "value": "type: string",
                "units": "type: string"
            },
            "minAuxiliaryTempr1": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxAuxiliaryTempr1": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgAuxiliaryTempr1": {
                "value": "type: string",
                "units": "type: string"
            }
        },
        "CONSTRUCTION_DAILY_USAGE_REPORT": {
            "@class": "CONSTRUCTION_DAILY_USAGE_REPORT",
            "machineState":{
                "engineStatus": "type: boolean",
                "ptoStatus": "type: boolean",
                "moving": "type: boolean",
                "j1708MsgRecvd": "type: boolean",
                "j1939MsgRecvd": "type: boolean"
            }
        },
        "CONSTRUCTION_HOURLY_REPORT": {
            "@class": "CONSTRUCTION_HOURLY_REPORT",
            "machineState":{
                "engineStatus": "type: boolean",
                "ptoStatus": "type: boolean",
                "moving": "type: boolean",
                "j1708MsgRecvd": "type: boolean",
                "j1939MsgRecvd": "type: boolean"
            },
            "totalEngineHours": {
                "value": "type: string",
                "units": "type: string"
            },
            "defOrNoxTankLevel": {
                "value": "type: string",
                "units": "type: string"
            },
            "fuelTankLevel1": {
                "value": "type: string",
                "units": "type: string"
            }
        },
        "HYDRAULIC_REPORT": {
            "@class": "HYDRAULIC_REPORT",
            "machineState":{
                "engineStatus": "type: boolean",
                "ptoStatus": "type: boolean",
                "moving": "type: boolean",
                "j1708MsgRecvd": "type: boolean",
                "j1939MsgRecvd": "type: boolean"
            },
            "minHydraulicChargePressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxHydraulicChargePressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgHydraulicChargePressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "minHydraulicOilTemperature": {
                "value": "type: string",
                "units": "type: string"
            },
            "maxHydraulicOilTemperature": {
                "value": "type: string",
                "units": "type: string"
            },
            "avgHydraulicOilTemperature": {
                "value": "type: string",
                "units": "type: string"
            }
        },
        "FAULT_REPORT": {
            "@class": "FAULT_REPORT",
            "machineState":{
                "engineStatus": "type: boolean",
                "ptoStatus": "type: boolean",
                "moving": "type: boolean",
                "j1708MsgRecvd": "type: boolean",
                "j1939MsgRecvd": "type: boolean"
            },
            "sourceAddress": "type: int",
            "faultDevice": "type: int",
            "function": "type: int",
            "failure": "type: int"
        },
        "DISCOVERY_REPORT": {
            "@class": "DISCOVERY_REPORT",
            "machineState":{
                "engineStatus": "type: boolean",
                "ptoStatus": "type: boolean",
                "moving": "type: boolean",
                "j1708MsgRecvd": "type: boolean",
                "j1939MsgRecvd": "type: boolean"
            },
            "vehicleSpeedFound": "type: boolean",
            "odometerFound": "type: boolean",
            "totalFuelFound": "type: boolean",
            "vinFound": "type: boolean",
            "batteryVoltageSourcesFound": "type: boolean",
            "discoveryReportSourcesFound1": "type: boolean",
            "discoveryReportSourcesFound2": "type: boolean",
            "discoveryReportSourcesFound3": "type: boolean",
            "discoveryReportSourcesFound4": "type: boolean",
            "fuelTankSourcesFound": "type: boolean",
            "averageFuelTankSourcesFound": "type: boolean",
            "ptoSourcesFound": "type: boolean",
            "engineTorqueSourcesFound": "type: boolean",
            "engineThrottleSourcesFound": "type: boolean"
        },
        "HOURLY_REPORT": {
            "@class": "HOURLY_REPORT",
            "engineCoolantTemperature": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineOilTemperature": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineOilPressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineCrankcasePressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineCoolantPressure": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineBatteryVoltage": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineFuelTankLevel1": {
                "value": "type: string",
                "units": "type: string"
            },
            "engineFuelTankLevel2": {
                "value": "type: string",
                "units": "type: string"
            },
            "transmissionOilTemperature": {
                "value": "type: string",
                "units": "type: string"
            },
            "averageFuelEconomy": {
                "value": "type: string",
                "units": "type: string"
            }
        }
      },
  "VIDEO_EVENT": { // type: 70, Video Event
      "@class":"VIDEO_EVENT",
        "videoDetail": {
          "messageType": "type: string", //type should be one of the following: DVR_VIDEO,EDVR_VIDEO,VIDEO"
          "videoLink": "type: string",
          "tripId": "type: string",
          "fleetId": "type: string",
          "driverId": "type: string",
          "eventIndex": "type: int",
          "startTimeUTC": "type: long",
          "endTimeUTC": "type: long",
          "videoQuality": "type: int",
          "videoResolution": "type: string",
          "unitSystem": "type: string",
          "enableTimeLapse": "type: boolean",
          "timelapseCaptureInterval": "type: int",
          "timelapseDisplayInterval": "type: int",
          "uploadRequestId": "type: string",
          "requestedOn": "type: long",
          "requestType": "type: string",
          "videoRequestId": "type: string",
          "hlth": "type: int",
          "eventCode": "type: int"
        },
        "avlEvent": {
          "messageUuid": "type: string",
          "eventCode": "type: string",
          "eventLabel": "type: string",
          "eventTime": "type: long"
        }
      }
    },
    "AEMP": {
      "equipmentHeader": {
        "make": "type: string",
        "model": "type: string",
        "equipmentID": "type: string",
        "serialNumber": "type: string"
      },
      "location": {
        "datetime": "type: date",
        "latitude": "type: double",
        "longitude": "type: double",
        "altitude": {
          "meters": "type: double",
          "feet": "type: double",
          "inches": "type: double"
        },
        "altitudeUnits": "type: string"
      },
      "cumulativeOperatingHours": {
        "dateTime": "type: date",
        "hour": "type: string"
      },
      "distance": {
        "datetime": "type: date",
        "odometerUnits": "type: string",
        "odometer": "type: string"     
      },
      "fuelUsed":{
        "datetime": "type: date",
        "fuelUnits": "type: string",
        "fuelConsumed": "type: double"
      },
      "fuelUsedLast24": {
        "datetime": "type: date",
        "fuelUnits": "type: string",
        "fuelConsumed": "type: double"
      }
    },
 
    "DEVICE_COMMAND": {
      "created": "type: date",
      "UUID": "type: String",
      "status": "type: string enum(CREATED, QUEUED, SENT, COMPLETED, UNDELIVERABLE, EXPIRED_TIME, EXPIRED_ATTEMPTS, CANCELLED, CANCELLED_COMPLETED",
      "sequenceId": "type: integer",
      "response": "type: enum(AckNakResponse, LocateReportResponse, ParameterResponse)",
      "retries": "type: integer",
      "queuedFor": "type: date",
      "sentOn": "type: date",
      "completedOn": "type: Date",
      "identifiers": [{
        "identifier": "type: string",
        "type": "type: string enum(id, esn, iccid, imei, mdn, meid, min, serialNumber)"
      }],
      "command": {
        "commandType": "type: string enum(LocateReport, PegAction, SetAndEnableZone, SetGeoZone, IdReport, ParameterRead, ParameterWrite, Reboot, OtaDownload, UnitRequest, SendApplicationMessage, SendUserMessage, SciDeviceSettings, DownloadFirmware)",
        "name": "type: string",
        "description": "type: string",
        "retryCapable": "type: boolean",
        "maxRetries": "type: integer",
        "ttlSec": "type: integer",
        "parameters": "type: a set of key/value pairs"
      },
      "batchId": "type: string",
      "batchSeq": "type: integer",
      "boolean autoRetry": "type: boolean (default 'true')"
    },
 
    "LOCO_EVENT": {
      "batchId": "type: string",
      "cep": "type: integer",
      "type": "type: integer",
      "status": {
        "externalPower": "type: boolean",
        "charging": "type: boolean",
        "wakeupType": "type: integer",
        "signal": "type: integer",
        "gpsfailcount": "type: integer",
        "tamper": "type: integer",
        "powerDown": "type: boolean",
        "orientation": {
          "x": "type: double",
          "y": "type: double",
          "z": "type: double"
        }
      },
      "states": {
        "moving": "type: boolean",
        "tamper": "type: boolean",                           
        "ignition": "type: boolean",
        "paired": "type: boolean"
      },
      "tagReports": [
        "batchId": "type: string",
        "cep": "type: integer",
        "type": "type: integer",
        "nextUpdateTime": "type: date",
        "model": "type: string",
        "status": {
           "seqNum": "type: long",
           "externalPower": "type: boolean",
           "charging": "type: boolean",
           "wakeupType": "type: integer",
           "lastUpdate": "type: date"
        },
        "master": "type: String",
        "event": {
          "type": "type:  enum(impact, drop, tip)",
          "G": "type: double",
          "angle": "type: double"
        },
        "rssi": {
          "units": "type: string",
          "value": "type: string"
        },
        "accumulators": [{
          "label": "type: string",
          "value": "type: string",
          "index": "type: string",
          "units": "type: string",
          "type": "type: string"
        }],
        "timeSeriesData": [{
          "label": "type: string",
          "value": "type: string",
          "index": "type: string",
          "units": "type: string",
          "type": "type: string",
          "time": "type: date"
        }]
      ],
      "slaveList": "type: list of string",
      "nextUpdateTime": "type: date",
      "live": "type: boolean",
      "slaveDetails": "type: list of integer",
      "model": "type: string",
      "sensorEvent": "type: string",
      "sensorEventTime": "type: date",
      "cells": [{
        "mcc": "type: integer",
        "mnc": "type: integer",
        "cellId": "type: integer",
        "lac": "type: integer",
        "rssi": "type: integer"
      }],
      "wifi": [{
        "mac": "type: long",
        "rssi": "type: integer",
        "ssid": "type: string"
      }],
      "settingsChanged": "type: boolean",
      "wifiProbe": {
         "mac": "type: integer",
         "locations": "type: list of double",
         "ssid": "type: integer"
      },
      "gpsTrack": {
        "period": "type: integer",
        "points": "type: list of double"
      },
      "event": {
        "type": "type:  enum(impact, drop, tip)",
        "G": "type: double",
        "angle": "type: double"
      },
      "timeSeriesData": [{
        "label": "type: string",
        "value": "type: string",
        "index": "type: string",
        "units": "type: string",
        "type": "type: string",
        "time": "type: date"
      }]
    },
    
    "LMU_GATEWAY": {
        "@class": "LMU_GATEWAY",
        "reportSequenceNumber": "type: int",
        "messageNumber": "type: int",
        "totalNumberOfMsgs": "type: int",
        "moving": "type: boolean",
        "reportTime": "type: date",
        "tagList": ["type: String"],
        "tagRecords": [{
            "verbose": "type: boolean",
            "macAddress": "type: string",
            "serialNumber": "type: string",
            "rssi": "type: int",
            "age": "type: int",
            "inAccountHierarchy": "type: boolean",
            "batchId": "type: string",
            "device": {
                "href": "type:string",
                "rel": "type:string",
                "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
                "title": "type:string; generally the name of the resource this link is for"
            },
            "account": {
                "href": "type:string",
                "rel": "type:string",
                "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
                "title": "type:string; generally the name of the resource this link is for"
            },
            "asset": {
                "link": {
                    "href": "type:string",
                    "rel": "type:string",
                    "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
                    "title": "type:string; generally the name of the resource this link is for"
                }
            },
            "reportingDevice": {
                "href": "type:string",
                "rel": "type:string",
                "status": "type: string enum, ['Enabled', 'Disabled', 'Suspended', 'Deleted']",
                "title": "type:string; generally the name of the resource this link is for"
            }
        }],
        "deviceId": "type: long",
        "batchId": "type: string"
    },
    "TRACKER": {
        "@class": "TRACKER",                             
        "eventCode": "type:string",
        "eventLabel": "type:string"
    },
     "VIDEO_EVENT": {
        "@class": "VIDEO_EVENT",                             
        "eventCode": "type:string",
        "eventLabel": "type:string"
    }
  }
}