LED Bluetooth connect - Java for Android App Development

I've bought a bluetooth RGB led strip for my car on ebay, it comes with an app that connects to it.
The thing is the app is slow, buggy and lacks options.
I dev'd previously in lua and python and nothing else but I want to try and make my own app for the strip, the problem is that it never finds it even with inbuilt phone bluetooth or other BT apps.
I have no idea what it is built on so I looked for arduino BT control, didn't find the device.
Bluetooth reader (read data sent and received) and never found the device either.
But its app? Automatically pairs up with it.
I've decompiled and source and read through it, it uses UUID which I don't know anything about so it makes me thing this is the reason it never finds the strip.
This is what I believe handles all the BT process: http://pastebin.com/0zbKZF9d
Any input is appreciated.

Hello!
The device can be seen in the Bluetooth configuration of your cell phone?
The UUID is composed by long values (like 0x12345678,0x9ABCDEF) and it's used to define an application. To work, the server and the client must use the same UUID.
If you have the UUID value, then you can do a reverse engineering to understand who the app sends the commands to the leds strip.
You can create a server Bluetooth simulating the led strip (using the same UUID) and connect the app to it.
I hope this will help

Related

sending InfraRed signals

Hi,
For my robotics project at uni I want to control my robot using my PDA (magician) by doing all the processing on the PDA and sending signals via IR to the IR Input of the robot's handyboard.
I want to use c#.net to develop the program that can do this.
The handyboard's IR input takes Sony-format IR protocol signals
My question is that I've only found IRDA information for programming for the pocket pc not sending specific IR signals, I'm not sure though I haven't looked extremely hard, but obviously it can be done as there are remote control software around...
Thanks
Phi
Hi Phi!
The reason you could not find any info on sending general IR signal with a PDA is because most PDA only support the IRDA format and not custom protocols used by remote controls like SONY's protocol.
There is however a way to trick the IRDA port in to sending a signal similar enough to that of a remote control. I succeeded controlling my sony TV and VCR using my iPAQ 1710.
The problem is that due to the low strength of the signal I only got the distance of 1.5 meters tops (not very good for remote control app).
You should look for information on how to write remote control programs for Pocket PC's for more information. I will post the links I used when I get home.
If you want I can send you the code I wrote, but it’s in C++ not C#!
Hope this helps! :wink:
Using PDA as IR remote controll
Ok, here is what you have to do:
1. Open the IR as a regular serial port (on my iPaq its COM2 but you should check HKEY_LOCAL_MACHINE\Comm\IrDA for your device).
2. Set the port to 115200bs 7bit NO PARITY 1 stop bit.
3. Send the byte 0x5b for as log as you need the ‘ON’ signal.
For this you need to know the exact format of the command you want to send.
This page contains a full and detailed description of the process:
http://www.veg.nildram.co.uk/remote.htm
Here are some more links I used in my research:
http://www.epanorama.net/links/irremote.html
http://scv.bu.edu/GC/shammi/ir/
http://search.yahoo.com/search?fr=slv1-wave&p=Sending+Remote+Control+Signals+with+IRDA
I still have to remind you that most PDA IR ports are designed for close range data transfer and there for emit a very weak signal so you will have to point it carefully at the sensor.
Still, controlling a robot with your PDA sounds like a cool idea, let me know how it turns out.
Good luck!
Try this for some pointers:
An article describing how to use the IR port on a pocket PC to control a TV.
Click to expand...
Click to collapse
http://www.codeproject.com/ce/tvremote.asp
V

Looking for a specific program/piece of code

