#include <Ciao.hh>
|
enum | {
MASK_ATTR = 0x0f,
COUNT0_ATTR = 0x00,
COUNT4_MASK = 0x07,
COUNT8_ATTR = 0x08,
COUNT16_ATTR = 0x09,
END_SEQUENCE_ATTR = 0x0f
} |
|
enum | {
MASK_TYPE = 0xf0,
UINT8_TYPE = 0x00,
UINT16_TYPE = 0x10,
UINT32_TYPE = 0x20,
UINT64_TYPE = 0x30,
USER8_DESC_START = 0x40,
USER8_DESC_END = USER8_DESC_START | END_SEQUENCE_ATTR,
USER16_DESC_START = 0x50,
USER16_DESC_END = USER16_DESC_START | END_SEQUENCE_ATTR,
USER8_TYPE = 0x60,
USER16_TYPE = 0x70,
INT8_TYPE = 0x80,
INT16_TYPE = 0x90,
INT32_TYPE = 0xa0,
INT64_TYPE = 0xb0,
FLOAT16_TYPE = 0xc0,
FLOAT32_TYPE = 0xd0,
FLOAT64_TYPE = 0xe0,
FLOAT80_TYPE = 0xf0
} |
|
enum | { LITTLE_ENDIAN = 0,
BIG_ENDIAN = 1
} |
|
|
| Ciao (IOStream::Device *dev=NULL) |
|
void | set (IOStream::Device *dev) |
|
void | begin () |
|
void | write (char *s) |
|
void | write (str_P s) |
|
void | write (uint8_t value) |
|
void | write (uint8_t *buf, uint16_t count) |
|
void | write (uint16_t value) |
|
void | write (uint16_t *buf, uint16_t count) |
|
void | write (uint32_t value) |
|
void | write (uint32_t *buf, uint16_t count) |
|
void | write (uint64_t value) |
|
void | write (uint64_t *buf, uint16_t count) |
|
void | write (int8_t value) |
|
void | write (int8_t *buf, uint16_t count) |
|
void | write (int16_t value) |
|
void | write (int16_t *buf, uint16_t count) |
|
void | write (int32_t value) |
|
void | write (int32_t *buf, uint16_t count) |
|
void | write (int64_t value) |
|
void | write (int64_t *buf, uint16_t count) |
|
void | write (float value) |
|
void | write (float *buf, uint16_t count) |
|
void | write (const Descriptor::user_t *desc) |
|
void | write (const Descriptor::user_t *desc, void *buf, uint16_t count) |
|
|
void | write (uint8_t type, uint16_t count) |
|
The Cosa Ciao data stream handler. Please see CIAO.txt for details.
Limitations
The Ciao class handles only output. The data types 16, 64 and 80-bit floating point are not supported.
Also
Requires an IOSteam::Device. This is used in binary/8-bit character mode. See also Cosa/Fai.hh for details on board state reporting.
References
[1] Sun Microsystems (1987). "XDR: External Data Representation
Standard". RFC 1014. Network Working Group. Retrieved July 11,
- http://tools.ietf.org/html/rfc1014
[2] Boost Serialization, http://www.boost.org/doc/libs/1_46_1/libs/serialization/doc/index.html
[3] Java Stream Format, http://docs.oracle.com/javase/7/docs/platform/serialization/spec/protocol.html#10258
[4] Arduino/Firmata, http://www.firmata.org
Definition at line 47 of file Ciao.hh.
Tag attribute: Number for data values in sequence[count]. User defined data type name as value or end of used defined data type sequence.
Enumerator |
---|
MASK_ATTR |
|
COUNT0_ATTR |
|
COUNT4_MASK |
|
COUNT8_ATTR |
|
COUNT16_ATTR |
|
END_SEQUENCE_ATTR |
|
Definition at line 54 of file Ciao.hh.
Data type tag: Predefined data types and tags for extension. NB: Arduino/AVR does not implement FLOAT16/64/80.
Enumerator |
---|
MASK_TYPE |
|
UINT8_TYPE |
|
UINT16_TYPE |
|
UINT32_TYPE |
|
UINT64_TYPE |
|
USER8_DESC_START |
|
USER8_DESC_END |
|
USER16_DESC_START |
|
USER16_DESC_END |
|
USER8_TYPE |
|
USER16_TYPE |
|
INT8_TYPE |
|
INT16_TYPE |
|
INT32_TYPE |
|
INT64_TYPE |
|
FLOAT16_TYPE |
|
FLOAT32_TYPE |
|
FLOAT64_TYPE |
|
FLOAT80_TYPE |
|
Definition at line 67 of file Ciao.hh.
Enumerator |
---|
LITTLE_ENDIAN |
|
BIG_ENDIAN |
|
Definition at line 128 of file Ciao.hh.
Construct data streaming for given device.
- Parameters
-
Definition at line 138 of file Ciao.hh.
Start the data stream with a version string and endian information.
Definition at line 76 of file Ciao.cpp.
Set io-stream device.
- Parameters
-
Definition at line 144 of file Ciao.hh.
void Ciao::write |
( |
char * |
s | ) |
|
Write given string to data stream.
- Parameters
-
Definition at line 87 of file Ciao.cpp.
void Ciao::write |
( |
str_P |
s | ) |
|
Write given string from program memory to data stream.
- Parameters
-
[in] | s | program memory string to write |
Definition at line 95 of file Ciao.cpp.
void Ciao::write |
( |
uint8_t |
value | ) |
|
Write given unsigned 8-bit integer to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 103 of file Ciao.cpp.
void Ciao::write |
( |
uint8_t * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given unsigned 8-bit integer vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 110 of file Ciao.cpp.
void Ciao::write |
( |
uint16_t |
value | ) |
|
Write given unsigned 16-bit integer to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 117 of file Ciao.cpp.
void Ciao::write |
( |
uint16_t * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given unsigned 16-bit integer vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 124 of file Ciao.cpp.
void Ciao::write |
( |
uint32_t |
value | ) |
|
Write given unsigned 32-bit integer to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 131 of file Ciao.cpp.
void Ciao::write |
( |
uint32_t * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given unsigned 32-bit integer vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 138 of file Ciao.cpp.
void Ciao::write |
( |
uint64_t |
value | ) |
|
Write given unsigned 64-bit integer to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 145 of file Ciao.cpp.
void Ciao::write |
( |
uint64_t * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given unsigned 64-bit integer vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 152 of file Ciao.cpp.
void Ciao::write |
( |
int8_t |
value | ) |
|
Write given signed 8-bit integer to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 159 of file Ciao.cpp.
void Ciao::write |
( |
int8_t * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given signed 8-bit integer vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 166 of file Ciao.cpp.
void Ciao::write |
( |
int16_t |
value | ) |
|
Write given signed 16-bit integer to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 173 of file Ciao.cpp.
void Ciao::write |
( |
int16_t * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given signed 16-bit integer vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 179 of file Ciao.cpp.
void Ciao::write |
( |
int32_t |
value | ) |
|
Write given signed 32-bit integer to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 186 of file Ciao.cpp.
void Ciao::write |
( |
int32_t * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given signed 32-bit integer vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 193 of file Ciao.cpp.
void Ciao::write |
( |
int64_t |
value | ) |
|
Write given signed 64-bit integer to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 200 of file Ciao.cpp.
void Ciao::write |
( |
int64_t * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given signed 64-bit integer vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 207 of file Ciao.cpp.
void Ciao::write |
( |
float |
value | ) |
|
Write given 32-bit floating point to data stream.
- Parameters
-
[in] | value | to write to data stream. |
Definition at line 214 of file Ciao.cpp.
void Ciao::write |
( |
float * |
buf, |
|
|
uint16_t |
count |
|
) |
| |
Write given 32-bit floating vector to data stream.
- Parameters
-
[in] | buf | pointer to integer vector. |
[in] | count | size of vector. |
Definition at line 221 of file Ciao.cpp.
Write given user defined data type descriptor to data stream.
- Parameters
-
[in] | desc | descriptor structure to write (progam memory). |
Definition at line 250 of file Ciao.cpp.
Write given user defined data type value to data stream.
- Parameters
-
[in] | desc | user defined data type (program memory). |
[in] | buf | pointer to value(s) to write. |
[in] | count | size of sequence to write. |
Definition at line 304 of file Ciao.cpp.
void Ciao::write |
( |
uint8_t |
type, |
|
|
uint16_t |
count |
|
) |
| |
|
protected |
Write data tag to given stream.
- Parameters
-
[in] | type | data type tag. |
[in] | count | number of elements in sequence. |
Definition at line 228 of file Ciao.cpp.
The documentation for this class was generated from the following files: