FullCircle/Protobuf

Aus C3MAWiki
Zur Navigation springenZur Suche springen
Die druckbare Version wird nicht mehr unterstützt und kann Darstellungsfehler aufweisen. Bitte aktualisiere deine Browser-Lesezeichen und verwende stattdessen die Standard-Druckfunktion des Browsers.

Die Binären werte verschiedener Protbuf Messages, gemäß aktuellen sequence.proto in libfullcircle. Vorher dies lesen: https://developers.google.com/protocol-buffers/docs/encoding?hl=de-DE

Beschreibung

Daten des Beispiel so vorhanden.

Hexcode der Serialisierten Daten

0x00 = typ: fid:

je nach Typ unterscheiden sich die folgenden Bytes:

0: Varint

Das folgende Byte enthält den Wert des Feldes

2: Length-delimited

Das folgende Byte enthält die Länge der Struktur, die folgt darauf. Alternativ 0, dann folgt keine Struktur

Liste der Pakete (unvollständig)

Start_snip

08 05 7A 00

  • 0x08 = typ:0 fid:1
  • 0x05 = value: 5 (Sniptype: 5)
  • 0x7A = typ:2 fid:15
  • 0x00 = length: 0

Pixel

* red: 1
* green: 2
* blue: 3
* x: 4
* y: 5

08 01 10 02 18 03 20 04 28 05

  • 0x08 = typ:0 fid:1
  • 0x01 = value: 1
  • 0x10 = typ:0 fid:2
  • 0x02 = value: 2
  • 0x18 = typ:0 fid:3
  • 0x03 = value: 3
  • 0x20 = typ:0 fid:4
  • 0x04 = value: 4
  • 0x28 = typ:0 fid:5
  • 0x05 = value: 5

Frame

pixel {

 red: 1
 green: 2
 blue: 3
 x: 4
 y: 5

} pixel {

 red: 99
 green: 98
 blue: 97
 x: 96
 y: 95

} 0A 0A 08 01 10 02 18 03 20 04 28 05 0A 0A 08 63 10 62 18 61 20 60 28 5F

  • 0x0A = typ:2 fid:1
  • 0x0A = length: 10
  • 0x08 = siehe Pixel
  • 0x01 = siehe Pixel
  • 0x10 = siehe Pixel
  • 0x02 = siehe Pixel
  • 0x18 = siehe Pixel
  • 0x03 = siehe Pixel
  • 0x20 = siehe Pixel
  • 0x04 = siehe Pixel
  • 0x28 = siehe Pixel
  • 0x05 = siehe Pixel
  • 0x0A = typ:2 fid:1
  • 0x0A = length: 10

... next Pixel ...

  • 0x28 = typ:0 fid: 5
  • 0x5F = 95

Frame_snip

Datei:Frame.zip => type: FRAME frame_snip {

 frame {
   pixel {
     red: 1
     green: 2
     blue: 3
     x: 4
     y: 5
   }
   pixel {
     red: 99
     green: 98
     blue: 97
     x: 96
     y: 95
   }
 }

} 08 06 82 01 1A 0A 18 0A 0A 08 01 10 02 18 03 20 04 28 05 0A 0A 08 63 10 62 18 61 20 60 28 5F

  • 0x08 = typ:0 fid:1 snip_type = FRAME
  • 0x06 = value: 6
  • 0x82 01 = typ:2 fid:16 frame_snip
  • 0x1A = length: 26
  • 0x0A = typ:2 fid:1
  • 0x18 = length: 24
  • 0x0A ff siehe Frame

Großer Frame

=> frame {

 pixel {
   red: 255
   green: 255
   blue: 255
   x: 1024
   y: 1024
 }
 pixel {
   red: 255
   green: 255
   blue: 255
   x: 1024
   y: 1024
 }
 pixel {
   red: 255
   green: 255
   blue: 255
   x: 1024
   y: 1024
 }
 pixel {
   red: 255
   green: 255
   blue: 255
   x: 1024
   y: 1024
 }
 pixel {
   red: 255
   green: 255
   blue: 255
   x: 1024
   y: 1024
 }

} 08 06 82 01 57 0A 55 0A 0F 08 FF 01 10 FF 01 18 FF 01 20 80 08

28 80 08 0A 0F 08 FF 01 10 FF 01 18 FF 01 20 80 08 28 80 08 0A 0F 08 FF 01 10 FF 01 18 FF 01 20 80 08 28 80 08 0A 0F 08 FF 01 10 FF 01 18 FF 01 20 80 08 28 80 08 0A 0F 08 FF 01 10 FF 01 18 FF 01 20 80 08 28 80 08

  • 0x08 = typ:0 fid:1 snip_type = FRAME
  • 0x06 = value: 6
    • 0x82 01 = typ:2 fid:16 frame_snip
    • 0x57 = length: 87
      • 0x0A = typ:2 fid:1
      • 0x55 = length: 85
        • Anfang Frame
        • 0x0A = typ:2 fid:1 pixel
        • 0x0F = length: 15
          • Anfang Pixel
          • 0x08 = typ:0 fid:1
          • 0xFF 01 = 255
          • 0x10 = typ:0 fid:2
          • 0xFF 01 = 255
          • 0x18 = typ:0 fid:3
          • 0xFF 01 = 255
          • 0x20 = typ:0 fid:4
          • 0x80 08 = b1000 0000 | 0000 1000 = MSB wegschmeißen > b000 0000 | 000 1000 = Bytes Tauschen > b000 1000 | 000 0000 = Zusammenfügen > b0100 | 0000 0000 = 1024
          • 0x28 = typ:0 fid:5
          • 0x80 08 = 1024

