Pandora As A Bluetooth Peripheral


j6cubic

Member
Joined
Nov 20, 2008
Messages
203
(I've searched for similar threads but couldn't find any with thread titles indicative of similar content so here we go.)

On my iPod touch I have an application that, when combined with a server on a Windows or OS X box, allows me to use the iPod as a WLAN-attached gamepad. Yes, it's as unusable as it sounds but hey, it's still a nifty concept.

Now I wondered: The Pandora has an entire Bluetooth stack. Does the BT spec allow us to use it not as a host but as a peripheral attached to another device? If yes then we could attach the Pandora to a PC and use it as a Bluetooth keyboard, gamepad and touchpad. I certainly wouldn't mind that.

We could go even further if we go the client/server-over-WLAN route – essentially we could turn the Pandora into a G15 clone with built-in gamepad, displaying all kinds of information on the Pandora's screen while remotely controlling the PC. I'm not sure whether BT gives us enough bandwidth for the fancier tasks (plus, it sounds CPU-taxing enough that turning off BT to save power might be a good idea).



On a semi-related note, there should be some kind of standardized way of getting information out of games. So far, the G15 and its siblings are only useful for a handful of games that directly support them. It'd be nice if there was a standardized way of querying games for information (even if only FOSS games support it) so if we want to support a certain game we can just ask it for what it thinks to be relevant information and build our info applet from that without having to write any game-specific code other than that needed to format the data we received.

I'd suggest something simple that can easily be implemented. For example, the game could listen on port 4860/tcp (randomly chosen non-IANA-registered number unlikely to be used as an ephemeral port). If the game receives a message on that port, it discards the message (so the feature can't be used as an attack vector) and replies with a newline-separated list of values. Maybe one could allow the game to interpret the message it was sent (if one wants to display several sets of data) but I'd make it optional as I don't want to enable a worm to work by exploiting exposed game information ports.

If this made it into the mainstream, users of applet-capable keyboards like the G15 would also profit. Of course it won't but it'd still be kinda nice.
 
On the whole using the Pandora as a peripheral front, what I'd really like to be able to do is use it as a PS3 gamepad, since they also use Bluetooth. Is this theoretically possible?
 
with usb, yes!
its built into the kernel, acts as any usb joypad!


however, on bluetooth i have no idea, i know there exists some utils for linux that will help you make it auto connect to your BT MAC (sets up via usb)
but how it acts as a bt device under linux, no clue, sorry
 
j6cubic said:
On a semi-related note, there should be some kind of standardized way of getting information out of games. So far, the G15 and its siblings are only useful for a handful of games that directly support them. It'd be nice if there was a standardized way of querying games for information (even if only FOSS games support it) so if we want to support a certain game we can just ask it for what it thinks to be relevant information and build our info applet from that without having to write any game-specific code other than that needed to format the data we received.
I mentioned ages ago that the Pandora would be useful for displaying games data etc. when gaming on the PC.
It could be used to show Walk throughs for the game currently being played, Maps and data to show where your team mates are etc., High score tables.
Most people seemed to think it was'nt such a good idea for some reason. God knows why??

EDIT: I also suggested moving the voice coms from the PC onto the Pandora. That way if your PC crashes you can let your team know what's going on.
 
Last edited by a moderator:
I remember seeing a bluetooth app like that in development for the N900. It's a very interesting concept.
 
j6cubic said:
On a semi-related note, there should be some kind of standardized way of getting information out of games. So far, the G15 and its siblings are only useful for a handful of games that directly support them. It'd be nice if there was a standardized way of querying games for information (even if only FOSS games support it) so if we want to support a certain game we can just ask it for what it thinks to be relevant information and build our info applet from that without having to write any game-specific code other than that needed to format the data we received.

I'd suggest something simple that can easily be implemented. For example, the game could listen on port 4860/tcp (randomly chosen non-IANA-registered number unlikely to be used as an ephemeral port). If the game receives a message on that port, it discards the message (so the feature can't be used as an attack vector) and replies with a newline-separated list of values. Maybe one could allow the game to interpret the message it was sent (if one wants to display several sets of data) but I'd make it optional as I don't want to enable a worm to work by exploiting exposed game information ports.
So essentially you're asking for games to update your .plan?
 
Last edited by a moderator:
yannv said:
So essentially you're asking for games to update your .plan?
Huh? Finger runs on port 79 and is used to expose information about the user to the internet. What I intend runs on port 4860 (or some other not-yet-registered post) and is used to expose information about one process to the local machine (that you can query it over the network is just a welcome side-effect). I think using a port is acceptable as it offers an easy cross-platform way of doing IPC and it's highly unlikely that someone is going to run two games at once (and if they do it's unlikely that a client would deliver useful information).

In which way is this equivalent to Finger besides "allows someone to obtain data through a network socket"?


As for the N900 app: That's intersting. It'd definitely be a good starting point to get similar functionality on the Pandora (and maybe the author would be interested in expanding it into a generic mobile-device-as-input-device app).
 
Last edited by a moderator:
You could just as well use dbus. It's what the linux-world seems to be standardizing on for most inter-process-communication. There's libraries to handle all of the complexities, so your resulting code's probably going to be smaller than a DIY.
 
The problem is that outside of Linux, dbus is pretty much nonexistent. I wouldn't want to tie the device to one specific host OS even if it's unlikely that non-FOSS developers are interested. Granted, one could simply ship libdbus with the game but that's a bit bloaty and I don't know whether regular dbus and winDBus are fully compatible.
 
Back
Top