Hi,
I am currently looking for a piece of software that will do a specific job, or possibly a better solution to what I am trying to do. Let me give you a little bit of background...
I have got an O2 XDA Mini S, and a Parrot hands-free kit that does not support the A2DP bluetooth profile (only the handsfree profile). I am currently using TomTom 6 on my XDA with a bluetooth GPS unit. Everything works really nicely together, except I cannot get instructions from TomTom through my parrot (which is ultimately my goal).
The only way I can see of getting the TT instructions through my Parrot is to make use of the programs floating about that allow you to turn on and off redirection of sound through bluetooth. The idea I had was that if there was a program about (or maybe even write something myself) that would be able to signal when the sound coming out of the XDA exceeded and then dropped back below a threshold level, and then somehow link that into the bluetooth redirection programs, I could basically have any sound that is produced go through the Parrot only when they occur (including obviously the TT instructions).
Does anybody have any ideas on this? Any help would be greatly appreciated.
Thanks.
Point UI, a UI wrapper, has a feature similar to what you're describing. It's used just to save battery power by turning on BT only when an incoming call is detected, and then killing BT after the call is ended. I don't know if it's open source, but you might want to head over to their forums and see if you can find out how they did it.
You probably also want to haunt any TomTom forum sites (if any even exist).
As a final option, look into Mortscripts. People have done amazing tricks with Mortscripts, and this might be just the ticket. Mort haunts these boards, and may pipe in with an "I can (or cannot) do that with Mortscript" too...
I have a question, though. What's wrong with using the Wizard's built-in speakers for getting directions?
Myrddin Wyllt said:
I have a question, though. What's wrong with using the Wizard's built-in speakers for getting directions?
Click to expand...
Click to collapse
To be honest, it's not too bad through the speakers although if I have my radio on which I usually do, sometimes it can be a little bit hard to hear, and it would be nice to just have the radio mute while it gives me the directions.
It's more of a "want" than a "need" really.
Thanks very much for the info
Myrddin Wyllt said:
Point UI, a UI wrapper, has a feature similar to what you're describing. It's used just to save battery power by turning on BT only when an incoming call is detected, and then killing BT after the call is ended. I don't know if it's open source, but you might want to head over to their forums and see if you can find out how they did it.
Click to expand...
Click to collapse
It is quite easy for programs to detect when you're in a call - MortScript, I presume, probably can detect that quite easily as it's an overall Windows feature and will probably have a readily available part in the API.
The problem is not with turning the bluetooth on and off, it's actually detecting when TomTom is giving an instruction. To be honest I think I'll look into MortScript and if that can't do it then I'll probably just give up.
Detecting phone calls isn't that easy, and it's especially not easy to make a check in a simple procedural script language like MortScript (up to WM5, there's no way to check whether a call is active, you have to monitor all the time if a call is accepted or hung up).
Detecting sound output of another application is entirely impossible - at least for most applications. If the app opens the output channel only during output (which most don't because it takes valuable time and causes ugly "click" noises on some devices), one could maybe query the number of free output channels - but that would need a CPU hog monitoring all the time, or half of the message would be over until it's detected.
And even if that would work, there's simply no way to redirect output to a BT headset (except with A2DP). At least on most devices. Once there was a simple way to do that (you just had to open a virtual port, and as long as it's open, everything was redirected similar to the A2DP way nowadays), but most manufacturers didn't implement it, and nowadays it seems like no modern device supports it anymore. (Had it for test purposes in a MortPlayer beta, no user reported it works...)
So, to put it short: Currently it's impossble. Maybe WM8 might change that... (Few hope for WM7, it's proposed to have the same kernel as WM5 and WM6.x)

Dev request: simple 'button board'

Hello Developers,
I want to use my old magician to build into my car.
I am driving (for those who want to know) a Renault 5 GT Turbo, and building it purely for fun. I like to experiment with electronics, so injection system is used, and also a PDA with Zeitronic software to manage some data from the car.
What I want to do is be able to start the car with the PDA, or ignition the car, and other things likt boostcontrol (just on/off), lights, rev limiter, etc. All is just on-off switched.
Just being able to control six or eight Relays, via the touchscreen. Starting must be with a sort of PIN code. So is there a way to control 8 relays via usb-cable (must be charging all the time!).
And anyone an Idea or wants to put something together? If it includes some donations, willing to do so with some fun input!
Check out Arduino Board.
Not sure if you can hook it up to PDA, but might be interesting to you.
larna
Riel said:
What I want to do is be able to start the car with the PDA, or ignition the car, and other things likt boostcontrol (just on/off), lights, rev limiter, etc. All is just on-off switched.
Click to expand...
Click to collapse
Wow!
This would be amazing!
PS: If you finally reach your target, let us know and share some videos!
Thanx! Well, just see it as if I got 8 ON/OFF switches on my dashboard.
I just need the program here to give an output to the USB port. So I hook up those signals to a relayboard. Those relays set the ignition, or start the engine, etc.
I don't know much, but I think you need a serial port not usb. However with some simple electronic audio filters I think it would be possible to control almost any number of relays via the audio output. You would need some software on the phone that played an audio signal whenever a button on the screen was pressed, I am thinking mortbuttons could do this. Then you would need a set of audio filters tuned to each exact frequency which would in turn switch your relays via a power transistor.
I like the sound of your idea, if you get it on the road it would mean that any PPC could be used to switch on anything. Think about the whistling key finders you can get, the same principal. Would be nice to see your progress in the future, good luck with it.
Edit: you could even do it via bluetooth this way, taking the sound from a bt headset!
Problem is, I have totally no idea of programming
Was thinking about this and had a simpler idea but only if you've got a ppc with infra red port, which if I remember correctly the Magician has. If you had all you need is some remote control software, which there is a huge choice of fully configurable stuff with learning ability something like this: http://www.pdawin.com/tvremote.html , then you just need an infra red remote control switch board like this one on ebay: http://cgi.ebay.co.uk/RF-Wireless-R...hash=item250271194147&_trksid=p3286.m14.l1318
and you pretty much would have what you want!
Edit: Damn just noticed that one is RF not IR. But I know IR ones are available.

