Commit b7f970e3 authored by mogos's avatar mogos
Browse files

switched to MSD v1

parent da7b45e2
Loading
Loading
Loading
Loading
+249 −79
Original line number Diff line number Diff line
MSDASN1Module DEFINITIONS AUTOMATIC TAGS ::=
BEGIN

-- Productions

CurrentVersion ::= INTEGER (2)

-- Version of this ASN.1 MSD specification
CurrentId::= INTEGER (1)
-- ECallMessage is the top level information element
-- The ECallMessage structure supports only one message type (msd)
-- Extendibility at this level is not allowed, thus ensuring that the
-- ID (message format version) can be extracted directly.
-- Elements:
-- id: MSD format version set to 1 to discriminate from later
-- MSD formats (CurrentId can be used).
-- Later versions to be backwards compatible with existing
-- versions.
-- Systems receiving an MSD shall support all standardised MSD
-- versions, which are each uniquely identified using
-- an MSD format version parameter which shall always be
-- contained in the first byte of all[current and future]
-- MSD versions.
-- msd: Minimum Set Of Data uplink from vehicle,
-- excluding ID
ECallMessage ::= SEQUENCE {
id INTEGER(0 .. 255),
msd MSDMessage
}
-- The main uplink msd message from the vehicle (excluding ID)
-- Elements:
-- msdStructure: The main MSD structure
-- optionalAdditionalData: Additional data
-- Extendable in future versions at this level e.g. to add extra data
MSDMessage ::= SEQUENCE {
msdStructure MSDStructure,
optionalAdditionalData AdditionalData OPTIONAL,
...
}
-- The main MSD structure, excluding additional data
-- Elements:
-- messageIdentifier: Message identifier, starting with 1 for each
-- new eCall session and to be incremented with
-- every application layer MSD retransmission
-- following a new ‘Send MSD’ request after the
-- incident event
-- control: see ControlType
-- vehicleIdentificationNumber: see VIN
-- vehiclePropulsionStorageType: see VehiclePropulsionStorageType
-- timestamp: Timestamp of incident event
-- As seconds elapsed since midnight January 1st, 1970 UTC.
-- Failure value for time stamp set to “0”
-- vehicleLocation: see VehicleLocation
-- vehicleDirection: Direction of travel
-- in 2°-degrees steps from magnetic north
-- (0– 358, clockwise)
-- If direction of travel is invalid or unknown,
-- the value 0xFF shall be used
-- Only values from 0 to 179 are valid.
-- recentVehicleLocationN1: location delta with respect to
-- vehicleLocation
-- see VehicleLocationDelta
-- recentVehicleLocationN2: location deltat with respect to
-- recentVehicleLocationN1
-- see VehicleLocationDelta
-- numberOfPassengers: Minimum known number of fastened seatbelts,
-- may be set to 0xFF or the optional parameter
-- omitted if no information is available
-- NOTE: This information is indicative only as
-- it may be not always be reliable in providing
-- exact information about the number
-- of passengers (e.g. because seatbelts may not
-- be fastened by passengers or seatbelts may be
-- fastened for other reasons)
MSDStructure ::= SEQUENCE {
messageIdentifier INTEGER(0 .. 255),
control ControlType,
vehicleIdentificationNumber VIN,
vehiclePropulsionStorageType VehiclePropulsionStorageType,
timestamp INTEGER(0 .. 4294967295),
vehicleLocation VehicleLocation,
vehicleDirection INTEGER(0 .. 255),
recentVehicleLocationN1 VehicleLocationDelta OPTIONAL,
recentVehicleLocationN2 VehicleLocationDelta OPTIONAL,
numberOfPassengers INTEGER(0 .. 255) OPTIONAL,
...
}
-- The ControlType is a collection of the following elements:
-- Elements:
-- automaticActivation: true = Automatic activation,
-- false = Manual activation
-- testCall: true = Test call, false = Emergency
-- positionCanBeTrusted: true = Position can be trusted,
-- false = low confidence in position
-- NOTE: The position confidence bit is to be
-- set to “Low confidence in position”
-- if the position is not within the limits
-- of +-150m with 95% confidence
-- vehicleType: see VehicleType
ControlType ::= SEQUENCE {
automaticActivation BOOLEAN,
testCall BOOLEAN,
positionCanBeTrusted BOOLEAN,
vehicleType VehicleType
}
-- Definiton of the vehicle type reporting the incident.
-- NOTE: Vehicle definitions class M, N according directive 2007/46/EC;
-- class L according directive 2002/24/EC
-- Extendable in future versions for new vehicle types
VehicleType ::= ENUMERATED{
passengerVehicleClassM1 (1),
busesAndCoachesClassM2 (2),
@@ -18,77 +115,150 @@ VehicleType ::= ENUMERATED {
motorcyclesClassL4e (10),
motorcyclesClassL5e (11),
motorcyclesClassL6e (12),
   motorcyclesClassL7e(13)
   , ...
}

ControlType ::= SEQUENCE {
   automaticActivation [0] BOOLEAN,
   testCall [1] BOOLEAN,
   positionCanBeTrusted [2] BOOLEAN,
   vehicleType [3] VehicleType
motorcyclesClassL7e (13),
...
}

-- VIN (vehicle identification number) according ISO 3779
-- isowmi: World Manufacturer Index (WMI)
-- isovds: Vehicle Type Descriptor (VDS)
-- Vehicle Identifier Section (VIS) consisting of
-- isovisModelyear: Modelyear from Vehicle Identifier Section (VIS)
-- isovisSeqPlant: Plant code + sequential number
-- from Vehicle Identifier Section (VIS)
VIN ::= SEQUENCE {
   isowmi [0] PrintableString (SIZE (3))
isowmi PrintableString (SIZE(3))
(FROM("A".."H"|"J".."N"|"P"|"R".."Z"|"0".."9")),
   isovds [1] PrintableString (SIZE (6))
isovds PrintableString (SIZE(6))
(FROM("A".."H"|"J".."N"|"P"|"R".."Z"|"0".."9")),
   isovisModelyear [2] PrintableString (SIZE (1))
isovisModelyear PrintableString (SIZE(1))
(FROM("A".."H"|"J".."N"|"P"|"R".."Z"|"0".."9")),
   isovisSeqPlant [3] PrintableString (SIZE (7))
isovisSeqPlant PrintableString (SIZE(7))
(FROM("A".."H"|"J".."N"|"P"|"R".."Z"|"0".."9"))
}

-- VehiclePropulsionStorageType:
-- These parameters identify the type of
-- vehicle energy storage(s) present.
-- For each storage type the following coding applies:
-- false = indicates a type of storage not present
-- true = indicates type of storage which is present
-- The following storage types are supported:
-- Gasoline tank
-- Diesel tank
-- Compressed natural gas (CNG)
-- Liquid propane gas (LPG)
-- Electric energy storage (with more than 42v and 100Ah)
-- Hydrogen storage
-- All bits shall be set to zero to indicate an unknown
-- or other type of energy storage.
-- NOTE: This information may be unreliable if there has been a
-- change of vehicle propulsion type (e.g. from gasoline to CNG)
-- NOTE: More than one bit may be set if there is more than one
-- type of energy storage present.
-- Extendible in future versions for new fuel storage types
VehiclePropulsionStorageType ::= SEQUENCE {
   gasolineTankPresent [0] BOOLEAN DEFAULT FALSE,
   dieselTankPresent [1] BOOLEAN DEFAULT FALSE,
   compressedNaturalGas [2] BOOLEAN DEFAULT FALSE,
   liquidPropaneGas [3] BOOLEAN DEFAULT FALSE,
   electricEnergyStorage [4] BOOLEAN DEFAULT FALSE,
   hydrogenStorage [5] BOOLEAN DEFAULT FALSE,
   otherStorage [6] BOOLEAN DEFAULT FALSE,
gasolineTankPresent BOOLEAN DEFAULT FALSE,
dieselTankPresent BOOLEAN DEFAULT FALSE,
compressedNaturalGas BOOLEAN DEFAULT FALSE,
liquidPropaneGas BOOLEAN DEFAULT FALSE,
electricEnergyStorage BOOLEAN DEFAULT FALSE,
hydrogenStorage BOOLEAN DEFAULT FALSE,
...
}

-- VehicleLocation:
-- The current location of the vehicle
-- Elements:
-- Position latitude (ISO 6709)
-- 32 bits (4 octets) allocated to make signed value handling easier
-- Real latitude values in 1 milli-arc-second units
-- Valid value range (-324000000 to 324000000)
-- Maximum value Latitude = 90°00'00.000''
-- = 90*60*60.000'' = 324000.000''
-- = 324 000 000 Miliarcseconds
-- = 0x134FD900
-- Minimum value Latitude = -90°00'00.000''
-- = -90*60*60.000'' = -324000.000''
-- = -324 000 000 Miliarcseconds
-- = 0xECB02700
-- EXAMPLE 48°18'1.20" N = 48.3003333 lat
-- = (48*3600)+(18*60)+1.20}’’ = 173881,200’’
-- which encodes to the following value:
-- = 173881200d = 0x0A5D3770
-- If latitude is invalid or unknown, the
-- value 0x7FFFFFFF = 2147483647 shall be transmitted
-- Position longitude (ISO 6709)
-- 32 bits (4 octets) allocated to make signed value handling easier
-- Real longitude values in 1 milli-arc-second units
-- Valid value range (-648000000 to 648000000)
-- Maximum value Longitude = 180°00'00.000''
-- = 180*60*60.000'' = 648000.000''
-- = 648 000 000 Miliarcseconds
-- = 0x269FB200
-- Minimum value Longitude = -180°00'00.000''
-- = -180*60*60.000'' = -648000.000''
-- = -648 000 000 Miliarcseconds
-- = 0xD9604E00
-- EXAMPLE 11°37'2.52" E = 11.6173666 long
-- = (11*3600)+(37*60)+2.52}’’ = 41822.520’’
-- which encodes to the following value:
-- = 41822520d = 0x027E2938
-- If longitude is invalid or unknown, the
-- value 0x7FFFFFFF = 2147483647 shall be used
VehicleLocation ::= SEQUENCE {
   positionLatitude [0] INTEGER (-2147483648..2147483647),
   positionLongitude [1] INTEGER (-2147483648..2147483647)
positionLatitude INTEGER(-2147483648..2147483647),
positionLongitude INTEGER(-2147483648..2147483647)
}

-- VehicleLocationDelta:
-- Description of a recent vehicle locatation before the incident
-- Latitude Delta (+ for North and – for South)
-- 1 Unit = 100 miliarcseconds, which is approximately 3m
-- Coded value range (-512..511)
-- representing -51200 to +51100 miliarcseconds,
-- or from 51,2’’S to 51,1’’N from the reference position
-- Longitude Delta (+ for East and – for West)
-- 1 Unit = 100 miliarcseconds, which is approximately 3m
-- Coded value range (-512..511)
-- representing -51200 to +51100 miliarcseconds,
-- or from 51,2’’W to 51,1’’E from the reference position
VehicleLocationDelta ::= SEQUENCE {
   latitudeDelta [0] INTEGER (-512..511),
   longitudeDelta [1] INTEGER (-512..511)
}

MSDStructure ::= SEQUENCE {
   messageIdentifier [0] INTEGER (0..255),
   control [1] ControlType,
   vehicleIdentificationNumber [2] VIN,
   vehiclePropulsionStorageType [3] VehiclePropulsionStorageType,
   timestamp [4] INTEGER (0..4294967295),
   vehicleLocation [5] VehicleLocation,
   vehicleDirection [6] INTEGER (0..255),
   recentVehicleLocationN1 [7] VehicleLocationDelta OPTIONAL,
   recentVehicleLocationN2 [8] VehicleLocationDelta OPTIONAL,
   numberOfPassengers [9] INTEGER (0..255) OPTIONAL,
   ...
latitudeDelta INTEGER (-512..511),
longitudeDelta INTEGER (-512..511)
}

