Ver a proveniência

Merge pull request #25 from joaomfariamartins/feature/cmd_8900_0900

Write PassthroughData directly instead of using JT808_0x8900/0900_BodyBase implementation
tags/v2.4.5
SmallChi(Koike) há 3 anos
committed by GitHub
ascendente
cometimento
a4ac6b99c9
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: 4AEE18F83AFDEB23
2 ficheiros alterados com 20 adições e 3 eliminações
  1. +10
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0900.cs
  2. +10
    -1
      src/JT808.Protocol/MessageBody/JT808_0x8900.cs

+ 10
- 2
src/JT808.Protocol/MessageBody/JT808_0x0900.cs Ver ficheiro

@@ -93,8 +93,16 @@ namespace JT808.Protocol.MessageBody
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0900 value, IJT808Config config)
{
writer.WriteByte(value.PassthroughType);
object obj = config.GetMessagePackFormatterByType(value.JT808_0x0900_BodyBase.GetType());
JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(obj, ref writer, value.JT808_0x0900_BodyBase, config);

if ( value.JT808_0x0900_BodyBase != null )
{
object obj = config.GetMessagePackFormatterByType( value.JT808_0x0900_BodyBase.GetType() );
JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize( obj, ref writer, value.JT808_0x0900_BodyBase, config );
}
else
{
writer.WriteArray( value.PassthroughData );
}
}
}
}

+ 10
- 1
src/JT808.Protocol/MessageBody/JT808_0x8900.cs Ver ficheiro

@@ -63,7 +63,16 @@ namespace JT808.Protocol.MessageBody
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8900 value, IJT808Config config)
{
writer.WriteByte(value.PassthroughType);
JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(value.JT808_0X8900_BodyBase, ref writer, value.JT808_0X8900_BodyBase, config);

if ( value.JT808_0X8900_BodyBase != null )
{
JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize( value.JT808_0X8900_BodyBase, ref writer, value.JT808_0X8900_BodyBase, config );
}
else
{
writer.WriteArray( value.PassthroughData );
}

}
/// <summary>
///


Carregando…
Cancelar
Guardar