Bluetooth Quick Connect / Favorites Today Plugin and/or Command-line app

I'm a Desktop .Net developer with NO bluetooth experience and only a bit of low-level networking experience so I'm speaking from limited knowledge, but not complete ignorance.
I use my phone as an A2DP source and AVRCP client for quite a few devices (Jabra JX20 Pura, Jabra BT3030, Windows Vista, various BT speaker systems) and Alpine BT300) around my house, garage, car, and on the go. They all work wonderfully (some have better range than others, some better sound), but using any of them presents a couple common issues.
Some devices (like my car), constantly seek out the last paired device until they connect, while most of the other require a connection to be initiated from the phone. The phone doesn't care which is around or has the best signal, just which one successfully connects first.
I'd like an app that could have profiles setup which would let me control certain variables OR at a more basic function (see below):
Bluetooth Profile
Device Priority
Minimum Strength (to be used when more than one device has the same priority)
That would be my ultimate goal, but in the meantime I'd be happy with something as simple as a command line app that could be bound to a key or shortcut which would try to connect to a predefined list of BT MACs for a given profile and stop when the first one connects successfully. Variations on this might allow a connection attempt to a specific device instead of a list. This way I could have StartMenu or Today shortcuts.
The point here is largely to have to avoid nagivigating all the menus needed to initiate an A2DP connection, but I'm sure there are MANY other uses people would find.
If someone could point me in the right direction (I'm researching already of course) to the namespace(s) and or class(es) in .Net 2 or newer which would allow me to enumerate and/or initiate connections, this may be something I could bring to the community (assuming it doesn't already exist, and I have asked MANY times).
I've created a poll also to see what kind of interest is out there for this software and how much support I might receive.
I've been knocking an app up to suit my own personal A2DP needs... and a lot of yours by the look of things ;-) Things it does:
Kinetic scrolling finger friendly list of A2DP devices known to your phone (tap to select then tap again to attempt connection).
Toolbar buttons indicating active A2DP connection status (tap to disconnect active connection).
Bluetooth devices applet shortcut.
Switch bluetooth on (a good few of my devices need the phone to be discoverable so the app forces the phone to be discoverable at all times *blush*).
Switch bluetooth off.
Shortcut to program launcher list (automatically displays this list when you initiate a connection to a selected device... and there's items to display in the list of course).
Command line access (via secondary exe) allowing you to attempt connection (to a named , the last connected or first found device) and disconnect an active A2DP connection. I've only really tested the named device connection but the other 2 modes *should* work
QVGA / VGA and orientation aware.
I've been wanting to work towards getting it up on XDA... but time constraints (and a baby on the way ) have gotten in the way and it's unlikely I'll have the time to do it for a good while. I'd be happy to pass on the code to someone willing to take it further if that's any use. It's written (very quickly!) in VB.net BTW.
It uses a few bits and bobs from other people though:
A2DPToggle's "a2dp.exe" to handle initiating a connection.
Icons from lord only knows where I found them.
The kinetic list code found on here (http://forum.xda-developers.com/showthread.php?t=333124&highlight=klist). IIRC, I used the gingercat updated version and tweaked it to my own needs. There's many a kludge I've put in to the code to get things working quick-smart (D-Pad navigation mainly).
InTheHand 32feet.NET libraries (http://inthehand.com/content/32feet.aspx). These work with MS Bluetooth stack only.
So permission from the respective folks above would be needed before releasing it into the wild I guess.
Here's a screeny
Hey great tool! When I click a device will it auto connect or only open the BT Explorer and will it work with Broadcom BT Stack? Thanks
Oops, meant to say it's been developed for the MS bluetooth stack only. Sorry about that.
When you attempt to connect to a device it first checks the device is reachable and only then attempts to initiate an A2DP connection.
Northernmost said:
I've been knocking an app up to suit my own personal A2DP needs... and a lot of yours by the look of things ;-) Things it does:
Click to expand...
Click to collapse
Absolutely. I can get around in VB.Net and C# just fine. If you don't want to publish the code publicly, PM me your email address and I'll invite you to my Sharepoint site (easiest way I know to share files and manage communique), otherwise attach here.
It sounds like you've already covered 99% of what I was looking for, but I'd be more than happy to do what I can to more the idea forward, even taking suggestions from others in this thread.
About the BT stack, I'm running a Vogue with a ROM cooked in PPCKitchen, how do I determine which stack I'm running and can that be changed?
rainabba said:
About the BT stack, I'm running a Vogue with a ROM cooked in PPCKitchen, how do I determine which stack I'm running and can that be changed?
Click to expand...
Click to collapse
I've no idea what stack Vogues come with but the MS stack device list looks like the attachment below. If yours looks the same it's the MS one. I guess the Vogue forum should have any info on swapping stacks if it's possible.
Sounds like I found the correct people to answer my question about BT. Is there a way / how can I: enable my Mogul 6800 phone to transmit the sound that would normally go through the speaker to my BT headset in order to listen to streaming audio from the net using Kinoma Play which goes out and picks up all sorts of "radio programs" , i.e. not using a direct URL. I am also not able to listen to audio files from the Audio Recorder through anything except the speaker, even not through a head phone. Do I need to download a program or set up my phone differently. I currently have Titan WM6.1 Build 20755 GPS kitchen from PPC Geeks. Thanks so much for your help.
jminor4326 said:
Sounds like I found the correct people to answer my question about BT. Is there a way / how can I: enable my Mogul 6800 phone to transmit the sound that would normally go through the speaker to my BT headset in order to listen to streaming audio from the net using Kinoma Play which goes out and picks up all sorts of "radio programs" , i.e. not using a direct URL. I am also not able to listen to audio files from the Audio Recorder through anything except the speaker, even not through a head phone. Do I need to download a program or set up my phone differently. I currently have Titan WM6.1 Build 20755 GPS kitchen from PPC Geeks. Thanks so much for your help.
Click to expand...
Click to collapse
You need an A2DP capable device (high quality), connected, THEN start your audio program OR use a program called Audio Gateway with a basic Bluetooth headset (low quality audio).
thank you very much.
Northernmost, how about that source code? If you want to pass it along less privately than a post here, PM me and I'll provide a solution (source control, WSS, etc.)
Sent you a PM the other day. Let's go the private way for now.

(app idea) auto start/stop bluetooth in car

Maybe this idea has already been discussed but i would love my bluetooth radio to start and stop when plugged into my car charger.
I dont think the device can differentiate a normal charger or car charger. It will still have the same output! Probably a button on the screen to change to bluetooth radio will help a lot.
I had the same thought...
In the future this might be solved by using RFID
you put one of those babies in your car and the phone senses that and switched to "car mode", the same could work when you are in the office
but for now..
I was thinking of using a mortscript which checks the current time
(since I'm in the car in the morning and evening)
and the day (mon through to fri)
if all those match turn on BT, otherwise don't.
I've written an application which will run all mscr files in a certain directory every X time ( http://forum.xda-developers.com/showthread.php?t=449657)
I was planning to use it for the above.
btw. it is possible to write an application which will turn on your BT when you plug it in the charger, but that would be any changer... not just your car charger...
Of course there are several apps that are able to do this job.
For example PhoneWeaver
http://www.sbsh.net/products/windows_mobile_pocket_pc/phoneweaver
You can set a profile fired by external power on event and in this profile you can define only BT on event.
Very easy, robust and nice application for only $14.95 - works on touch diamond/pro and on my Touch HD as well.
For this purpose, I'm using BluePower (Freeware).
http://www.kixass.net/bluepower/
I already wrote the author an email for some feature requests, but didn't get an answer yet. But it still works fine (with some issues).
-Lycox
Thanks for the suggestions
I will certainly give the two suggestions a look. I have no programming experience so writing scripts is a little out of my reach but thanks anyway.
Update; The bluepower app work perfectly, does everything i need and its free..
probably you can start "toggle bluetooth link"(mortscript or whatever) the same way as repllog.exe starts when you're connected to pc.
there is an option in notifications "start when AC on". just a wild guess, i'm sure it can be easily implemented somehow.
CommManagerPro can also turn BT on/off on a schedule, as well as location-based.

Categories

Resources