Lines Matching refs:b64
105 int lwm2m_float_to_b64(double *in, uint8_t *b64, size_t len) in lwm2m_float_to_b64() argument
119 memset(b64, 0, len); in lwm2m_float_to_b64()
164 memset(b64, 0, len); in lwm2m_float_to_b64()
168 b64[0] = val2 < 0 ? 0x80 : 0; in lwm2m_float_to_b64()
170 b64[0] = val1 < 0 ? 0x80 : 0; in lwm2m_float_to_b64()
174 b64[0] |= (e >> 4); in lwm2m_float_to_b64()
175 b64[1] = ((e & 0xF) << 4); in lwm2m_float_to_b64()
179 b64[1] |= ((f >> 48) & 0xF); in lwm2m_float_to_b64()
180 b64[2] = (f >> 40) & 0xFF; in lwm2m_float_to_b64()
181 b64[3] = (f >> 32) & 0xFF; in lwm2m_float_to_b64()
182 b64[4] = (f >> 24) & 0xFF; in lwm2m_float_to_b64()
183 b64[5] = (f >> 16) & 0xFF; in lwm2m_float_to_b64()
184 b64[6] = (f >> 8) & 0xFF; in lwm2m_float_to_b64()
185 b64[7] = f & 0xFF; in lwm2m_float_to_b64()
257 int lwm2m_b64_to_float(uint8_t *b64, size_t len, double *out) in lwm2m_b64_to_float() argument
272 sign = SHIFT_RIGHT(b64[0], 7, 0x1); in lwm2m_b64_to_float()
275 e = SHIFT_LEFT((uint16_t)b64[0], 4, 0x7F0); in lwm2m_b64_to_float()
276 e += SHIFT_RIGHT(b64[1], 4, 0xF); in lwm2m_b64_to_float()
283 f += ((int64_t)(b64[1] & 0xF) << 48); in lwm2m_b64_to_float()
284 f += ((int64_t)b64[2] << 40); in lwm2m_b64_to_float()
285 f += ((int64_t)b64[3] << 32); in lwm2m_b64_to_float()
286 f += ((int64_t)b64[4] << 24); in lwm2m_b64_to_float()
287 f += ((int64_t)b64[5] << 16); in lwm2m_b64_to_float()
288 f += ((int64_t)b64[6] << 8); in lwm2m_b64_to_float()
289 f += b64[7]; in lwm2m_b64_to_float()