コード例 #1
0
 public static Response Simple_atomic_blockwise_put_with_negotiation_response(int num)
 {
     var m = num < 6 ? 1 : 0;
     var response = new Response(MessageType.Acknowledgement, CodeRegistry.Changed) { Id = 1234, Token = ByteConverter.GetBytes(0x17) };
     response.AddOption(new BlockOption(OptionNumber.Block1, num, m, BlockOption.EncodeSzx(32)));
     return response;
 }
コード例 #2
0
 public static Response Simple_blockwise_get_block(int num)
 {
     var id = 1234 + num;
     var m = num < 2 ? 1 : 0;
     var block = new Response(MessageType.Acknowledgement, CodeRegistry.Content) { Id = id, Payload = new byte[128] };
     block.AddOption(new BlockOption(OptionNumber.Block2, num, m, BlockOption.EncodeSzx(128)));
     return block;
 }