|
libose
the C library every o.se host is built on
|
Decoder state. Make one with ose_initSLIPBuf(). More...
#include <ose_slip.h>
Data Fields | |
| uint8_t * | buf |
| int32_t | buflen |
| int32_t | count |
| int32_t | state |
| int | havenullbyte |
| int | textmode |
| Treat a newline as the end of a message. Off by default. | |
Decoder state. Make one with ose_initSLIPBuf().
| uint8_t* ose_SLIPBuf::buf |
Where decoded bytes go. Caller-owned.
| int32_t ose_SLIPBuf::buflen |
Its size.
| int32_t ose_SLIPBuf::count |
Bytes decoded so far; the frame length once ose_SLIPDecode() returns 0.
| int ose_SLIPBuf::havenullbyte |
Internal; only meaningful in text mode.
| int32_t ose_SLIPBuf::state |
Internal.
| int ose_SLIPBuf::textmode |
Treat a newline as the end of a message. Off by default.
A serial terminal convenience, not part of SLIP. With it on, a CR or LF arriving before any zero byte ends the frame and appends an OSC typetag marker, so that typing /foo and pressing Enter produces a well formed message. havenullbyte is how it guesses text from binary: the first zero byte turns the behaviour off for that frame.
Leave it off for binary. In a machine or a bundle, 0x0A and 0x0D are ordinary payload bytes – parts of ints, floats, blobs and strings – and ending the frame on one corrupts the data with nothing to say so. An OSC bundle is safe only incidentally: it begins "#bundle\0", whose zero at byte 7 arrives before any payload can contain a newline.