54 static inline unsigned int encode_uint16(uint16_t p_uint, uint8_t *p_arr) {
56 for (
int i=0;
i<2;
i++) {
62 return sizeof( uint16_t );
65 static inline unsigned int encode_uint32(uint32_t p_uint, uint8_t *p_arr) {
67 for (
int i=0;
i<4;
i++) {
73 return sizeof( uint32_t );
76 static inline unsigned int encode_float(
float p_float, uint8_t *p_arr) {
80 encode_uint32( mf.
i, p_arr );
82 return sizeof( uint32_t );
85 static inline unsigned int encode_uint64(uint64_t p_uint, uint8_t *p_arr) {
87 for (
int i=0;
i<8;
i++) {
93 return sizeof(uint64_t);
96 static inline unsigned int encode_double(
double p_double, uint8_t *p_arr) {
100 encode_uint64( md.
l, p_arr );
102 return sizeof(uint64_t);
107 static inline int encode_cstring(
const char *p_string, uint8_t * p_data) {
115 *p_data=(uint8_t)*p_string;
122 if (p_data) *p_data = 0;
126 static inline uint16_t decode_uint16(
const uint8_t *p_arr) {
130 for (
int i=0;
i<2;
i++) {
141 static inline uint32_t decode_uint32(
const uint8_t *p_arr) {
145 for (
int i=0;
i<4;
i++) {
156 static inline float decode_float(
const uint8_t *p_arr) {
159 mf.
i = decode_uint32(p_arr);
163 static inline uint64_t decode_uint64(
const uint8_t *p_arr) {
167 for (
int i=0;
i<8;
i++) {
169 uint64_t b = (*p_arr)&0xFF;
178 static inline double decode_double(
const uint8_t *p_arr) {
181 md.
l = decode_uint64( p_arr );
187 Error decode_variant(
Variant& r_variant,
const uint8_t *p_buffer,
int p_len,
int *r_len=NULL);
188 Error encode_variant(
const Variant& p_variant, uint8_t *r_buffer,
int &r_len);
float f
float
Definition: marshalls.h:45
double d
double
Definition: marshalls.h:51
uint32_t i
int
Definition: marshalls.h:44
uint64_t l
long long
Definition: marshalls.h:50
Definition: marshalls.h:48
Definition: marshalls.h:42