-- AdditionalData:
-- Further additional bytes of data encoded as in a
-- seperate ASN.1 definition
-- NOTE: The framework format of this field is defined here,
-- which includes a method to uniquely identify the exact
-- format of the data.
-- Elements:
-- oid: Object identifier which uniquely identifies the format
-- and meaning of the data which follows.
-- The uniqueness of each specific relative identifier
-- must be ensured by a specific international
-- standardisations body.
-- These identifiers are all relative to a specific root
-- which must be agreed in advance.
-- The root of all eCall relative oid's must be the same.
-- Note that not only the syntax of the data structure should
-- be referenced via this identifier but also the symantic
-- meaning of the content so that it can be usefully applied.
-- data:Transparent optional additional data,
-- according to the format referenced by the oid
-- The user must ensure that the size of this element
-- is restricted to ensure that the total ECallMessage is
-- small enough for the relevant transmission medium.
AdditionalData ::= SEQUENCE {
   oid [0] RELATIVE-OID,
   data [1] OCTET STRING
}

MSDMessage ::= SEQUENCE {
   msdStructure [0] MSDStructure,
   optionalAdditionalData [1] AdditionalData OPTIONAL,
   ...
}

ECallMessage ::= SEQUENCE {
   msdVersion [0] INTEGER (0..255),
   msd [1] OCTET STRING (CONTAINING MSDMessage)
oid RELATIVE-OID,
data OCTET STRING
}

