inicio mail me! sindicaci;ón

How does BlueMotion work?

Here is a very quick outline of how BlueMotion (formally SonWii, the mobile application) work - this is useful for developers who may wish to create PC software.

Simply, BlueMotion reads data off the phones motion sensor at regular intervals (I have set it to once every 10 milliseconds) and sends this data through bluetooth to the connected device.

Information on reading off the sensor using J2ME - Go to the page!

Information on bluetooth - Go to the page!

In addition to motion data, BlueMotion also looks for key strokes.  Data is sent via an RFCOMM connection.  Data is coded as follows:

Connection/disconnection data:

Once a bluetooth connection has been made from BlueMotion and when it is disconnected, the following data are sent - basically, listen for these on the PC to find out the status of the connection:

“connected”

“close”

The motion data:

In theory, motion data is sent once every 10 millisecond (its actually a lot less than this, I think around 5 times per second any way… don’t know! haven’t formally tested this).  Each chunk of motion data is coded as follows:

“0|X value|Y value|Z value”

This is a string value and the X, Y, Z are straight off the sensor… i.e. they have not been changed at all.  The “0″ indicates this is a motion data.

The key stroke data:

Key strokes are sent as well as motion.  Similarly, keystrokes are sent as strings in a coded format.  BlueMotion sends a keystroke when a key is pressed and when a key is released. Currently, only the following keys are detected and their respective codes and are pretty self explanatory.

When keys are pressed…

“1|00” = number pad 0
“1|01” = number pad 1
“1|02” = number pad 2
“1|03” = number pad 3
“1|04” = number pad 4
“1|05” = number pad 5
“1|06” = number pad 6
“1|07” = number pad 7
“1|08” = number pad 8
“1|09” = number pad 9

“1|10” = number pad up
“1|11” = number pad down
“1|12” = number pad left
“1|13” = number pad right

“1|14” = number pad pound (or #)
“1|15” = number pad star
“1|16” = number pad fire

When keys are held down…

“2|00” = number pad 0
“2|01” = number pad 1
“2|02” = number pad 2
“2|03” = number pad 3
“2|04” = number pad 4
“2|05” = number pad 5
“2|06” = number pad 6
“2|07” = number pad 7
“2|08” = number pad 8
“2|09” = number pad 9

“2|10” = number pad up
“2|11” = number pad down
“2|12” = number pad left
“2|13” = number pad right

“2|14” = number pad pound (or #)
“2|15” = number pad star
“2|16” = number pad fire

When keys are released…

“3|00” = number pad 0
“3|01” = number pad 1
“3|02” = number pad 2
“3|03” = number pad 3
“3|04” = number pad 4
“3|05” = number pad 5
“3|06” = number pad 6
“3|07” = number pad 7
“3|08” = number pad 8
“3|09” = number pad 9

“3|10” = number pad up
“3|11” = number pad down
“3|12” = number pad left
“3|13” = number pad right

“3|14” = number pad pound (or #)
“3|15” = number pad star
“3|16” = number pad fire

That’s all there is to it!  all you need to do is to create a PC software in your favourite language to read off the COM port and react correctly to these data flying off the moblie phone.

Feel free to ask for further details on how the software works. You can post your questions here.

To discuss other aspects of BlueMotion(including reporting bugs), please go here.

Sony Ericsson Sensor/Motion/Accelerometer games and software » SonWii update said,

July 24, 2008 @ 4:01 pm

[...] Full information about this version is found here. [...]

RSS feed for comments on this post · TrackBack URI

Leave a Comment