Help with Bluetooth receive the string

Hello

I am trying to receive data from my paired device (BT - hyperterminal) and to treat once a carriage return is detected '\r '.

I am able to receive and display the data, but for some reason that each character is stored separately with my efforts of toString().

My code is as follows when there is incoming data:

      public void dataReceived(int length)
        {
            int len=0;

            try
            {
                // Read the data that arrived.
            if((len = _port.read(_receiveBuffer, 0, length == -1 ? _receiveBuffer.length : length)) != 0)
                {
_data.append(new String( _receiveBuffer, 0, _receiveBuffer.length));

    if(len == 1 && _receiveBuffer[0] == '\r')
                  {
    _receiveBuffer[1] = '\n';
            ++len;
       _dataReceived = _data.toString();
   _dataReceived = _dataReceived.trim();

DataProcess();
//clean up the data buffer
         _receiveBuffer = new byte[1024] ;
          _data.delete(0, _data.length());

                            }
                }

            } catch(IOException ioex)
               {
               //      Catch and re-throw the exception.
                   throw new RuntimeException(ioex.toString());
               }

First of all, DataProcess() displays the value of _dataReceived, then continues with the treatment...

When I type something in hyperterminal dialog box. DataProcess alert() returns the string in a tank instead of a row column.

T

E

S

T

instead of TEST

Any suggestions would be greatly appreciated...

Thank you

David

Curve8330 + JDE4.5 (Eclipse)

Thanks Peter.

I can now receive characters from hyperterminal.

I changed my code to:

try
            {
                // Read the data that arrived.

                if((len = _port.read())>0){

         DataReadChar = (char)len;

    _data.append(DataReadChar);             

                Dialog.alert("Data is "+_data);

                    if(DataReadChar == '\r')
                    {

                 _dataReceived = _data.toString();
                 _dataReceived = _dataReceived.trim();
                Dialog.alert("Data Received  is: "+ _dataReceived);
                    DataProcess();
                    _receiveBuffer = new byte[1024];
                    _data.delete(0, _data.length());

                    }

Tags: BlackBerry Developers

Similar Questions

  • I really need HELP! I received the nugel.exe virus on my laptop and I really missed the whole system! PLEASE HELP ME SOLVE THIS!

    I really need HELP! I received the nugel.exe virus on my laptop. I have Windows XP and I was reading how to remove it. They told me to go to click on the Start button in it, then click on run. type msconfig and on the Startup tab, uncheck everything that ends with TSSD. Well, none of which ended in TSSD was there, so I was told everything that had an UNKNOWN manufacturer in buttons SERVICES and STARTUP uncheck. I restarted my computer and the NELSON was always there.  Then suddenly my computer shut down on its own and restarted with a screen that says now "Windows didn't start because the following file is missing or corrupt: \system32\hal.dll .» Please reinstall a copy of the above file. "Does anyone know how to do this? I feel that I've dealt with the virus stupid for days and I'm going crazy! Can someone please help me solve what I did wrong? PLEASE, I BEG YOU!

    Hi ehaze64,

    Looks like you have made incorrect changes in system configuration utility.

    See the Microsoft articles below to solve the problem by installing the recovery console and use the Bootcfg.exe tool to rebuild the Boot.ini file.

    How to install and use the Recovery Console in Windows XP

    http://support.Microsoft.com/kb/307654

     

     

    Error message: "Windows did not start because of a configuration of the disk of the computer problem.

    http://support.Microsoft.com/kb/314477

     

    "Invalid Boot.ini" or "Windows did not start" error messages when you start your computer

    http://support.Microsoft.com/kb/330184

    I hope this helps!

    Halima S - Microsoft technical support.

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

  • NB100 supplied with Bluetooth and the slot for sim card

    I wonder what model come with bluetooth and the slot for sim card,.

    The NB100? Have a look at the brochures on the Toshiba site.

  • Need help with Bluetooth

    I bought a site com blue tooth adapter for my lap top post a link to my mobile PHONE and I've tried many times to install it but I can't seem to install.

    It happens with different messages but the main ones are drivers will be installed not and ability of subjects with this program.
    I have windows Vista, and my phone is a Samsung i8510. Can someone please help?

    Try the following:
    -Remove all batteries Bluetooth that are currently installed.
    -Install a Sitecom Bluetooth stack v5 or later.
    -Check the Toshiba bluetooth site HowTo section.
    http://APS2.toshiba-tro.de/Bluetooth/
    There is a document that could be useful for you call:
    «How to synchronize the mobile phone "Samsung SGH-D600" with its "PC Studio 3.0" via Bluetooth "".»

  • Need help with activation of the CC training plan

    Hey, I made a purchase order for a comprehensive cloud was created for students and teachers two weeks ago.

    1.5 week ago , made the payment but I do not have any new informations and I still can not use any application.

    Track version was released. CC cannont find my subsrciption associated with my Adobe ID

    Last email that I received said I'll be getting another within 24 hours, still no response.

    Order No. AD001694082EDPL

    Support information can not help with this problem.

    Customer support Adobe please help!

    Hi gregnawrat,

    My apologies for the delay in response.

    I just checked your account and found that you have tried to make the payment by Paypal, Paypal however rejected the transaction.

    Please check with them and place a new order, this order is not yet confirmed.

    I hope this helps!

  • Problem with regexp_substr if the string with null values between commas.

    Hi all

    My version of DB is 10.1.0.5.0
    I want to extract the string values using query below, but I am unable to provide the correct result.
    WITH t  AS ( select '123,1,3,22' col FROM DUAL
            UNION ALL
            SELECT '123,,2,1' FROM DUAL
            UNION ALL
            SELECT '5,1,2,,' FROM DUAL
            ) 
    SELECT regexp_substr(t.col,'[^,]*',1,1)
          ,regexp_substr(t.col,'[^,]*',1,2)
          ,regexp_substr(t.col,'[^,]*',1,3)
          ,regexp_substr(t.col,'[^,]*',1,4) FROM DUAL,t   ;
    My required result as below.
    123     1      3      22
    123            2       1
    5       1      2        
    Please help me to get the required result by using regular expressions.
    Thanks, Ram

    Hello

    In Oracle 10, you can do so by combining REGEXP_SUBSTR with something else like RTRIM:

    SELECT     RTRIM (REGEXP_SUBSTR (col, '[^,]*(,|$)', 1, 1), ',')     AS part_1
    ,     RTRIM (REGEXP_SUBSTR (col, '[^,]*(,|$)', 1, 2), ',')     AS part_2
    ,     RTRIM (REGEXP_SUBSTR (col, '[^,]*(,|$)', 1, 3), ',')     AS part_3
    ,     RTRIM (REGEXP_SUBSTR (col, '[^,]*(,|$)', 1, 4), ',')     AS part_4
    FROM     t
    ;
    

    Starting Oracle 11 REGEXP_SUBSTR alone can do.

    But look at the first response; regular expressions will be probably less effective than less powerful features, especially when all channels have the same number of separators.

    Published by: Frank Kulash on 29 December 2012 08:36

  • Help with Bluetooth after installing new HARD drive

    The hard drive failed on my laptop HP Pavilion dm4 3099se Beats Edition son. I replaced the hard drive, installed and activated Windows 7 64 bit (using the key supplied with the notebook windows). I used an oem Win7 disc, not the recovery disk.  Then I installed the drivers needed to make it work again. But I can't get the Bluetooth works, even if the wifi works. Use the Intel ProSet Wifi driver but the Intel ProSet Bluetooth driver returns an error when it is installed... and Bluetooth does not appear in Device Manager.

    I installed the ProSet software also. It is also an error "can not properly installed. I have not installed the HP software (which I hope it is not necessary).

    Is there than a bluetooth radios category in Device Manager?

    If so, then the generic microsoft drivers have been installed.

    Otherwise, the device is not enabled and is not being picked up by Windows.

    If you have not installed the software of HP connection manager, and who controlled the bluetooth when you reinstalled the hard drive, you need to install this software, turn on the BT using this software and go from there.

    On some HP business notebooks computers where the wizard wireless HP (predecessor to the HP Connection Manager software) controlling the wireless and bluetooth at the same time and no device showing in Windows when I reinstalled the operating system, which has happened to me.

    After installing the Wireless Assistant software, the two aircraft were then visible and I was able to install the drivers.

  • Help with fonts on the Web site

    Hi guys,.

    I'm having a little problem with a Web site, the soloution is probably very simple but cant for the life of find out me.

    Welcome to the 1st Winnington Scouts

    Please choose your topic below.

    In my code html above is under the "main" div and css for h1 is calibri fonts and it shows it in dreamweaver. Whenever I use the mode live view, or preview in the browser, or downloaded as it is now the police back to times new roman and color black.

    Below is the link to the site.

    http://winningtonscouts.hostei.com/

    Any help with this would be great

    Solved the problem

    There were some thugs in the stylesheet coding

  • help with authorization of the ADE?

    Hello

    I downloaded ON my PC and I need to allow it. Now, my computer asks me if I want to replace the AdobeID by the new. I get confused, because OF is not yet on my computer, but I don't allow my ereader with my AdobeID.

    The question is, if the email address remains the same, but password changes, I will always be able to read the books I already have on the ereader? I bought via the ereader, whereas they were not on my computer before.

    When asking you TO 'replace' means replace the anonymous account which is currently my pc or can I replace what I had before on the ereader as well? Because if I have to replace the AdobeID on my ereader as well, then I won't be able to read ebooks that I put on the ereader.

    Thanks in advance!

    Kind regards

    Denise

    Many people seems to think that the use of Digital Editions with an ereader is

    'plug and play '.  It is not because there is a good amount of technology

    lurking in the background.  No offense, Denise, but I should put a

    view around the answers to your questions.

    EPublications are consistent with the Digital Millennium Copyright Act of 2000 (DMCA

    for short), which sets out the way they are managed.  There are

    restrictions on copying and printing of ebooks and these restrictions may be

    fixed by the authors, distributors and publishers using digital rights management

    (DRM).  At the same time, as Digital Editions library management systems

    need to build these restrictions to their programs.  In addition, ereader

    manufacturers can choose some options to integrate into their equipment.

    Some ereaders can be used without their registration with the manufacturer.

    But their capacities are limited.  Some, like the Kindle and

    iPads/iPods/iPhones, are related to a certain ebookseller (Amazon or Apple).

    All PC library management systems can access ebook sources without being

    recorded.  However, as you have discovered, some will impose limits

    on you if you do not save.

    ADE - registered or not - creates a small file of ID for each ebook and that

    contains information about the user.  So, you are right in saying that, if

    you use a different ID, you won't be able to read ebooks that you

    downloaded with (or without) a different ID.

    Your ereader also contains information on registration - if you are registered

    then the ID you used is embedded in its file ID and is associated

    with all of the ebooks that are downloaded/copied on it.

    All that being said:

    ADE is flexible enough, you've discovered.  You can allow it with a

    ID and then change it when you want.  However, because of the DMCA, it won't

    allow you to read electronic books other than those to this ID.  One solution is

    the other is to set up an Adobe ID which is independent of your email

    address (you can do even if the suggested format is an e-mail

    address) and use it.  If you change your email, you do not assign your

    eBooks.  However, for the moment, whatever ID you use must match

    the one that you used to download the ebooks.

    I can't tell you exactly what to do with your ereader, but the very idea

    apply.  You must register, and using the same ID that you did for ADE

    greatly simplifies things.

    I hope this helps!

    =================

  • Need help with auto-fill the fields

    Hello

    I need help with a form that has multiple pages.  I have some areas I are duplicated in my document.  How I got these fields auto fill throughout the form/paper? For example, I'm going to fname lname, address, telephone, etc... How can I get these fields automatically on the other pages of the form?  Is this possible?  Any suggestions are welcome.

    Thank you in advance.

    If it's just a fill operation then make sure the fields have the same name. Then set the binding to the global level and all the fields with the same name will get the same value.

    Paul

  • Problems with Bluetooth on the computer.

    my laptop is having windows 8 pro but wanted devices show offline Bluetooth pls help

    Hi Bobo,

    Paired Bluetooth devices appear offline when you are looking for available devices?

    Please explain the problem more clearly so that we would be able to help you with this problem. Alternatively, you can refer to this Wiki for instructions on displaying a query with the correct information:

    http://answers.Microsoft.com/en-us/Windows/wiki/windows_other-system/effective-questions-get-help-faster/18584631-7f2b-4F01-88f5-f6660a5943c3

  • Help with error in the Code generated by the WSDL Wizard

    I have generated the code the wizard of webservice and then wrote a simple mxml file to test the code. I get this error:

    1061: call to a getClass method maybe not defined through a reference with static type class.

    It occurs in the following code:

    /**
    * Internal event handler for handling a call to success from the server
    * The result is decoded using schema settings and operation, then the
    * events transmitted the real front that the user works in the application
    * @private
    */

    private void processResult(result:Object,wrappedData:Object):void
    {
    var token: AsyncToken = wrappedData.returnToken;
    var currentOperation:WSDLOperation = wrappedData.operation;
    var decoder: SOAPDecoder = new SOAPDecoder();


    decoder.resultFormat = "object";
    decoder.ignoreWhitespace = true;
    decoder.makeObjectsBindable = true;
    decoder.wsdlOperation = currentOperation;
    decoder.schemaManager = currentOperation.schemaManager;


    var object: body = result.message.body;
    var stringResult:String = String (body);

    If (stringResult == null | stringResult == "")
    return;


    var soapResult:SOAPResult = decoder.decodeResponse (result.message.body);
    If (soapResult.isFault)
    {
    defects of the var: Array = soapResult.result in the table;

    for each (var soapFault:Fault in error)
    {
    var soapFaultEvent:FaultEvent = FaultEvent.createEvent (soapFault, token, null);
    token.dispatchEvent (soapFaultEvent);
    }
    } else {}
    result = property decoder.decodeResponse (result.message.body);


    If (result is ArrayCollection collection)
    {
    do you need to perform an upcast to specific type here
    var arrayTypedClass: Class = SchemaTypeRegistry.getClass(currentOperation.outputMessage.parts[0].type);

    result = new arrayTypedClass (result.source);
    }


    event: ResultEvent var = ResultEvent.createEvent (result, token, null);
    token.dispatchEvent (event);
    }
    }

    The statement where the error occurs is in bold above. The comment above this line says I should perform an upcast to a specific type here, but I don't know what that means. What specific type? How to determine what type of perform an upcast to?

    Any help would be appreciated.

    TIA,
    Randy

    Hi Martin,

    The error you have shown, it seems, that you have upgraded your SDK version, but not the Builder. The problem you are having is because of one of the classes (SchemaTypeRegistry) SDK has been updated static to a dynamic class. Therefore, using the call getClass() on it will not longer work. In addition, the lines that register type mappings do not work.
    We have updated the generated code, but it seems that you are using an older version. Now for the correction of your code, you should:
    1. locate all occurrences where the class of SchemaTypeRegistry is called a static class.
    2. replace the SchemaTypeRegistry by calls to SchemaTypeRegistry.getInstance () method, like this:
    SchemaTypeRegistry.registerClass (params) becomes SchemaTypeRegistry.getInstance () .registerClass (params)

    The problem is that when you re - generate the code, you will have to re - again all these changes.

    Hope this helps,
    Cristian

  • help with table in spreadsheet string

    Hello

    I need assistance to format my 2D in a string table.

    I have a 2D DBL like this chart:

    and I want it in a format string like this "0.12 0, 1 0.34, 2 0.11.

    Line 0 pass 0 0 Col 1 Row line 1 Col 0 line 1 Col 1 line 2, column 0 line 2 Col 1... and so on

    Is this feasible with 'Table to a spreadsheet string' function or do I have to use a loop for format in this way?

    Thank you

    Ritesh

    Here are 2 ways to do it without loop.

    Ben64

    EDIT: just realized, you want a comma to separate lines, and replace the tab with a comma in solution 1. (2 will not work in this case)

  • help with formatting of the accidental partition

    I had to re - start my operating system. whem I formatted the drive, I was installing on, I accidentally formatted partitions on one external drive. My question is; is it possible to pull content market back this player. or better yet, restore the partitions on this subject? I have a ton of things in it that I can't replace. any help would be greatly appreciated. and please. keep simple language please. I am a novice at this stuff. Thank you.

    There are 3 third-party programs that should be able to restore partitions or data that were on them. This might work only if you have done a quick format. Quick format just basically says "store data between points A and B", without deleting data that are there, so the data is recoverable. I don't know the names of all the programs, so maybe someone else can help you with that, but I can say until you find a do not do anything with the external hard drive because whatever it is placed on the disk will be overwriting previous data.

  • Need help with calibration of the battery

    I have a Vn7 - 591 g and it's basically old 1.

    My problem is my laptop stop without noticing low battery notification and without any warning since I updated my windows 10 November pro build.

    First, it would close down to the level of 15% without indication battery and then I looked at here and there and find the calibration procedure as I tried battery as the load calibration procedures to 100% in stop and go in safe mode and let it drain and recharge again, after the fact that now he stops at the level of battery by 30% or 25% without notice or warning.

    I tried battery reset thing pinhole also as suggested somwhere in this discussion.

    One thing I noticed when I put my laptop power in High-Performance option, low battery, that it just goes right into hibernation but when I plug in the AC adapter it shows battery 0% or 1%, and perception.

    so is it problem in my battery or Power Options or the problem is another?

    Any help will be appreciate and please answer quickly because I am sad with this problem. It is a one year old laptop around, I bought new.

    Hello

    Well, the wear level is quite high for a laptop one year old. Do you often use on the farm?

    It is interesting that hwmonitor reads the same amount as that of windows, stop so suddenly, because of the battery not calibrated... I don't think so. It may be the case even if the PCI that controls the battery charging does not correctly read the State. That would mean that you would need to change the battery (the peak is on the battery).

    You can try to run battery Eater: http://www.softpedia.com/get/System/OS-Enhancements/Battery-Eater-Pro.shtml

    This software will monitor your battery while meeting and then make a graph of it after a reboot. I don't remember if trace the graph based on the percentage, or the actual capacity of the battery.

    You can read more about what the software did here:

    http://Lifehacker.com/5657275/battery-Eater-benchmarks-your-batterys-capacity-so-you-know-what-to-ex...

    Also, would probably be a good idea to see if what happens on another operating system as well. For example, you can try to make a USB boot Linux, ubuntu and check if your laptop suddenly stops at the same percentage values. If it is not the case, which is probably something just with windows.

Maybe you are looking for

  • Photosmart HP 5520: HP a m9 vs HP Photosmart 5520

    When I try and print/piece attached to my M9 a HTC wireless on my HP Photosmart 5520 I get an error message saying that the "print spooler has stopped." Then I get a message saying "this printer is not available right now. I can print pictures from m

  • I1400 hard drive

  • Reminders and calendar alerts have stopped

    Ive suddenly stopped to receive emails with my calendar alerts and reminders, I tried to use a different calendar, but no reminder is sent

  • mcsrchph.log - what is this massive file?

    Hi all I have this file, almost a gigabyte in size, to the \program data\microsoft\ehome\logs I suspect it's something to do with the media center.  If this is really a journal, it is a newspaper of? Why is he so great? Thanks for any info.

  • Problem with remote desktop in Windows 7 Home Premium

    I have two laptops running Windows 7 Edition Home Premium.  I do a simple administration of a 2008 R2 remote server, for a friend and all of a sudden, remote desktop will not connect to the server on one of the laptops. I checked all the settings, of