SafeDispatch/ServiceGatewaySDR/IRRPI_DEFS.cs

433 lines
18 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SDRGatewayService
{
/*
* COPYRIGHT 2003 MOTOROLA, INC. ALL RIGHTS RESERVED.
* MOTOROLA CONFIDENTIAL PROPRIETARY
*/
/*
* irrpi.h
*/
/*
* This file is used internally by the files which support encoding and
* decoding of ARRP or LRRP messages to/from the lrrs_msg_t format.
*/
/*
* MBXML Testing Document Identifiers.
*/
public static class MOTO
{
public const byte DOCID_T_RES_CONS_TBL = 0x02;
public const byte DOCID_T_RES = 0x03
/*
* MBXML Version 1 Document Identifiers (LRRP).
*/
;
public const byte DOCID_L_V1_IMM_LOC_REQ_CONS_TBL = 0x04;
public const byte DOCID_L_V1_IMM_LOC_REQ = 0x05;
public const byte DOCID_L_V1_IMM_LOC_REP_CONS_TBL = 0x06;
public const byte DOCID_L_V1_IMM_LOC_REP = 0x07;
public const byte DOCID_L_V1_TRI_LOC_REQ_CONS_TBL = 0x08;
public const byte DOCID_L_V1_TRI_LOC_REQ = 0x09;
public const byte DOCID_L_V1_TRI_LOC_ANS_CONS_TBL = 0x0A;
public const byte DOCID_L_V1_TRI_LOC_ANS = 0x0B;
public const byte DOCID_L_V1_TRI_LOC_REP_CONS_TBL = 0x0C;
public const byte DOCID_L_V1_TRI_LOC_REP = 0x0D;
public const byte DOCID_L_V1_TRI_STP_REQ_CONS_TBL = 0x0E;
public const byte DOCID_L_V1_TRI_STP_REQ = 0x0F;
public const byte DOCID_L_V1_TRI_STP_ANS_CONS_TBL = 0x10;
public const byte DOCID_L_V1_TRI_STP_ANS = 0x11;
public const byte DOCID_L_V1_UNS_LOC_REP_CONS_TBL = 0x12;
public const byte DOCID_L_V1_UNS_LOC_REP = 0x13;
public const byte DOCID_L_PROT_VER_REQ = 0x14;
public const byte DOCID_L_PROT_VER_REP = 0x15;
/*
* MBXML Version 1 Document Identifiers (ARRP).
*/
public const byte DOCID_A_V1_IMM_LOC_REQ_CONS_TBL = 0x16;
public const byte DOCID_A_V1_IMM_LOC_REQ = 0x17;
public const byte DOCID_A_V1_IMM_LOC_REP_CONS_TBL = 0x18;
public const byte DOCID_A_V1_IMM_LOC_REP = 0x19;
public const byte DOCID_A_V1_TRI_LOC_REQ_CONS_TBL = 0x1A;
public const byte DOCID_A_V1_TRI_LOC_REQ = 0x1B;
public const byte DOCID_A_V1_TRI_LOC_ANS_CONS_TBL = 0x1C;
public const byte DOCID_A_V1_TRI_LOC_ANS = 0x1D;
public const byte DOCID_A_V1_TRI_LOC_REP_CONS_TBL = 0x1E;
public const byte DOCID_A_V1_TRI_LOC_REP = 0x1F;
public const byte DOCID_A_V1_TRI_STP_REQ_CONS_TBL = 0x20;
public const byte DOCID_A_V1_TRI_STP_REQ = 0x21;
public const byte DOCID_A_V1_TRI_STP_ANS_CONS_TBL = 0x22;
public const byte DOCID_A_V1_TRI_STP_ANS = 0x23;
public const byte DOCID_A_V1_UNS_LOC_REP_CONS_TBL = 0x24;
public const byte DOCID_A_V1_UNS_LOC_REP = 0x25;
public const byte DOCID_A_PROT_VER_REQ = 0x26;
public const byte DOCID_A_PROT_VER_REP = 0x27
/*
* Common Element Tokens (ARRP & LRRP).
*/
;
public const byte TKNICE_APP = 0x20;
public const byte TKNICE_APP_ID = 0x21;
public const byte TKNICE_REQID_OI = 0x22;
public const byte TKNICE_REQID_OI_1 = 0x23;
public const byte TKNICE_REQID_OT = 0x24;
public const byte TKNICE_SU_PLMN_OI = 0x25;
public const byte TKNICE_SU_IPV4_OI_4 = 0x26;
public const byte TKNICE_SU_IPV6_OI_16 = 0x27;
public const byte TKNICE_SU_USPEC_OI = 0x28;
public const byte TKNICE_SU_TETRA_OI_6 = 0x29;
public const byte TKNICE_SU_APCO_OI_7 = 0x2A;
/*
* Common Element Tokens (ARRP).
*/
public const byte TKNICE_UNIT_ID = 0x2F;
/*
* Query Request Element Tokens (ARRP & LRRP).
*/
public const byte TKNIQ_IMPL_SPEC_TDATA_OI = 0x30;
public const byte TKNIQ_IMPL_SPEC_TDATA_OT = 0x80;
public const byte TKNIQ_INTERVAL_UI = 0x31;
public const byte TKNIQ_INTERVAL_UF = 0x32;
public const byte TKNIQ_ONESHOT_TRIGGER = 0x33;
public const byte TKNIQ_PERIODIC_TRIGGER = 0x34;
public const byte TKNIQ_RECADDR_8ST = 0x35;
public const byte TKNIQ_RECADDR_8I = 0x36;
public const byte TKNIQ_RECADDR_7I = 0x37;
public const byte TKNIQ_REQUEST_IMPL_SPEC_DATA_OI = 0x38;
public const byte TKNIQ_REQUEST_IMPL_SPEC_DATA_OT = 0x39;
public const byte TKNIQ_REQUEST_MAX_INFO_AGE_UI = 0x3A;
public const byte TKNIQ_REQUEST_MAX_INFO_AGE_UF = 0x3B;
public const byte TKNIQ_REQUEST_MAX_RESP_TM_UI = 0x3C;
public const byte TKNIQ_REQUEST_MAX_RESP_TM_UF = 0x3D;
public const byte TKNIQ_REQUEST_PRIO = 0x3E;
public const byte TKNIQ_REQUEST_PROT_VERS = 0x3F;
public const byte TKNIQ_REQUIRE_IMPL_SPEC_DATA_OI = 0x40;
public const byte TKNIQ_REQUIRE_IMPL_SPEC_DATA_OT = 0x41;
public const byte TKNIQ_REQUIRE_MAX_INFO_AGE_UI = 0x42;
public const byte TKNIQ_REQUIRE_MAX_INFO_AGE_UF = 0x43;
public const byte TKNIQ_REQUIRE_MAX_RESP_TM_UI = 0x44;
public const byte TKNIQ_REQUIRE_MAX_RESP_TM_UF = 0x45;
public const byte TKNIQ_START_TM_OI_5 = 0x46;
public const byte TKNIQ_START_TM_OT = 0x47;
public const byte TKNIQ_STOP_TM_OI_5 = 0x48;
public const byte TKNIQ_STOP_TM_OT = 0x49;
public const byte TKNIQ_TRG_COND_UI = 0x4A;
/*
* Query Request Element Tokens (LRRP).
*/
public const byte TKNLQ_REQUEST_ALT = 0x54;
public const byte TKNLQ_REQUEST_ALT_ACC_UI = 0x55;
public const byte TKNLQ_REQUEST_ALT_ACC_UF = 0x56;
public const byte TKNLQ_REQUEST_DIR_HOR = 0x57;
public const byte TKNLQ_REQUEST_DIR_HOR_ACC_U8 = 0x58;
public const byte TKNLQ_REQUEST_DIR_HOR_ACC_UF = 0x90;
public const byte TKNLQ_REQUEST_HEAD_HOR = 0x5B;
public const byte TKNLQ_REQUEST_HEAD_HOR_ACC_U8 = 0x5C;
public const byte TKNLQ_REQUEST_HEAD_HOR_ACC_UF = 0x92;
public const byte TKNLQ_REQUEST_HOR_ACC_UI = 0x5F;
public const byte TKNLQ_REQUEST_HOR_ACC_UF = 0x60;
public const byte TKNLQ_REQUEST_LEV_CONF_U8 = 0x61;
public const byte TKNLQ_REQUEST_LEV_CONF_UF = 0x94;
public const byte TKNLQ_REQUEST_SPEED_HOR = 0x62;
public const byte TKNLQ_REQUEST_SPEED_HOR_ACC_UI = 0x63;
public const byte TKNLQ_REQUEST_SPEED_HOR_ACC_UF = 0x95;
public const byte TKNLQ_REQUEST_SPEED_VRT = 0x64;
public const byte TKNLQ_REQUEST_SPEED_VRT_ACC_UI = 0x65;
public const byte TKNLQ_REQUEST_SPEED_VRT_ACC_UF = 0x96;
public const byte TKNLQ_REQUIRE_ALT = 0x66;
public const byte TKNLQ_REQUIRE_ALT_ACC_UI = 0x67;
public const byte TKNLQ_REQUIRE_ALT_ACC_UF = 0x68;
public const byte TKNLQ_REQUIRE_DIR_HOR = 0x69;
public const byte TKNLQ_REQUIRE_DIR_HOR_ACC_U8 = 0x6A;
public const byte TKNLQ_REQUIRE_DIR_HOR_ACC_UF = 0x97;
public const byte TKNLQ_REQUIRE_HEAD_HOR = 0x6D;
public const byte TKNLQ_REQUIRE_HEAD_HOR_ACC_U8 = 0x6E;
public const byte TKNLQ_REQUIRE_HEAD_HOR_ACC_UF = 0x98;
public const byte TKNLQ_REQUIRE_HOR_ACC_UI = 0x71;
public const byte TKNLQ_REQUIRE_HOR_ACC_UF = 0x72;
public const byte TKNLQ_REQUIRE_LEV_CONF_U8 = 0x73;
public const byte TKNLQ_REQUIRE_LEV_CONF_UF = 0x9A;
public const byte TKNLQ_REQUIRE_SPEED_HOR = 0x74;
public const byte TKNLQ_REQUIRE_SPEED_HOR_ACC_UI = 0x75;
public const byte TKNLQ_REQUIRE_SPEED_HOR_ACC_UF = 0x9B;
public const byte TKNLQ_REQUIRE_SPEED_VRT = 0x76;
public const byte TKNLQ_REQUIRE_SPEED_VRT_ACC_UI = 0x77;
public const byte TKNLQ_REQUIRE_SPEED_VRT_ACC_UF = 0x9C;
public const byte TKNLQ_RETINFO_ACC_END = 0x50;
public const byte TKNLQ_RETINFO_ACC_TM_END = 0x51;
public const byte TKNLQ_RETINFO_TM_END = 0x52;
public const byte TKNLQ_RETINFO = 0x53;
public const byte TKNLQ_TRG_DIST_UI = 0x78;
public const byte TKNLQ_TRG_DIST_UF = 0x9D;
/*
* Answer and Report Element Tokens (ARRP & LRRP).
*/
public const byte TKNIR_CUR_TM_OI_5 = 0x30;
public const byte TKNIR_CUR_TM_OT = 0x31;
public const byte TKNIR_IMPL_SPEC_DATA_OI = 0x32;
public const byte TKNIR_IMPL_SPEC_DATA_OT = 0x33;
public const byte TKNIR_INFO_TM_OI_5 = 0x34;
public const byte TKNIR_INFO_TM_OT = 0x35;
public const byte TKNIR_PROT_VERS = 0x36;
public const byte TKNIR_RESULT_OI_0 = 0x37
;
public const byte TKNIR_RESULT_0_OI_0 = 0x38
;
public const byte TKNIR_RESULT_OI = 0x39
/*
* Answer and Report Element Tokens (LRRP).
*/
;
public const byte TKNLR_CIRCLE_2D_1 = 0x50
;
public const byte TKNLR_CIRCLE_2D_2 = 0x51
;
public const byte TKNLR_CIRCLE_3D_1 = 0x52
;
public const byte TKNLR_CIRCLE_3D_2 = 0x53
;
public const byte TKNLR_CIRCLE_3D_3 = 0x54
;
public const byte TKNLR_CIRCLE_3D_4 = 0x55
;
public const byte TKNLR_DIR_HOR_U8 = 0x56
;
public const byte TKNLR_DIR_HOR_UF = 0x90
;
public const byte TKNLR_DIR_HOR_ACC_U8 = 0x57
;
public const byte TKNLR_DIR_HOR_ACC_UF = 0x91
;
public const byte TKNLR_ELLIPSE_2D_1 = 0x5A
;
public const byte TKNLR_ELLIPSE_2D_2 = 0x5B
;
public const byte TKNLR_ELLIPSE_3D_1 = 0x5C
;
public const byte TKNLR_ELLIPSE_3D_2 = 0x5D
;
public const byte TKNLR_ELLIPSE_3D_3 = 0x5E
;
public const byte TKNLR_ELLIPSE_3D_4 = 0x5F
;
public const byte TKNLR_HEAD_HOR_U8 = 0x60
;
public const byte TKNLR_HEAD_HOR_UF = 0x94
;
public const byte TKNLR_HEAD_HOR_ACC_U8 = 0x95
;
public const byte TKNLR_IMPL_SPEC_SHAPE_OI = 0x64
;
public const byte TKNLR_IMPL_SPEC_SHAPE_OT = 0x98
;
public const byte TKNLR_LEV_CONF_U8 = 0x65
;
public const byte TKNLR_LEV_CONF_UF = 0x99
;
public const byte TKNLR_POINT_2D = 0x66
;
public const byte TKNLR_POINT_3D_1 = 0x67
;
public const byte TKNLR_POINT_3D_2 = 0x68
;
public const byte TKNLR_POINT_3D_3 = 0x69
;
public const byte TKNLR_POINT_3D_4 = 0x6A
;
public const byte TKNLR_SPEED_HOR_UI = 0x6B
;
public const byte TKNLR_SPEED_HOR_UF = 0x6C
;
public const byte TKNLR_SPEED_HOR_ACC_UI = 0x6D
;
public const byte TKNLR_SPEED_HOR_ACC_UF = 0x6F
;
public const byte TKNLR_SPEED_VRT_SF = 0x70
;
public const byte TKNLR_SPEED_VRT_ACC_UI = 0x71
;
public const byte TKNLR_SPEED_VRT_ACC_UF = 0x72
/*
* Attribute Tokens (ARRP & LRRP).
*/
;
public const byte TKNIA_APP_ID = 0x20
;
public const byte TKNIA_REQUEST_PRIO_TYPE = 0x21
;
public const byte TKNIA_RESULT_CODE_UI = 0x22
;
public const byte TKNIA_RESULT_CODE_UI_0 = 0x23
;
public const byte TKNIA_SU_APCO = 0x28
;
public const byte TKNIA_SU_IPV4 = 0x29
;
public const byte TKNIA_SU_IPV6 = 0x2A
;
public const byte TKNIA_SU_PLMN = 0x2B
;
public const byte TKNIA_SU_TETRA = 0x2C
;
public const byte TKNIA_SU_USPEC = 0x2D
/*
* Attribute Tokens (LRRP).
*/
;
public const byte TKNLA_RETINFO_ACC_END = 0x50
;
public const byte TKNLA_RETINFO_ACC = 0x51
;
public const byte TKNLA_RETINFO_NOREQID_END = 0x52
;
public const byte TKNLA_RETINFO_NOREQID = 0x53
;
public const byte TKNLA_RETINFO_TM_END = 0x54
;
public const byte TKNLA_RETINFO_TM = 0x55
/////////////////////////////////////////////////////////////////////////
// Result Codes and their Meaning
//
;
public const byte SUCCESS = 0x00 //No error occurred while processing the request.
//This result can only be returned by an Answer message.
;
public const byte SYSTEM_FAILURE = 0x01 //The Provider is unable to provide the required information because of a general problem in the server or the underlying network.
;
public const byte UNSPECIFIED_ERROR = 0x02 //The unspecified error is used in case none of the other errors applies.
//This result code can also be used in cases where privacy issues prevent certain errors from being presented.
;
public const byte UNAUTHERIZED_APPLICATION = 0x03 //The requesting application/user is not authorized to obtain the information for the specified SU.
;
public const byte UNKNOWN_SUBSCRIBER = 0x04 //Unknown SU.
;
public const byte ABSENT_SUBSCRIBER = 0x05 //The SU is currently not reachable.
;
public const byte CONGESTION_IN_PROVIDER = 0x06 //The Provider is unable to provide the required information because of congestion in the Provider or an entity invoked by the Provider.
;
public const byte CONGESTION_IN_MOBILE_NETWORK = 0x07 //The Provider is unable to provide the required information because of congestion in the mobile network.
;
public const byte INSUFFICIENT_RESOURCE = 0x09 //The Provider was unable to complete a request due to insufficient resources, e.g. lack of memory, the MBXML document was too complex, etc.
;
public const byte PROTOCOL_ELEMENT_NOT_SUPPORTED = 0x0B //The Provider does not support a protocol element or protocol element attribute specified in the request.
;
public const byte SERVICE_NOT_SUPPORTED = 0x0C //The Provider does not support the specified service, e.g. triggered request.
;
public const byte PROTOCOL_ELEMENT_VALUE_NOT_SUPPORTED = 0x0D //The Provider does not support a specific value of a protocol element, a specific value for a protocol element attribute, or a specific value of an implementation-specific parameter.
;
public const byte INFORMATION_NOT_CURRENTLY_AVAILABLE = 0x0E //A required type of information is temporarily unavailable, e.g. due to some temporary problem.
;
public const byte QUERY_INFO_NOT_ATTAINABLE = 0x0F //The Provider is unable to provide the required information specified in a query-info.
;
public const byte QUERY_INFO_NOT_CURRENTLY_ATTAINABLE = 0x10 //The Provider is temporarily unable to provide the required information specified in a query-info.
;
public const byte REPORTING_WILL_STOP = 0x11 //A triggered request has been cancelled, and further reports will not be produced.
;
public const byte TIME_EXPIRED = 0x12 //The start time or stop time of a triggered request has expired, or the required response timer specified in query-info has expired.
;
public const byte DISALLOWED_BY_LOCAL_REGULATIONS = 0x13 //The request is disallowed by local regulatory requirements.
;
public const byte NO_QUERY_INFO_FOR_ANY_REQUESTED_ITEM = 0x14 //No required information item was specified in query-info, at least one implementation-specific item as requested, and none of the implementation-specific requested items could be provided.
//In cases where only a single implementation-specific item was requested (and the information could not be provided), the Responder may use other error codes instead of this one to better specify the reason for not being able to provide the information (e.g., QUERY INFO NOT CURRENTLY ATTAINABLE).
;
public const byte NO_SUCH_REQUEST = 0x15 //No pending request identifiers match the request identifier specified for a Triggered-Location-Stop-Request message.
;
public const byte DUPLICATE_REQUEST_ID = 0x16 //A Query request message contains the same request identifier as in a previously received and uncompleted Query request message.
;
public const byte UNKOWN_UNIT = 0x17 //Unknown unit identifier.
;
public const byte POSITION_METHOD_FAILURE = 0x51 //Position method failure, resulting in the Provider not being able to obtain the position of the SU.
;
public const byte INSUFFICIENT_GPS_SATELLITES = 200 //Insufficient number of GPS satellites to determine a position.
;
public const byte BAD_GPS_GEOMETRY = 201 //Invalid GPS satellite geometry information.
//ERROR CODES 202- Implementation-specific error codes.
;
public const byte IRRS_TIME_MONTHS_PER_YEAR = 12;
public const byte IRRS_TIME_MIN_MONTH = 1;
public const byte IRRS_TIME_MAX_MONTH = 12;
public const byte IRRS_TIME_HOURS_PER_DAY = 24;
public const byte IRRS_TIME_MIN_HOUR = 0;
public const byte IRRS_TIME_MAX_HOUR = (IRRS_TIME_HOURS_PER_DAY - 1);
public const byte IRRS_TIME_MINUTES_PER_HOUR = 60;
public const byte IRRS_TIME_MIN_MINUTE = 0;
public const byte IRRS_TIME_MAX_MINUTE = (IRRS_TIME_MINUTES_PER_HOUR - 1);
public const byte IRRS_TIME_SECS_PER_MINUTE = 60;
public const byte IRRS_TIME_MIN_SECOND = 0;
public const byte IRRS_TIME_MAX_SECOND = (IRRS_TIME_SECS_PER_MINUTE - 1);
public const byte IRRS_RES_SUCCESS = 0x0;
public const byte IRRS_RES_SYNTAX_ERROR = 0xA;
public const byte LRRS_MAX_LAT_INT = 90;
public const byte LRRS_MAX_LON_INT = 180;
public const double LRRS_MAX_LAT_DBL = ((double)LRRS_MAX_LAT_INT);
public const double LRRS_MAX_LON_DBL = ((double)LRRS_MAX_LON_INT);
public const double LRRS_LAT_MULTIPLIER = ((double)(0x80000000 * 1.0) / LRRS_MAX_LAT_DBL);
public const double LRRS_LON_MULTIPLIER = ((double)(0x80000000 * 1.0) / LRRS_MAX_LON_DBL);
public const ulong LRRS_LAT_SIGN_MSK = 0x80000000;
public const byte LRRS_LL_MIN_IN_DEG_INT = 60;
public const double LRRS_LL_MIN_IN_DEG_DBL = ((double)LRRS_LL_MIN_IN_DEG_INT);
public const byte MAX_FRC_VARIANCE = 2;
public const double LAT_LON_DOUBLE_ROUNDING = ((double)0.00000004);
public struct irrs_con_time_t
{
public int year;
public int month;
public int day;
public int hour;
public int minute;
public int second;
}
public struct lrrs_con_pos_t
{
public int direction_lat;
public ulong degrees_lat;
public ulong minutes_lat;
public double fraction_lat;
public int direction_lng;
public ulong degrees_lng;
public ulong minutes_lng;
public double fraction_lng;
}
public class GPS_POS
{
public irrs_con_time_t time;
public lrrs_con_pos_t pos;
}
}
}