How do I suspend the application to wait for response from BluetoothSerialPort
I worked on that for too many days without much progress, so hopefully for more help. For this application, I started with one of the examples BluetoothSerialPort programs. I've added a couple more screens so that I can display different information and send data via bluetooth connection. I built a Board that has a bluetooth module and a microproccessor to talk to a car via a network BOX. I am able to send to and receive messages from the network at this point. Currently, I try to get a RealTimeData screen to send messages CAN and then analyze the messages returned from the CAN. I'm sure there are much better ways to do this, but I'm new on this.
Current issue: get the program to pause in order to wait for a response from the from the network.
public void updateData(){ String _dataString; if(_port != null){ _data.delete(0, _data.length()); sendCANMessage("7DF","8",false,"02","01","05","00","00","00","00","00"); //pause(2000); Dialog.alert("before _data.toString()"); _dataString = _data.toString(); int indexOfRx = _dataString.indexOf("RX "); coolentTemp = Integer.parseInt(_dataString.substring(indexOfRx+43,indexOfRx+45),16); coolentTemp = (((coolentTemp-40)*9)/5)+32;//subtract 40 then convert to F. efCoolentTemp.setText(coolentTemp + " F"); } public void pause(int ms) { try { Thread.sleep(ms); } catch (InterruptedException ie){ //do something } }
The break (2000) (which is commented out in the code example above) does not work. So far I was able to make it work by the Dialog.alert in there, because it seems to stop the function so that the data can be returned. The break is so long because I manually hit the Send button while I test. If I use the alert dialog boxes I can get to work analysis. When I use the pause() function, it seems to stop running, but in the wrong place. He pauses before the sendCANMessage function.
Any ideas? Examples of code would be very useful. I use Eclipse w / plugin. I'd be happy to send the exported project if anyone is willing to look at.
Hi and welcome to the forums.
How do you run that? You should not run the activity like this on the thread of events, but I suspect that since you can issue a Dialog.alert, you actually do.
Also, since we do not know what sendCANMessage (.) did, it's a little difficult, of course what happens. But I would certainly start by ensuring that you are not running on the thread of events.
Tags: BlackBerry Developers
Similar Questions
-
How can I get the vi to wait for the user to select a COM port?
It is a problem when I run the application. If the selected COM port is not currently connected to the material, then I get an error. I can then select the COM port, rerun the application and everything is fine. But I want the application to run when it is called by the user and wait until the correct COM port is selected. I'll settle for any COM port selection and put the responsibility for the adequate selection on the user. Thank you all.
Of course. It works fine now. Thanks MikeS81!
-
black clock and found Web site, waiting for response
I am a tech support consultant, have more than 30 years in the it industry and this is the first problem, I was not able to solve, eventually. I have a sound system, I'm sure that it is clean but still encounter a problem that is often discussed on the net but never resolved tne.
Version of Vista-home. If I'm connected wireless or wired, browsers stop working. It works sometimes for hours before failure and other times, as soon as I switch on / log. Internet connection information indicates everything is OK, but the little black clock on the status bar of the IE browser appear with the text "site found, waiting for response. The only solution is to reboot - and you never know how long that will last either.
One thing I've discovered recently: I started using FireFox... and it crashes saying simply 'arrested' on the status bar. I can close Firefox, switch to IE and continue browsing for awhile until he gets the black clock and the site found, waiting for response.
I have NO IDEA what section to post this in... the only thing I have not tweaked in my Vista system is the "running, stopped or other Services.
Dell XPS m1330 is based on what I saw in other forums, that has nothing to do with it. Help, please!
Thanks - in advance for your answer.
MrsDThompson
http://www.Knoppix.NET MS - MVP - Elephant Boy computers - don't panic!
-
How can I remove the application dropbox to my Imac?
iMAC 21.5 Inc.
OXS X El capitan
10.11.3 Versie
How can I remove the application dropbox to my Imac?
I get a warning when I click on the dropbox app to delete!
Thank you very much
ollylibby
Official instructions are here-> https://www.dropbox.com/help/41
It helps tremendously if you actually post the text of the error message that you receive.
You may need to view the activity monitor, search for dropbox and stop all processes before removing the Dropbox app in the folder/Applications.
-
How to check what Qt application is run for the first time?
How to check what Qt application is run for the first time? I need for the creation of trial version of my application. Any help is greatly appreciated
Probably use file data and put an I_ran_at_least_one_time file and verify its existence. This file is not accessible to the user and is not changed even if you upgrade the application.
-
How do you open the application you downloaded? / Como abro app as de?
Hello! I downloaded a program to edit videos, but how do you open the application you downloaded?
Hola! It has descargado a programa en application pero como lo ahmed? solo of "Actualizado.
Please refer to launch Adobe Creative Cloud apps
Concerning
Hervé Khare
-
Trying to download my creative cloud, but get a constant rotation in the window. Not sure how to display all the applications that I'm supposed to have with the creative cloud?
Please visit: App does not open. Wheel of progress turn continuously
I hope this helps.
Concerning
Megha Rawat
-
InDesign cs6 still not compatible with the iMac 5K, his frustration that adobe is not fixing this issue! Perhaps a strategy to move to Adobe CC? I have urgent need to know how can I run the application correctly.
It will never be updated for InDesign CS6. This has been discussed to death. Adobe updated the CS6 applications that she could update. Illustrator and Photoshop come to mind, so your conspiracy theory is incorrect.
InDesign should be re-written from scratch due to the difference in the way it was designed.
Your choice is to live with it or move to creative cloud.
-
How to return to the earlier version of El Capitan (from 10.11.3 at 10.11.1) with Time Machine? My HP LaserJet M475dw MFP printer worked fine with previous versions, but fails miserably to recognize the device on the same Wi - fi network now with 10.11.3. I would like to restore the previous version of the operating system without losing any data created in various applications since the 10.11.1. Fortunately, I had only to use Time Machine is rare over the years, I do not know if you have to return the entire drive to the chosen date or it can somehow just go back to a previous state of OS. Any suggestions, much appreciated.
-
Work with labview ARM and it was working fine this morning. I went to run a program and the build failed with the following message.
[13: 34:50] status: error
An unexpected error has occurred.[Source: the timeout of waiting for an answer]
Internal error UVSC
Detail: [UVSC_PRJ_LOAD, MSG: 0x1000, STATUS:]
[0x1] code: 1]Did normal things as restart the computer. Plug and unplug the Board of Directors of the computer.
I tried to reinstall the whole arm labview and it does not work.
Even from labview so you go to tools > ARM > show keil does not work either. I can open keil in itself, but it doesn't seem to be communicating with labview.
Figured it out. Somehow the projects I was working on has been corrupted somehow. After another reinstalled, I opened a sample project, not one of the many that are mine, and it worked. I had copy and past the code on the project and in a new, but it works. Don't know how my projects I screwed up in the middle of work on them.
Now, back to actually do the work.
-
How can I get the update to cc for lightroom
How can I get the update to cc for lightroom
Sign out and sign back for the desktop CC app: connect, disconnect | Creative desktop application Cloud
You'll see Lightroom CC (2015) under the section "Find new applications" of the CC desktop application.
See you soon!
~ David
-
How can I download the Apple News app for my iMac
Hello
How can I download the Apple News app for my iMac, I have on my iPad but can't find it for the Mac, is it not available on Mac or he has another name for the iMac?
Thank you
There is no version for OSX.
-
How can I down the msn toolbar support for Mozilla firefox?
My computer crashed and lost the msn toolbar. How can I down the msn toolbar support for Mozilla firefox? Edit
It was more common to ask how to uninstall these toolbars. I think that it will now be known as a Bing toolbar, but as much as I know it is no longer supported for Firefox. You can find a few unofficial addons with similar features.
You'd better discuss what anyone more about MSN Forum MSN specialist.
-
How can I get the six digit code for my iPad Pro? I have two other iPads and an iPod but I get the codes I get and the Pro is just disabled for longer and longer whenever he rejects these codes!
-
How can I track the progress of download (for update Iphone via iTunes)?
How can I track the progress of download (for update IPhone via iTunes)?
To the right of your account towards the top right of the program name, you'll see a mobile circular icon. Click on that and you will get a dialog box indicating the progress.
Maybe you are looking for
-
Dropped my iphone 6 in water, just the apple logo appears
I dropped my iphone in the water two days back... I tried to turn off immediately, things would turn itself after a few seconds... I let it run out of battery, and finally he was out... I let it dry... Tried to remove the water forms all grooves... I
-
<; textarea >; display line with new car
I am creating a page aspx with a text box and a button. The text box is created like this: If the text is longer than 30 characters long, the text will scroll but remain in a line and the user cannot see all of the text that he hit. I would like that
-
Select the audio recording device
I have inspiron 1501 (a new replacement), with 32-bit amd anthlon, windows vista OS. My micro phone volume was very low, the person on the voice chat could not hear it. I tried to make it work properly, by mistake, I disabled the device for registrat
-
ACS - ASA authorization and accounting
Hello I have a few questions about the authorization and accounting on the ASA via an ACS server When I activate the command 'aaa authorization command' users of SSH commands I get locked on console then I have to configure the console, telnet and al
-
Windows XP Pro does not connect to a 6500 printer (ethernet only)
I have the printer doesn't work for Windows 7, Ubuntu 10 and Mint 10 but after you run the HP Wizard on the XP machine, it will not see printer. I tried to connect via printer IP and host name using the tip box. I can ping the address of the printer