endianness

Apple's heart rate monitoring example and byte order of bluetooth heart rate measurement characteristics

本小妞迷上赌 提交于 2019-11-28 01:38:19
问题 On the heart rate measurement characteristics: http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml EDIT Link is now at https://www.bluetooth.com/specifications/gatt/characteristics/ and look for "heart rate measurement". They no longer offer an XML viewer, but instead you need to view XML directly. Also for services it's on this page. END EDIT I want to make sure I'm reading it correctly. Does that

Is endian conversion required for wchar_t data?

人盡茶涼 提交于 2019-11-28 00:36:44
问题 In C/C++, if a multi-byte wide character (wchar_t) value is transmitted from a big-endian system to a little-endian system (or vice-versa), will it come out the same value on the other side? Or will the bytes need to be swapped? 回答1: Yes you will need to swap them. The bytes will be retrieved from the transport in the same order they were put in. Just at the other end the ordering of these bytes has a different meaning. So you need to convert them to the correct endian-ness (is that a word?).

how to convert double between host and network byte order?

泄露秘密 提交于 2019-11-28 00:27:20
Could somebody tell me how to convert double precision into network byte ordering. I tried uint32_t htonl(uint32_t hostlong); uint16_t htons(uint16_t hostshort); uint32_t ntohl(uint32_t netlong); uint16_t ntohs(uint16_t netshort); functions and they worked well but none of them does double (float) conversion because these types are different on every architecture. And through the XDR i found double-float precision format representations ( http://en.wikipedia.org/wiki/Double_precision ) but no byte ordering there. So, I would much appreciate if somebody helps me out on this (C code would be

Portable serialisation of IEEE754 floating-point values

北城以北 提交于 2019-11-27 23:36:31
问题 I've recently been working on a system that needs to store and load large quantities of data, including single-precision floating-point values. I decided to standardise on network byte order for integers, and also decided to store floating point values in big-endian format, i.e.: |-- Byte 0 --| |-- Byte 1 -| Byte 2 Byte 3 # ####### # ####### ######## ######## Sign Exponent Mantissa 1b 8b, MSB first 23b, MSB first Ideally, I want to provide functions like htonl() and ntohl() , since I have

C# big-endian UCS-2

不羁的心 提交于 2019-11-27 23:23:23
The project I'm currently working on needs to interface with a client system that we don't make, so we have no control over how data is sent either way. The problem is that were working in C#, which doesn't seem to have any support for UCS-2 and very little support for big-endian. (as far as i can tell) What I would like to know, is if there's anything i looked over in .net, or something that someone else has made and released that we can use. If not I will take a crack at encoding/decoding it in a custom method, if that's even possible. But thanks for your time either way. EDIT:

Can I safely assume that Windows installations will always be little-endian?

旧街凉风 提交于 2019-11-27 21:54:17
I'm writing a userspace filesystem driver on Windows and endianness conversions are something I've been dealing with, as this particular filesystem always stores values in little-endian format and the driver is expected to convert them (if necessary) for the CPU it's running on. However, I find myself wondering if I even need to worry about endianness conversions, since as far as I can tell, desktop Windows only supports little-endian architectures (IA32, x86-84, etc.), and therefore, the on-disk little-endian values are perfectly fine sans conversion. Is this observation accurate, and if so,

Type casting char pointer to integer pointer

懵懂的女人 提交于 2019-11-27 21:41:18
So I saw a few example on how the endianness of an architecture could be found. Let's say we have an integer pointer that points to an int data type. And let's say the int value is 0x010A0B12. In a little endian architecture, the least significant byte, i.e, 12, will be stored in the lowest memory address, right? So the lowest byte in a 4-byte integer will be 12. Now, on to the check. If we declare a char pointer p, and type cast the integer pointer to a char * and store it in p, and print the dereferenced value of p, we will get a clue on the endianness of the architecture. If it's 12, we're

Is the endianness of format params guaranteed in RIFF WAV files?

孤人 提交于 2019-11-27 21:36:11
Is the endianness of format params guaranteed in RIFF WAV files? I have heard conflicting answers to this including references to a RIFX file format. Yes. If the file starts with RIFF, then it's little endian. If it starts with FFIR or RIFX, then it's probably not. Generally, supporting the WAV format means supporting RIFF files, although adding RIFX support should not prove difficult. The AES31 specification for BWF (Broadcast Wave Format) references this specification for RIFF: http://www.tactilemedia.com/info/MCI_Control_Info.html From this: RIFF has a counterpart, RIFX, that is used to

Does my AMD-based machine use little endian or big endian?

江枫思渺然 提交于 2019-11-27 19:20:20
I'm going though a computers system course and I'm trying to establish, for sure , if my AMD based computer is a little endian machine? I believe it is because it would be Intel-compatible. Specifically, my processor is an AMD 64 Athlon x2. I understand that this can matter in C programming. I'm writing C programs and a method I'm using would be affected by this. I'm trying to figure out if I'd get the same results if I ran the program on an Intel based machine (assuming that is little endian machine). Finally, let me ask this: Would any and all machines capable of running Windows (XP, Vista,

Is there a way to do a C++ style compile-time assertion to determine machine's endianness?

与世无争的帅哥 提交于 2019-11-27 19:01:40
I have some low level serialization code that is templated, and I need to know the system's endianness at compiletime obviously (because the templates specializes based on the system's endianness). Right now I have a header with some platform defines, but I'd rather have someway to make assertions about endianness with some templated test (like a static_assert or boost_if). Reason being my code will need to be compiled and ran on a wide range of machines, of many specialized vendor, and probably devices that don't exist in 2008, so I can't really guess what might need to go into that header