Comments (2)
Hi,
What compiler are you using?
John
Original comment by [email protected]
on 14 Jun 2012 at 5:00
from moveme.
This is on iOS (both ARM and x86 simulator) using XCode 4.2 with LLVM 3.0. The
UDP network packet received from the server was 2132 bytes. The
sizeof(MoveServerPacket) (with 32bit compile) before my fix was 2100.
Further testing by building with different compilers and 32 vs. 64 bit shows
even more issues.
/* main.c */
include "moveclient.h"
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Size is %lu\n", sizeof(MoveServerPacket));
return 0;
}
========
Mac OS X 10.6.8
$ gcc --version
i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658)
(LLVM build 2336.1.00)
$ gcc -m32 -o main main.c
$ ./main
Size is 2100
$ gcc -m64 -o main main.c
$ ./main
Size is 2152
Non LLVM gcc, same results:
$ gcc-4.0 --version
i686-apple-darwin10-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5494)
$ gcc-4.0 -m32 -o main main.c
$ ./main
Size is 2100
$ gcc-4.0 -m64 -o main main.c
$ ./main
Size is 2152
Obviously, you don't want there to be any size differences in your struct when
you are overlaying it on top of a fixed sized network packet without more
fine-grained deserialization.
By applying __attribute__((packed)) to every struct and padding the
MoveImageState with two additional unsigned chars to round that up, only then
did the 32bit and 64bit compiles come up with the same number (2100 bytes).
However, I am receiving 2132 byte packets from the PS3 move.me server and only
by adding the 8byte padding in the MoveState struct is the resulting data
interpreted correctly.
What are other people seeing with different platforms with regards to the
struct and recv'd packet sizes?
Original comment by [email protected]
on 14 Jun 2012 at 5:33
from moveme.
Related Issues (20)
- Unable to connect HOT 5
- MoveMe Laser Pointer help. HOT 5
- Someone can explain me some functions. Thanks HOT 19
- How to know the posittion of the MOve controller HOT 3
- can i send a signal to the NXT lego robot whit the ps3??? HOT 1
- Crash when movemeDisconnect is called HOT 2
- How to know if the sphere is correct tracking
- Can't seem to get Navigation controller info through Move.Me HOT 1
- How to get gravity vector? HOT 4
- PSMoveSharp examples are not working HOT 1
- Timestamp HOT 1
- Maintaining same coordinate system between controller calibrations HOT 3
- Getting Started HOT 1
- Playstation MoveME Flowers help.
- Color control without disabling sphere tracking HOT 1
- Move.me freeze HOT 2
- Client not recieving info from server HOT 7
- what's happening? HOT 1
- ForceRGB() has issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moveme.