Ejemplo n.º 1
0
 public void SetValue(uint value)
 {
     ValueFormat = OptionValueFormat.UInt;
     RawValue    = EndianBitConverter.Big.GetBytes(value);
 }
Ejemplo n.º 2
0
 public void SetValue(byte[] value)
 {
     ValueFormat = OptionValueFormat.Opaque;
     RawValue    = value;
 }
Ejemplo n.º 3
0
 public void SetValue(string value)
 {
     ValueFormat = OptionValueFormat.String;
     RawValue    = Encoding.UTF8.GetBytes(value);
 }
Ejemplo n.º 4
0
 public CoapOption(Option number, uint value)
 {
     Number      = number;
     RawValue    = EndianBitConverter.Big.GetBytes(value);
     ValueFormat = OptionValueFormat.UInt;
 }
Ejemplo n.º 5
0
 public CoapOption(Option number, string value)
 {
     Number      = number;
     RawValue    = Encoding.UTF8.GetBytes(value);
     ValueFormat = OptionValueFormat.String;
 }
Ejemplo n.º 6
0
 public CoapOption(Option number, byte[] value)
 {
     Number      = number;
     RawValue    = value;
     ValueFormat = OptionValueFormat.Opaque;
 }
Ejemplo n.º 7
0
 // TODO validate what option can use what types
 public CoapOption(Option number)
 {
     Number      = number;
     RawValue    = new byte[] { };
     ValueFormat = OptionValueFormat.Empty;
 }
Ejemplo n.º 8
0
 private static void ShouldOutputHelp(string program, string[] commands, OptionValueFormat optionValueFormat, string expected)
 {
     var command = new TestWorkerCommand { TestWriter = new TestWriter() };
     command.Execute(program, commands, new[] { "?" }, new CmdLineSettings { OptionValueFormat = optionValueFormat });
     command.TestWriter.ToString().ShouldBe(expected);
 }