...

Eos_snip

=> type: START start_snip { } 08 0B AA 01 00

  • 0x08 = typ:0 fid:1
  • 0x0B = value: 11
  • 0xAA 01= b010 1010 | 000 0001 => 10101010 = typ:2 fid:21
  • 0x00 length:0

Request_Snip

Datei:Request.hex.zip => type: REQUEST req_snip {

 color: "rot"
 seqId: 1
 meta {
   frames_per_second: 24
   width: 1
   height: 1
   generator_name: "Test"
   generator_version: "0.0"
 }

} 08 04 72 1A 0A 03 72 6F 74 10 01 1A 11 08 18 10 01 18 01 22 04 54 65 73 74 2A 03 30 2E 30

  • 0x08 = typ:0 fid:1 snip_type = REQUEST
  • 0x04 = value: 4
  • 0x72 = typ:2 fid:14 req_snip
  • 0x1A = length: 26
    • 0x0A = typ:2 fid :1 color
    • 0x03 = length: 3
      • 0x72 = r
      • 0x6F = o
      • 0x74 = t
    • 0x10 = typ:0 fid:2 seqId
    • 0x01 = value: 1
    • 0x1A = typ:2 fid:3 meta
    • 0x11 = length:17
      • 0x08 = typ:0 fid:1 frames_per_second
      • 0x18 = value: 24
      • 0x10 = typ:0 fid:2 width
      • 0x01 = value: 1
      • 0x18 = typ:0 fid:3 heigh
      • 0x01 = value: 1
      • 0x22 = typ:2 fid:4 generator_name
      • 0x04 = length: 4
        • 0x54 = T
        • 0x65 = e
        • 0x73 = s
        • 0x74 = t
      • 0x2A = typ:2 fid:5 generator_version
      • 0x03 = length: 3
        • 0x30 = 0
        • 0x2E = .
        • 0x30 = 0

Error_snip

Datei:Error.zip => type: ERROR error_snip {

 errorcode: OK
 description: "Gut"

} 08 03 6A 07 08 01 12 03 47 75 74

  • 0x08 = typ:0 fid:1 snip_type= error
  • 0x03 = value: 3
  • 0x6A = typ:2 fid: 13
  • 0x07 = length: 7
    • 0x08 = typ:0 fid:1 errorcode
    • 0x01 = value: 1
    • 0x12 = typ:2 fid: 2
    • 0x03 = length: 3
      • 0x47 = G
      • 0x75 = u
      • 0x74 = t

BinarySequence

>> a.metadata => frames_per_second: 25 width: 30 height: 23 generator_name: "Dings" generator_version: "999.9" => [pixel {

 red: 255
 green: 255
 blue: 255
 x: 1024
 y: 1024

} pixel {

 red: 255
 green: 255
 blue: 255
 x: 1024
 y: 1024

} pixel {

 red: 255
 green: 255
 blue: 255
 x: 1024
 y: 1024

} pixel {

 red: 255
 green: 255
 blue: 255
 x: 1024
 y: 1024

} ] 0A 14 08 19 10 1E 18 17 22 05 44 69 6E 67 73 2A 05 39 39 39 2E 39 12 44 0A 0F 08 FF 01 10 FF 01 18 FF 01 20 80 08 28 80 08 0A 0F 08 FF 01 10 FF 01 18 FF 01 20 80 08 28 80 08 0A 0F 08 FF 01 10 FF 01 18 F F0 12 08 00 82 88 00 80 A0 F0 8F F0 11 0F F0 11 8F F0 12 08 00 82 88 00 8

  • 0x0A = typ:2 fid:1 metadata
  • 0x14 = length: 20
    • 0x08 = typ:0 fid: 1 frames_per_second (Metadata)
    • 0x19 = value: 25
    • 0x10 = typ:0 fid:2 width
    • 0x1E = value: 30
    • 0x18 = typ:0 fid:3 height
    • 0x17 = value: 23
    • 0x22 = typ:2 fid: 4
    • 0x05 = length: 5
    • 0x44 = D
    • 0x69 = i
    • 0x6E = n
    • 0x67 = g
    • 0x73 = s
    • 0x2A = typ:2 fid:5
    • 0x05 = length: 5
    • 0x39 = 9
    • 0x39 = 9
    • 0x39 = 9
    • 0x2E = .
    • 0x39 = 9
  • 0x12 = typ:2 fid:2 frame
  • 0x44 = length: 68
    • 0x0A = typ:2 fid: 1
    • 0x0F = length: 15
    • 0x08 = typ:0 fid:1
    • 0xFF 01 = value: 255

.... (siehe frame)

InfoAnswer

=> type: INFO_ANSWER infoanswer_snip {

 meta {
   frames_per_second: 25
   width: 98
   height: 13
   generator_name: "Katze"
   generator_version: "999.9"
 }

} 08 0D BA 01 16 0A 14 08 19 10 62 18 0D 22 05 4B 61 74 7A 65 2A 05 39 39 39 2E 39

  • 0x08 = typ:0 fid:1
  • 0x0D = value: 13
  • 0xBA 01 = typ: 2 fid: 23 infoanswer_snip
  • 0x16 = length: 16
    • 0x0A = typ:2 fid:1 metadata
    • 0x14 = length: 14
      • 0x08 = typ:0 fid:1 frames_per_second
      • 0x19 = length: 25

... siehe Metadata

InfoRequest

=> type: INFO_REQUEST inforequest_snip { } 08 0C B2 01 00

  • 0x08 = typ:0 fid:1
  • 0x0C = value: 12
  • 0xB2 01 = typ: 2 fid:22
  • 0x00 = length: 0