ZBus Protocol: Unterschied zwischen den Versionen

Aus Ethersex_Wiki
Wechseln zu: Navigation, Suche
K (hat „ZBus Protokoll“ nach „ZBus Protocol“ verschoben)
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 9: Zeile 9:
 
stop condtiontion is no field that represents the length of the packet.  
 
stop condtiontion is no field that represents the length of the packet.  
  
The start condtiotion is an '\' (0x5C) followed by an '0' (0x30).
+
The start condition is an '\' (0x5C) followed by an '0' (0x30).
 
Corresponding to that is the stop condition an '\' (0x5C) followed by an
 
Corresponding to that is the stop condition an '\' (0x5C) followed by an
 
'1' (0x31). But we also have to escape all '\' (0x5C) inside the packet,
 
'1' (0x31). But we also have to escape all '\' (0x5C) inside the packet,
so that an start condtiotion can't be happen at random. ZBus does this in
+
so that a start condition can't happen at random. ZBus does this in
 
the normal Unix way by replacing every '\' with an '\\'
 
the normal Unix way by replacing every '\' with an '\\'
  
Zeile 19: Zeile 19:
 
  \0get information about \\0 and \\1 in zbus\1
 
  \0get information about \\0 and \\1 in zbus\1
  
The plain message whoul be:
+
The plain message would be:
  
 
  get information about \0 and \1 in zbus
 
  get information about \0 and \1 in zbus
  
 
[[Kategorie:ZBus]]
 
[[Kategorie:ZBus]]

Aktuelle Version vom 20. Oktober 2010, 02:27 Uhr

ZBus is a protocol to transfer packets over an serial line, where only one byte can be sent at once, e.g. RS485. The problem with such a serial line is, that every byte is independend from another byte. So you have to define a format for a packets, in which you can chain many bytes together, in order send more information than just one byte. ZBus is such an format.

ZBus is a little bit related to I2C: There is an start condtition at the beginning of a packet and a stop conditon at the end. Between start and stop condtiontion is no field that represents the length of the packet.

The start condition is an '\' (0x5C) followed by an '0' (0x30). Corresponding to that is the stop condition an '\' (0x5C) followed by an '1' (0x31). But we also have to escape all '\' (0x5C) inside the packet, so that a start condition can't happen at random. ZBus does this in the normal Unix way by replacing every '\' with an '\\'

A packet can for example look like this:

\0get information about \\0 and \\1 in zbus\1

The plain message would be:

get information about \0 and \1 in zbus