-- Several of the elements above are "extendable"
-- according to the ASN.1 standard to facilitate future extensions
-- whilst also maintaining backwards compatibility.
-- Tip for using the extendability marker in later versions:
-- For the extended version put a "," behind the "..."
-- and add new elements ensuring that there is no ","
-- at the end of the list
-- Example: numberOfPassengers,
-- ...,
-- newMsdParameter1 TYPE1,
-- newMsdParameter2 TYPE2
END
 No newline at end of file
+15 −29
Original line number Diff line number Diff line
@@ -91,12 +91,10 @@ module LibItsECall_Functions {
     * @desc    Wait for reception of an eCall message and validate it
     */
    function f_verifyMSD() runs on PsapMtc {
        template ECallMessageUnion mw_anyDecodedECallMessage := {decoded := ?};
        var ExpectResult v_result;
        var ModemEvent v_modemEvent;
        var ECallMessage v_eCallMessage;
        var MSDMessage v_receivedMSDMessage;
        var integer v_decoded;
        var bitstring v_encoded;

        template MSDMessage mw_msdMessage := f_generateMSDTemplate();

@@ -104,7 +102,7 @@ module LibItsECall_Functions {
        // Wait for InbandMsdReceivedEvent event
        //
        
        v_result := f_expectFeedback(mw_inbandMsdReceived(PX_MODEM_INSTANCE, ?, mw_anyECallMessage));
        v_result := f_expectFeedback(mw_inbandMsdReceived(PX_MODEM_INSTANCE, ?, mw_anyDecodedECallMessage));
        
        //
        // Extract the ECallMessage from the event
@@ -114,7 +112,7 @@ module LibItsECall_Functions {
            v_modemEvent := v_result.modemEvent;
            
            if (ischosen(v_modemEvent.inbandMsdReceived)) {
                v_eCallMessage := v_modemEvent.inbandMsdReceived.eCallMessage;
                v_eCallMessage := v_modemEvent.inbandMsdReceived.eCallMessage.decoded;
            }
            else {
                f_stopIvsTestcase(fail, "MSD not received");
@@ -128,7 +126,7 @@ module LibItsECall_Functions {
        // Check MSD version
        //
        
        if (v_eCallMessage.msdVersion != c_msdVersion) {
        if (v_eCallMessage.id != c_msdVersion) {
            f_stopIvsTestcase(fail, "Incorrect MSD version, expected " & int2str(c_msdVersion));
        }
        
@@ -136,13 +134,7 @@ module LibItsECall_Functions {
        // Check MSD message contents
        //

        v_encoded := oct2bit(v_eCallMessage.msd);
        v_decoded := decvalue(v_encoded, v_receivedMSDMessage);
        if (v_decoded != 0) {
            f_stopIvsTestcase(fail, "MSD message could not be decoded");
        }

        if (not match(v_receivedMSDMessage, mw_msdMessage)) {
        if (not match(v_eCallMessage.msd, mw_msdMessage)) {
            f_stopIvsTestcase(fail, "MSD message content is incorrect");
        }
        
@@ -151,13 +143,13 @@ module LibItsECall_Functions {
        //
        
        if (not PX_IGNORE_MSD_POSITION) {
            var Int32 v_actualLat  := v_receivedMSDMessage.msdStructure.vehicleLocation.positionLatitude;
            var Int32 v_actualLong := v_receivedMSDMessage.msdStructure.vehicleLocation.positionLongitude;
            var Int32 v_actualLat  := v_eCallMessage.msd.msdStructure.vehicleLocation.positionLatitude;
            var Int32 v_actualLong := v_eCallMessage.msd.msdStructure.vehicleLocation.positionLongitude;
            
            var Int32 v_latLower, v_latUpper;
            var Int32 v_longLower, v_longUpper;
            
            if (not v_receivedMSDMessage.msdStructure.control_.positionCanBeTrusted) {
            if (not v_eCallMessage.msd.msdStructure.control_.positionCanBeTrusted) {
                f_stopIvsTestcase(fail, "MSD possition cannot be trusted");
            }
            
@@ -332,18 +324,12 @@ module LibItsECall_Functions {
     * @param p_version MSD version
     * @param p_msdMessage MSD content
     */
    function f_buildECallMessage(in integer p_version, in MSDMessage p_msdMessage) return ECallMessage {
    function f_buildECallMessage(in UInt8 p_version, in MSDMessage p_msdMessage) return ECallMessage {
        var ECallMessage v_eCallMessage;
        
        var bitstring v_encodedMSDMessage := encvalue(p_msdMessage);
        
        if (lengthof(v_encodedMSDMessage) mod 8 != 0) {
            v_encodedMSDMessage := v_encodedMSDMessage & int2bit(0, 8 - (lengthof(v_encodedMSDMessage) mod 8));
        }
        
        v_eCallMessage := {
            msdVersion := p_version,
            msd := bit2oct(v_encodedMSDMessage)
            id := p_version,
            msd := p_msdMessage
        };
        
        return v_eCallMessage;
@@ -353,7 +339,7 @@ module LibItsECall_Functions {
     * @desc Construct a MSDMessage
     * @param p_messageIdentifier message identifier to use
     */
    function f_buildMSDMessage(in integer p_messageIdentifier) return MSDMessage {
    function f_buildMSDMessage(in UInt8 p_messageIdentifier) return MSDMessage {
        var MSDMessage v_msd := {
            msdStructure := {
                messageIdentifier := p_messageIdentifier,
@@ -1008,10 +994,10 @@ module LibItsECall_Functions {
         * @desc  Set the eCall message to be sent by simulated IVS
         * @param p_messageIdentifier   messageIdentifier of the next msd
         */
        function f_setMSD(in integer p_messageIdentifier) runs on IvsMtc  {
        function f_setMSD(in UInt8 p_messageIdentifier) runs on IvsMtc  {
            var MSDMessage v_msd := f_buildMSDMessage(p_messageIdentifier);
            var ECallMessage v_eCallMessage := f_buildECallMessage(c_msdVersion, v_msd);
            var ModemConfiguration v_newConfig := {eCallMessage := v_eCallMessage} with {optional "implicit omit";};
            var ModemConfiguration v_newConfig := {eCallMessage := { decoded := v_eCallMessage } } with {optional "implicit omit";};

            adapterControl.send(m_setConfig(PX_MODEM_INSTANCES[0].id, v_newConfig));
        }
@@ -1183,7 +1169,7 @@ module LibItsECall_Functions {
            var ModemConfiguration v_psapConfig := {mode := PSAP} with {optional "implicit omit";};
            
            // Final configuration
            p_configuration.eCallMessage := v_eCallMessage;
            p_configuration.eCallMessage := {decoded := v_eCallMessage};

            adapterControl.send(m_setConfig(PX_MODEM_INSTANCES[0].id, v_psapConfig));
            f_adapterExpectPsap(p_e := mw_ivsConfigChanged(p_modemInstanceConf.id, ?, ?), p_ignoreOtherMessages := true);
+3 −5
Original line number Diff line number Diff line
@@ -84,8 +84,7 @@ module LibItsECall_Pixits {
        compressedNaturalGas := false,
        liquidPropaneGas := false,
        electricEnergyStorage := false,
        hydrogenStorage := false,
        otherStorage := false
        hydrogenStorage := false
    }

    /**
@@ -133,9 +132,8 @@ module LibItsECall_Pixits {
    /**
     * @desc Malformed eCall message
     */
    modulepar ECallMessage PX_BAD_ECALL_MESSAGE := {
        msdVersion := c_msdVersion,
        msd := '0123456789'O
    modulepar ECallMessageUnion PX_BAD_ECALL_MESSAGE := {
        encoded := '0123456789'O
    }
    
    group ivs {
+1 −9
Original line number Diff line number Diff line
@@ -22,14 +22,6 @@ module LibItsECall_Templates {
        encode "MSDEncode";
    };

    /**
     * @desc Receive template for any eCall message
     */
    template ECallMessage mw_anyECallMessage := {
        msdVersion := ?,
        msd := ?
    }
    
    group configurationTemplates {
        
        /**
@@ -129,7 +121,7 @@ module LibItsECall_Templates {
        template ModemEvent mw_inbandMsdReceived (
            template(present) integer p_modemInstance,
            template(present) charstring p_time := ?,
            template(present) ECallMessage p_eCallMessage := ?
            template(present) ECallMessageUnion p_eCallMessage := ?
        ) := {
            inbandMsdReceived := {
                modemInstance := p_modemInstance,
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ module LibItsECall_TestSystem {
            /**
             * @desc value of the next expected MSD messageIdentifier
             */
            var integer vc_messageIdentifier := c_initialMessageIdentifier;
            var UInt8 vc_messageIdentifier := c_initialMessageIdentifier;
            
            /**
             * @desc kind of the next expected eCall
Loading