// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; option java_package = "com.amazonaws.iot.autobahn.schemas"; package Aws.IoTFleetWise.Schemas.CollectionSchemesMsg; /* * List of collectionSchemes to be enacted by AWS IoT FleetWise Edge */ message CollectionSchemes { /* * List of collectionSchemes. On receipt of this, Edge will discard all collectionSchemes it currently has and enact these. */ repeated CollectionScheme collection_schemes = 1; /* * Timestamp of when the collectionScheme list was created. */ uint64 timestamp_ms_epoch = 2; } /* * A definition of an individual collectionScheme containing what/when/how to send vehicle data to cloud. A * collectionScheme can be condition based, with data sent whenever a condition evaluates to true, or it can be time * based, with data sent at periodic intervals. */ message CollectionScheme { /* * Synchronization ID of the campaign this collectionScheme is part of */ string campaign_sync_id = 1; /* * Synchronization ID of the required decoder manifest for this collectionScheme */ string decoder_manifest_sync_id = 2; /* * When collectionScheme should start in milliseconds since the Unix epoch */ uint64 start_time_ms_epoch = 3; /* * When collectionScheme should expire in milliseconds since the Unix epoch. This collectionScheme expiration date * is meant to serve as an end date for a collectionScheme so it does not keep running forever in the case * that a vehicle permanently loses internet connection to the cloud */ uint64 expiry_time_ms_epoch = 4; /* * A collectionScheme type containing attributes that are specific to that collectionScheme type. Currently support * time based (such as a heartbeat) and condition based collectionSchemes. */ oneof collection_scheme_type { TimeBasedCollectionScheme time_based_collection_scheme = 5; ConditionBasedCollectionScheme condition_based_collection_scheme = 6; } /* * This specifies how much time to spend collecting data after a condition evaluates to true. When after_duration_ms * elapses whatever data collected up to that point ( if any was present on the vehicle ) is sent to the cloud. */ uint32 after_duration_ms = 7; /* * All active DTCs including the time they were first seen active will be sent when the collectionScheme triggers. */ bool include_active_dtcs = 8; /* * List of signal ids to collect or have attribute(s) required by a condition function node */ repeated SignalInformation signal_information = 9; /* * List of Raw CAN Frame(s) to be collected and sent to cloud */ repeated RawCanFrame raw_can_frames_to_collect = 10; /* * When true, all data will be written to persistent storage when vehicle doesn't not have an internet connection */ bool persist_all_collected_data = 11; /* * When true, collected data will be compressed and then sent to cloud. */ bool compress_collected_data = 12; /* * An integer between describing the priority for the data collection. CollectionSchemes with low priority numbers * will have higher priority and will be processed first. */ uint32 priority = 13; /* * An optional probabilities message indicating the probability that a CollectionScheme be enacted. */ Probabilities probabilities = 14; /* * Image Data to collect as part of this collectionScheme. */ repeated ImageData image_data = 15; } message Probabilities{ /* * Double between 0 and 1 giving the probability after a condition is met. * 0: never send, 1: send always. It is usable for both condition and time based collectionSchemes. */ double probability_to_send = 1; } /* * Contains time based specific attributes necessary for time based collectionSchemes such as a heartbeat. */ message TimeBasedCollectionScheme { /* * Time in milliseconds that will be the interval of a time based collectionScheme if is_time_based_collection_scheme is * set to true. This field is unused if is_time_based_collection_scheme is set false. */ uint32 time_based_collection_scheme_period_ms = 1; } /* * Contains condition based specific attributes necessary for condition based collectionSchemes */ message ConditionBasedCollectionScheme { /* * The minimum time in milliseconds required to elapse between conditions that evaluate to true for data to be sent * to the cloud. */ uint32 condition_minimum_interval_ms = 1; /* * The version number associated with the event condition language used in the abstract syntax tree. We are starting * at 0 for alpha and we will increment as we add features */ uint32 condition_language_version = 2; /* * Root condition node for the Abstract Syntax Tree. */ ConditionNode condition_tree = 3; /* * Edge can monitor the previous state of a condition and use this information to allow the customer to set a * trigger mode similar to an oscilloscope trigger. */ enum ConditionTriggerMode { /* * Condition will evaluate to true regardless of previous state */ TRIGGER_ALWAYS = 0; /* * Condition will evaluate to true only when it previously evaluated to false */ TRIGGER_ONLY_ON_RISING_EDGE = 1; } /* * A triggering mode can be applied to the condition to take in account the previous state of the condition. */ ConditionTriggerMode condition_trigger_mode = 4; } /* * This message contains information of signals that are to be collected and sent to cloud, or are part of the condition * logic and require attribute information. */ message SignalInformation { /* * Unique identifier of a Signal. Maps directly to a signal defined in the decoder manifest. Signal can also be an * OBDII PID. */ uint32 signal_id = 1; /* * The size of the ring buffer that will contain the data points for this signal */ uint32 sample_buffer_size = 2; /* * Minimum time period in milliseconds that must elapse between collecting samples. Samples arriving faster than * this period will be dropped. A value of 0 will collect samples as fast as they arrive. */ uint32 minimum_sample_period_ms = 3; /* * The size of a fixed window in milliseconds which will be used by aggregate condition functions to calculate * min/max/avg etc. */ uint32 fixed_window_period_ms = 4; /* * When true, this signal will not be collected and sent to cloud. It will only be used in the condition logic with * its associated fixed_window_period_ms. Default is false. */ bool condition_only_signal = 5; } /* * A node of the condition Abstract Syntax Tree */ message ConditionNode { /* * Each Abstract Syntax Tree node can be one of the following types */ oneof node { /* * An operator node can perform an operation or comparisons on its child node(s) */ NodeOperator node_operator = 1; /* * Function node is a self-contained module that accomplish a specific task. */ NodeFunction node_function = 2; /* * A node containing a floating point constant which can be used as a child node to operator nodes. */ double node_double_value = 3; /* * A node containing a signal id, whose value will be evaluated every time that signal is received on the * vehicle network bus. */ uint32 node_signal_id = 4; /* * A node containing a boolean constant which can be used as a child node to an operator node. */ bool node_boolean_value = 5; } /* * Operator node types contain one or two children. If they are unary operator type nodes, only the left child will * be used */ message NodeOperator{ /* * Left child node */ ConditionNode left_child = 1; /* * Right child node */ ConditionNode right_child = 2; /* * Operator type used in this node */ Operator operator = 3; /* * Enum of an operator which can be an binary or unary operator */ enum Operator { /* * COMPARE operators return a bool and their children must return a double */ COMPARE_SMALLER = 0; COMPARE_BIGGER = 1; COMPARE_SMALLER_EQUAL = 2; COMPARE_BIGGER_EQUAL = 3; COMPARE_EQUAL = 4; COMPARE_NOT_EQUAL = 5; /* * LOGICAL operators return a bool and their children must return a bool */ LOGICAL_AND = 6; LOGICAL_OR = 7; LOGICAL_NOT = 8; // Unary operator that will only have a left child. /* * ARITHMETIC operators return a double and their children must return a double */ ARITHMETIC_PLUS = 9; ARITHMETIC_MINUS = 10; ARITHMETIC_MULTIPLY = 11; ARITHMETIC_DIVIDE = 12; } } /* * Function node is a self-contained module that accomplish a specific task. It takes inputs provided here and * output based on specific logic */ message NodeFunction{ /* * The function node could be one of the following function types. */ oneof functionType { /* * A Window function node will sample a signal for the duration specified by fixed_window_period_ms and then * run an aggregation function over the samples and evaluate to a double. */ WindowFunction window_function = 1; /* * Geohash function Node that evaluates whether Edge has changed Geohash. It returns true if the Geohash * has changed at given precision and otherwise return false */ GeohashFunction geohash_function = 2; } /* * Geohash function evaluates whether Edge has changed Geohash at given precision * It will firstly calculate Geohash with latitude and longitude * It returns true if the Geohash has changed at given precision. Otherwise return false */ message GeohashFunction{ /* * signal id for latitude */ uint32 latitude_signal_id = 1; /* * signal id for longitude */ uint32 longitude_signal_id = 2; /* * The geohash precision for dynamic data collection Note geohash precision is defined as the length of hash * characters (base 32 encoding). Longer hash will have higher precision than shorter hash. * see more details: https://en.wikipedia.org/wiki/Geohash */ uint32 geohash_precision = 3; /* * The unit for decoded latitude / longitude signal. GPS Signal might be decoded into different unit * according to the DBC file. */ GPSUnitType gps_unit = 4; /* * The unit type for decoded latitude / longitude signal. This list might be extended in future to * accommodate different vehicle models. */ enum GPSUnitType { DECIMAL_DEGREE = 0; MICROARCSECOND = 1; MILLIARCSECOND = 2; ARCSECOND = 3; } } /* * Function node that will evaluate a function on a signal_id within a fixed window */ message WindowFunction{ /* * signal id of value to run a function on. The fixed_window_period_ms associated in signalInformation will * be used. */ uint32 signal_id = 1; /* * Function used over fixed window to evaluate value of physical value of signal_id */ WindowType window_type = 2; /* * Function to be used to aggregate data in a fixed window */ enum WindowType { /* * LAST_WINDOW is the most recently evaluated fixed window */ LAST_WINDOW_MIN = 0; LAST_WINDOW_MAX = 1; LAST_WINDOW_AVG = 2; /* * PREV_LAST_WINDOW is the fixed window previous to LAST_WINDOW */ PREV_LAST_WINDOW_MIN = 3; PREV_LAST_WINDOW_MAX = 4; PREV_LAST_WINDOW_AVG = 5; } } } } /* * A raw CAN frame specified to be collected and sent to the cloud. */ message RawCanFrame { /* * The interface ID specified by the Decoder Manifest. This will contain the physical channel id of the hardware CAN * Bus the frame is present on. */ string can_interface_id = 1; /* * CAN Message ID to collect. This Raw CAN message will be collected. Whatever number of bytes present on the bus * for this message ID will be collected. */ uint32 can_message_id = 2; /* * Ring buffer size used to store these sampled CAN frames. One CAN Frame is a sample. */ uint32 sample_buffer_size = 3; /* * Minimum time period in milliseconds that must elapse between collecting samples. Samples arriving faster than * this period will be dropped. A value of 0 will collect samples as fast as they arrive. */ uint32 minimum_sample_period_ms = 4; } message ImageData{ /* * Image Source Node ID which contain network interface information needed to access the image source. * */ uint32 image_source_node_id = 1; /* * Each image source may have a list of supported image types. */ ImageType image_type = 2; /* * Images may be collected in different ways, such as time based windows and frame based requests */ oneof image_collection_method { /* * A time based window of before and after time relative to an event trigger. */ TimeBasedImageData time_based_image_data = 3; } /* * Image data to be collected within a specified time range centered at the event trigger time of the collectionScheme. Note * that the number of frames collected in this time range will be dependant on the Frames Per Second rate support by * the Camera ECU. */ message TimeBasedImageData { /* * The duration in milliseconds of image data to collect before the event is triggered. For after duration, * after_duration_ms of the collectionScheme is used. */ uint32 before_duration_ms = 1; } /* * Image sources may have one or more supported image types - this field lets the customer specify which image type * they would like to collect. */ enum ImageType { COMPRESSED_JPG = 0; COMPRESSED_PNG = 1; // Reserve 2-99 for compressed formats RAW_RGB8 = 100; RAW_RGBA8 = 101; RAW_RGB16 = 102; RAW_RGBA16 = 103; RAW_BGR8 = 104; RAW_BGRA8 = 105; RAW_BGR16 = 106; RAW_BGRA16 = 107; RAW_MONO8= 108; RAW_MONO16= 109; } }