예제 #1
0
        protected override void InitializeProperties(object[] properties, int startIndex)
        {
            Length     = (uint)properties[0] + Package.NotDataLength;
            SN         = (uint)properties[1];
            BusinessID = (BusinessType)properties[2];
            JT809Config jt809Config = (JT809Config)properties[3];

            SessionId      = jt809Config.SessionId;
            JT809Version   = jt809Config.JT809Version;
            EncryptOpition = jt809Config.JT809EncryptConfig == null? EncryptOpitions.None: EncryptOpitions.Common;
            if (jt809Config.JT809EncryptConfig == null)
            {
                EncryptOpition = EncryptOpitions.None;
            }
            else
            {
                EncryptOpition = EncryptOpitions.Common;
                EncryptKey     = jt809Config.JT809EncryptConfig.Key;
            }
        }
예제 #2
0
 public Header(uint length, BusinessType businessID, JT809Config jt809Config) : this(length, CounterOnSendGenerater, businessID, jt809Config)
 {
 }
예제 #3
0
 public Package(Header header, MessageBody body, JT809Config jt809Config) : base(header, body)
 {
     JT809Config = jt809Config;
 }
예제 #4
0
 internal Header(uint length, uint number, BusinessType businessID, JT809Config jt809Config) : base(length, number, businessID, jt809Config)
 {
     CounterOnSendGenerater++;
 }
예제 #5
0
        public static Package GeneratePackage(BusinessType businessType, MessageBody messageBody, JT809Config jt809Config)
        {
            var header = new Header((uint)messageBody.Buffer.Length, businessType, jt809Config);

            return(new Package(header, messageBody, jt809Config));
        }