extra bytes when reading _dataReceived bluetooth...

I'll send a byte stream via a Bluetooth for blackberry.

I then take the substrings from the received data.

For some reason, I get 3 additional bytes of data from a location...

I installed a dialog.alert which shows the flow of data properly after its receipt by the method dataReceived (int length).

Flow is sent:

'STA152535455565 '.

Dialog.Alert (_dataReceived); equal to STA152535455565

This is where it gets weird:

_lblS1.SetText (_dataReceived.substring (2, 4)); Returns: ST should be 15

_lblS2.SetText (_dataReceived.substring (4, 6)); Returns: A1 must be 25

etc...

When I change the substring (2.4) to substring (5.7) turns 15

Any ideas?

Thank you!

David

Curve8300 + JDE4.5 (Eclipse)

An additional empty space may be added to the begin and can also be added at the end of the reception of data. I don't know the reason.

But I think that in this case, it would be more appropriate to use:

_dataReceived = _dataReceived.trim ();

Concerning

Bika

Tags: BlackBerry Developers

Similar Questions

  • Visa erroneous zero byte in reading series

    Hi all

    Trying to debug a problem that I have with a Labview2011 VI and the USB-485/2 device.

    The installer has been simplified to get the wire from port 1 to port 2 in a 2wire-auto configuration. As described here:
    http://digital.NI.com/public.nsf/allkb/D5CC369B3E3E6F0586256D1600563245

    and here:
    https://decibel.NI.com/content/docs/doc-4169

    Port 1 sends a message of 8 bytes by using visa / writing then begins a visa-reading of 8 bytes. (timed content in a loop of 10 Hz)

    Port 2 is configured in a single loop using the wait for event visa byte, then visa-read 8 bytes, connected directly to visa / entry.

    For 1 Port data transmitted, the data received and read visa error code are recorded on the disc.

    The success of installation passes are receives data without loss... so the back loop work...

    However! Occasionally, another zero byte is read from visa-reading the port1.

    Almost all the code read visa back operations "1073676294" port 1 (the number of bytes transferred is equal to the number of entries requested. More data may be available) which is very good. Even if sometimes the error code '0' is back (operation completed successfully). This "0" code seems to be associated with the extra byte in the receiver.

    This causes a problem because it throws the mismatch scheduled application command/response pairs.

    I tried many tariffs buad, visa-read timeouts and transmit frequencies, the problem remains. Adding a visa-flush buffer prevents the error from reproducing, but won't stop him intervened and upsetting the logic of command/response.

    Any ideas would be appreciated.

    If you send real binary data (which it looks like you are), you should have the off stop character.  Remember that reading VISA will be completed when the FIRST of the following: the desired number of characters is read, the character of endpoint found, there is a timeout.  So if there's a 0xA in your data, which will stop the read before that you would like it.

  • TCP read bytes to read

    Hello! I have a small question on ports TCP read palett in labview, im trying to send 1 bit from a server to a client. This works when I put 4 digital in the bytes to read TCP entry read client-side. But when I change the value to 1, as it should be efficiant, this work dosent. Any ideas?

    Your number of bytes value is a number of I32 (32 bits, or 4 bytes), so you send 4 bytes followed by 1 byte for the boolean itself.   You can convert the number of bytes in an I8 to make a byte (but I wouldn't bother because the IP header information is the number of bytes, which means 1 to 4 bytes means little).

  • b and characters appear when reading from a text file

    The image shown vi opens a text file from hard drive with ' Open/create/replace the file' and 'reading a spreadsheet file.

    Then the vi displays the text in the respective indicators.

    In these two indicators, there is a y and b that appear as the first characters.

    It's not exactly a y and b. Two points above him there and the stem of the b blocks down, a script not anglophones.

    In Word and Notepad these characters appear. The first character is a zero, as I wrote it originally.

    The text file was initially created in Excel and then saved as a unicode text.

    Where are these funky letters? and how do I get them to leave?

    Also, it seems that the text of these two indicators add a blank line after each line. That does not appear Notepad or Word either.

    Carmen92126 wrote:

    The text file was initially created in Excel and then saved as a unicode text.

    There's your problem: unicode.  You can see this quick phone: Config file "byte order mark"

    Yes, by saving in Unicode format, you have a few extra bytes that know most of the text editor to ignore.  But LabVIEW gives you just the raw data.

  • How can I increase the font size when reading an email?

    HOW CAN I GET MY FONTS TO BE MORE IMPORTANT WHEN READING AN EMAIL WITHOUT THE SCROLLBAR AT THE BOTTOM OF THE SCREEN AT?

    original title: need help quickly please

    If you mean you want phrases to wrap so that they remain in the window so you don't have to scroll from left to right, I don't know that you can do.  It depends on what type of window you are viewing in and how the window is configured with the software to behave.  So if you can tell which allows you to view your email we can probably answer the question definitively, but I suspect, there is not that you can do anything except expand from one side to the other if you can.

    Steve

  • Extra characters when you write table 2D in the worksheet

    I try to write 2D data in a spreadsheet file, but I'm getting extra characters at the beginning of the file. I only get extra characters when I have a user selected file to write data. If I let LabVIEW to create the file, then there is no additional characters in the file. I created a VI that shows the problem I encounter.

    Am I missing something, or LabVIEW puts these characters there for a reason?

    Thank you!

    -Andrew

    If I create an empty file in Excel 2010 and save as .csv, I have no problem. I have run your VI and I have 3 rows, the first is empty because the file has already been created.

    If I create an empty file and save it as .xlsx, then go into windows Explorer and change the .csv extension, I get output similar to yours. It seems that when you create the file before you run your VI you could attach the .csv extensions to something that isn't actually a .csv.

  • I use Director and I got about 100 picture in my project and I want to bring up more time on the screen when reading it.

    I use Director and I got about 100 picture in my project and I want to bring up more time on the screen when reading it. I know you can do induvdually but I was wondering if there was a way to select all and then make the longer time for each of them. Help, please!

    original title: NEED HELP Please REPLY as soon as POSSIBLE. Windows movie maker question

    Hello

    My friend John Papa - MVP - is the expert on Windows Movie Maker.

    PapaJohn.org
    http://Papajohn.org/

    PapaJohn - online tutorials
    http://www.Papajohn.org/mm2-online-tutorials.html

    Windows Movie Maker Tutorials - check the sounds of the addition in the left menu and others on the
    main screen.
    http://www.windowsmoviemakers.NET/tutorials/

    Windows Live Movie Maker help & how-to and Forums are good sources of information:

    Windows Essential - Movie Maker help
    http://Windows.Microsoft.com/en-us/Windows-Live/Essentials-Help-Center?T1=T3

    Answers - Windows Essentials - Microsoft Windows Movie Maker Forums
    http://answers.Microsoft.com/en-us/windowslive/Forum/MovieMaker?tab=threads
    ====================

    These might help:

    Getting started with Windows Movie Maker

    Import video, photos and audio on Windows Movie Maker

    Import video from a videotape

    Get a movie in Windows Movie Maker

    Make a movie quickly in Windows Movie Maker (AutoMovie)

    Publish a movie in Windows Movie Maker

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • DRAC5 "Error when reading the SSL socket connection"?

    Hello

    I have a BIOS of PowerEdge 1950 2.7.0 with DRAC 5 Firmware Version 1.65 (12.08.16).

    When you try to connect to 'Console' I get the error "Error when reading the SSL socket connection".

    I spoke the line "# jdk.tls.disabledAlgorithms = SSLv3, RC4, MD5withRSA, DH keySize.< 768"="" at java.security="" file="" but="" still="" the="">

    I use WIndows 10 with the latest FireFox.

    Thanks in advance,

    Asaf

    I found that these changes were necessary to connect to the DRAC 5 using Chrome and Java 8, rev card. 91:

    In Control Panel > Java > Security:

    1. check "Enable content of java in the browser.

    2. set the security level to "High".

    3. Add each DRAC IP to the list of exceptions

    In C:\Program Files (x86)\Java\jre1.8.0_91\lib\security\java.security):

    Remove MD5:

    jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
    

    Remove SSLv3, RC4 and MD5withRSA:

    jdk.tls.disabledAlgorithms=DH keySize < 768
    
  • Error when trying to play multimedia file: Windows Media Player has encountered a problem when reading this file.

    Windows media player

    I get the message "windows media player has encountered a problem when reading this file", and in the media player screen, he says 'changing media '.  What does all this mean?

    Hello

    1. when the question is is produced?
    2. don't you make changes to your machine before the problem?
    3. What is the format of the file you are trying to play?
    4. you play a file from a CD or DVD, or from the hard drive?

    I suggest that you follow the steps mentioned below and check to see if they help.

    Step 1:

    Open the troubleshooter in Windows Media Player settings and check if the problem persists.

    Step 2:

    Check if the file you are trying to play requires no codecs.

    Codecs: Frequently asked questions

    Step 3:

    Uninstall and reinstall Windows Media Player:

    A.
    a go to start and in the search type 'Turn Windows has or not'.
    b. click on "Turn Windows features on or off".
    c. find multimedia and uncheck the brand in the face of Windows Media Player.
    d. restart the computer
     
    B.
    Reinstall Windows Media Player:

    a. go to start and in the search type 'Turn Windows has or not'.
    b click on "Turn Windows features on or off".
    c. find the multimedia functions and place a check mark in front of the Windows Media Player.
    d. restart the computer.

  • Burned using Windows DVD maker photos are blurred when read

    Pictures inserted in creation of DVD of Windows7 and burned to a DVD disc are dimmed when read on television via a DVD or Power DVD on the PC drive (origonal photos are sharp)

    No problem with ULEAD DVD Movie Factory

    Hi Barry Robbo.

    1 when was the last time you were able to play a DVD burned successfully?

    2. did you of recent changes on the computer?

    3. What is the file format of the burned photos?

    4. which Windows Player do you use to play the burned photos?

    A DVD may not play properly in some DVD players or DVD - ROM readers to one of the following reasons:

    • The type of drive may not be compatible. Some DVD players or DVD - ROM drives can play some types of DVD. For example, some DVD players only play discs DVD + R or DVD + RW, while others play only DVD-R or DVD - RW discs.
    • The quality of the disc may be too low. Some DVD players or DVD - ROM drives will not play DVD if the disc is not in good condition or if it isn't a high quality disc. If your Player cannot play a DVD, you can try to burn again using a higher quality DVD.
    • DVD decoding software can not be installed on the computer. If you try to play the DVD in the DVD drive on another computer, the DVD will not play if DVD decoding software is not installed on this computer.

    To determine what types of DVDs your DVD player or DVD - ROM drive can play, see the documentation that came with your device or go to the manufacturer's Web site.

    Solve problems with creating a DVD-video using Windows DVD creation

    http://Windows.Microsoft.com/en-us/Windows7/troubleshoot-problems-with-creating-a-DVD-video-using-Windows-DVD-Maker

    Method 1

    First of all, I suggest that you try to view the pictures burned using the Windows Photo Viewer.

    1. open the photo library by clicking the Start button, click photos.

    2. in the photo library, open the folder that contains the picture that you want to view and then click on the image.

    3. on the toolbar, click the arrow next to Preview, and then Windows Photo Viewer.

    View and use your pictures in Windows Photo Viewer

    http://Windows.Microsoft.com/en-us/Windows7/view-and-use-your-pictures-in-Windows-Photo-Viewer

    Method 2

    If you are facing a similar problem in sight the pictures burned in Windows Photo Viewer, then uninstall any ligthscribe third-party burning software installed on the computer and then try to view.

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I can't get my LR to open without this message: "Lightroom has encountered an error when reading the preview cache and need to quit."

    Lightroom has encountered an error when reading the preview cache and needs to stop smoking.  Help, please

    Hi crystalc,

    It seems that the preview cache has become corrupted.

    You must go to the location where your catalog is stored via finder/File Explorer and get rid of the file ending with Previews.lrdata (not .lrcat)

    Default location of the catalog is under Pictures\Lightroom

  • Trying to open the message box appears 'lightroom has encountered an error when reading the preview cache and needs to stop smoking' Lightroom "Lightroom will try to solve this problem, the next time that it launches" OK when you press closed Lightroom an

    Trying to open 5 Lightroom, a message appears 'Lightroom has encountered an error when reading the preview cache and needs to quit' "Lightroom will attempt to solve this problem, the next time he throws" when OK key Lightroom quit unexpectedly and the computer returns to the office.  This persisted for 2 days and it has not set itself.  help please.

    Click OK close Lightroom.

    You must manually go to the location of your Lightroom by Finder catalogue / file Explorer and get rid of the Previews.lrdata folder

    By default, the location would be in Pictures\Lightroom folder

  • I get a message saying Lightroom met an erorr when reading the preview cache and need to stop smoking. Then told that Lightroom will try to resolve thei problem the next time it starts. Never does. Tried to uninstall and reinstall but no good.

    I get a message saying Lightroom met an erorr when reading the preview cache and need to stop smoking. Then told that Lightroom will try to solve the problem the next time it starts. Never tried to uninstall and reinstall but no good.

    Sound familiar to anyone?

    Hello

    Please go to the save location of the Lightroom Catalog and here please delete the Lightroom Catalog Previews.lrdata folder.

    Now please open Lightroom and check if it works.

    Please let us know if it helps.

    Kind regards

    Tanuj Sandal

  • Lightroom has to close immediately after splash because it encountered an error when reading the preview cache

    does anyone have a solution to this problem?

    Lightroom has to close immediately after splash because it encountered an error when reading the preview cache

    Frustrated

    You must remove this file previews.lrdata. It won't do any harm, and it does not solve the problem.

  • Premiere Pro CC 2015 errors when reading a multicamera editing.

    Premiere Pro CC 2015 errors when reading a multicamera editing.

    Running on Mac.

    Started editing images mult-camera and falls down for only when you try to play the scenario of several camera. Other chronologies play without issue.

    Any ideas?

    It turns out that this is a bug with CC2015 in multi-camera. Adobe is working on fix of course.

Maybe you are looking for