Problem reading data via the Bluetooth Serial Port

My request is meant to connect with a PC via Bluetooth.

The PC runs a simple server that reads a string from the BlackBerry UTF and writes a UTF string in response.

DataInputStream istream = connection.openDataInputStream();DataOutputStream ostream = connection.openDataOutputStream();

System.out.print(istream.readUTF());

ostream.writeUTF("Hello client");ostream.flush();

ostream.close();istream.close();

The sound written BlackBerry pin and reads the answer.

DataInputStream istream = connection.openDataInputStream();        DataOutputStream ostream = connection.openDataOutputStream();ostream.writeUTF(Integer.toString(DeviceInfo.getDeviceId(), 16));ostream.flush();

_rtf.insert(istream.readUTF());

ostream.close();istream.close();

The server reads and prints the PIN successfully, but the client raise EOFException at readUTF().

What could be wrong?

Solved. The server side must not empty its output stream.

Tags: BlackBerry Developers

Similar Questions

  • Close the Bluetooth Serial Port

    If anyone can offer advice regarding some serial Bluetooth using VISA ports near the fence.

    I establish a session series Bluetooth using the Bluetooth Radio software, then move to LabVIEW to control my device via Bluetooth - no problem.

    When I want to stop the connection, I use the command close the visa. When you use the WIDCOMM drivers, the Bluetooth connection is cut using this application.

    However, when I use a device that works the Bluesoleil drivers, the port is left open after the execution of the order closing the visa (and the command does not return an error).

    Everyone knows this?

    Thank you

    SSK

    Hi Ssk,

    I have looked into this for you and have been unable to find a prior occurrence of this behavior, many people have used this driver with LabVIEW without this problem.

    If all goes well a little more information can narrow down the cause.

    Can I ask:

    You use what version of LabVIEW.

    Have you tried several devices that use the Bluesoleil driver?  The behavior is repeatable with each of them?

    Have which devices you tested?

    What driver version are you using?  Have you tried to improve this?

    Thank you

    John

  • Wire bachground for Bluetooth Serial Port Communication

    Hello

    I want to make a request which should be as a background thread to run after that BB has been activated.

    I tried something:

    1. I used BluetoothSerialPortListener and as a normal application. After I chose the menuitem, it begins to listen to the bluetooth serial port. When the data are arrived through the port, it extracts the data and write a response to the sender. Then he out the value and display it on the screen, where I used an object of class screen. But, after posting a value, it cannot display the value came second. I tried, what the old screen pop fist, then puschup the new screen. But it does not work. How can do it, when the new value, they can be diaplayed on the screen?

    2. then I did the BluetoothSerialPortListener in thread and used the autostart flag such as:

    Public Shared Sub main (String [] args)
    {
    If (args! = null & args.length > 0)
    {
    if(args[0].) Equals ("autostartup"))
    {
    Starting the device we want to start the thread SycareBluetoothPortListener
                 
    sycare_synergy ss = new sycare_synergy();
    }
    }

    This time around the Listner should take only data is arrived and then sends a response to the sender. But after downloading, BB has always shown that he was unable to generate a new object of the thread class and the thread could not be started.

    Someone tell me, how can I fix it and make it possible, that after each new start of the BB, the bluetooth serial port can always in the background arrivals data receive and display automated according the data arrived?

    Thank you in advanced and Merry chiristmas!

    Monternet

    1. update the user interface.

    It is possible that you are trying to do.  In fact, you don't need to replace the screen, you should be able to simply update a field on the current display of data.  As an example of a background thread to update the user interface, please see the code of httpdemo.

    2. Thread context

    When you say things like:

    "that he could not generate a new object of the thread class.

    It would be much better if you can cite exactly what makes the Blackberry.  In this case, I assume that it has generated an Exception, so the Exception and the associated detailed message that Exception must be included when you report a problem like this.

    In any case, it is possible to implement a background task in the way you need.  Search the Knowlegebase for articles that talk about background Applications and display updates to the user interface of the task in the background and auto-start applications.  There are a few pieces of confusion to this process, so there are a few to get your head around, but I think that everything is in the articles.

  • Having problem of PCI and PCI communication serial port

    Hello guys,.

    I have a problem with my serial port PCI and PCI communication, I use Windows 7 64 bit found no solution please help about this and I am very happy to thank

    B.Regards,

    Hussain SF

    Hi Hussain SF,

    Thanks for posting your query on the Microsoft Community.

    I imagine the inconvenience that you are experiencing and will certainly help you in the right direction to solve the problem. However, I would be grateful if you could answer a few questions to refine the question in order to provide you with better assistance.

    1. You get no matter what error code/message when connecting to the serial port PCI?
    2. What is the brand and model of the computer/motherboard?
    3. What card has been inserted in the PCI slot?

    PCI stands for Peripheral Component Interconnect. It's an industry standard bus to connect devices to a computer.

    A serial port is a serial communication physical through transfers of information inside or outside a bit at a time. The term "serial port" usually identifies hardware more or less conforms to the RS-232 standard, designed to interface with a modem or a similar communication device. The serial port used to be widely used to connect to a variety of devices external and is essentially a two-way communication port. There are still devices using a serial port connection. These are often marked as RS232 and would include devices such as TELEVISION receiver cable boxes.

    The PCI of Simple Communications controller is a generic label given by Windows for PCI cards installed in a PC when the drivers for the device are not installed.

    You probably received this error because you have not installed the driver for your PCI device.

    If your computer came with a motherboard driver disc, put the CD in and install the chipset drivers from Device Manager browse the CD. This would update the drivers for those devices.

    Steps to follow:

    a. right click on the entry in the Device Manager and select Properties.

    b. in the driver tab updated some drivers.

    c. Select Browse my computer for driver software.

    d. click on browse and look for DVD player option.

    e. follow the instructions on the screen and restart the computer after installing the drivers.

    If you don't have the motherboard drivers CD then please download and install the drivers for the chipset of the manufacturer's Web site and see if it helps.

    Get back to us with all the information and results of proposed suggestion. We will be happy to help you.

    Kind regards

  • How to periodically send various types of data via the Serial Port?

    Hello! Everyone

    I have to send data to LabVIEW to my device on the Serial Port.

    I know how to send data on serial port in LABVIEW, I already have this part.

    Now the problem is that I have several types of data I need to question my embedded device, if I want to send the query periodically command.

    So lets say that my four Op Codes are the following, which will send four different types of query command to my device on the serial port.

    (To be honest only OP_LED and OP_SENSOR is used now)

    0, OP_SYNC

    1, OP_LED

    2, OP_SENSOR

    3, OP_FUTURE

    Structure of basic package is as follows:

    Header (0x2C), Checksum, length of the data (n bytes), Op_Code (1 byte), length (length of Code + data Op)

    For OP_LED, I need to send the package as follows:

    0x2c 0x02 0x01 0 x 00 0x2F (0x2F being the XOR checksum) (calculation of Checksum part is done and SUB Vi form)

    Length of the package this is 0x02

    0x01 is Op Code for OP_LED

    In the same way

    For OP_SENSORi need to send the package as follows:

    0x2c 0x03 0x02 0x00 0 x 00 0x2D (0x2D being the XOR checksum) (calculation of Checksum part is done and SUB Vi form)

    0x03 is length of packet here

    0x02 is Op Code for OP_SENSOR

    So, how can I do this periodically in labview, in such sort that period can be adjusted whenever necessary.

    Is there something in LabVIEW to do.

    I had done the reception and decoding part and working properly.

    http://forums.NI.com/T5/LabVIEW/store-data-coming-from-serial-port-in-buffer-and-then-take/m-p/32722...

    So I must implement read and write the part of same while loop?

    Do not insert in the table if you put data in an array at index 0.  Just use array to build.

    No need to have Visa to write don't be a part of wire to the wire of reference and error VISA go in the upper part.  These wires should go THROUGH the entry VISA.

    Don't your checksum requires all the bytes up through data?  Righ now, you only put the checksum on data bytes and forget the opcode and length bytes.

    Your sending is not the opcode for Opsync or Opfuture.  You just send the empty tables.  At the same time for the other two, you put the opcode in the data table.  All your original opcode in the table build thread.  Get the data out of these structures in case item which is supposed to represent the opcode.

    xpress_embedo wrote:

    Now it works but I have now two problems.

    (1) OP_SYNC and OP_FUTURE do not data, but still receive its data on serial port, can I do something here as I have nothing when the table is empty in the structure of the case.

    I do not understand this statement.  Perhaps my answer above will fix any issue you have here.

    (2) how can selection operation Code to be send is done using control façade but real application, this task should be automated to a certain frequency, like OP_LED package must go out to the serial port to 100msec and packet OP_SENSOR must go out to 1000msec, I do this.

    Now you agree a little more architecture.  I would encapsulate the code that is in the while loop as a Subvi.  Then with the hand of your program while loop, use two time Express VI, a game for 100 msec, the other for 1000 msec.  When an express VI is true, run the Subvi with a command set waiting for the answer.  When the other VI Express is true, have it run the Subvi with the other set of commands.

    The device responds with anything when you send these commands?  You only send data.  I see no VISA Read to be able to recover all the data.

  • Send and receive data via the Ethernet Port?

    Hello

    I am trying to acquire details of LAN/Ethernet from the PC through LabVIEW.Like details, we get the date & time, etc Serial Port system, is it possible to get the details of my PC via LabVIEW.My LAN aims to sebd and Receive via Ethernet Port command.

    The last time I did it, I used the range of tcp. (I go ctrl + space for quick menu then type tcp). Open a connection to the network device, and then use tcp read/write, depending on the case. There are examples that can be very useful

  • Bluetooth Serial Port (SPP) on the XOOM profile

    Does anyone has experiences using devices to profile serial port with the XOOM?

    We try to get our through SPP Bluetooth barcode scanner and we had a few problems with the matching.

    We are able to pair our device with the XOOM did very well (using Bluetooth 2.1 Secure Simple pairing (SPP)), however, when we try to open a serial port (RFComm channel), the XOOM is trying to make an increased level of security and enforce Bluetooth man in the middle (MITM) protection.  The problem is that our device does not have ANY screen or buttons that would allow a user to enter the PIN code!

    Anyone tried the "non - ui" SPP BT 2.1 devices with the XOOM?  Such as barcode scanners or GPS units?

    We "got around" this by having our 'claim' device, the pin code has been entered correctly, but this is really just a hack.

    Thanks for any comments.

    Len

    We have solved this problem by using a new call API 2.3 and higher to specifically ask for a link "unauthenticated."

    Socket CHS Series software now fully supports Android 2.3 and features honeycomb (3.x).

    Kind regards

    Len Ott

    Socket Mobile

  • Problem after connecting via the USB port of the printer. Error 0x0000007a

    Recently, I plugged my HP Deskjet2360 printer via the USB port on my HP laptop (running w7 Home premium 32-bit) and can not print at all. When I try to print a test page I get the following message ' operation could not be completed. Error 0x0000007a. Operation failed.

    My usual Setup is to have my printer connected to my desktop (Windows XP Pro). My HP laptop is connected via a wireless connection to my home network, which is also connected to my desktop computer. Of course, this means that I have the office turned on to be able to print from my laptop.

    Everything worked great until I decided I'd rather have my connected printer to directly to my laptop via USB.

    When I connect the printer via the USB port on my laptop, windows installs the software and reported no problems. Yet when I try to print a test page, I get the mentioned error. When I then reconnect the printer to the desktop and try to print a test page to my network, I get exactly the same error message. The office and the printer still work fine, it's just that I can't print from my laptop.

    I uninstalled and reinstalled the printer on my laptop with the USB connection and the network, but it still does not work. The resolution of the problems on the laptop reported no problems, and the printer is set as default printer. I also get an another error msg when I click on the Preferences button in the printer properties: address of the 0x5aeba4f1 function caused a protection fault. (code 0xc0000005 exception) Some or all property pages cannot be displayed.


    The only way I found to get around this is to use windows restore and restore my laptop before the point when I connected the printer via the usb port.

    Any suggestions?

    Hello
     
    This error 0x0000007A describes the data area passed to a system call is too small. ERROR_INSUFFICIENT_BUFFER
    You can try to uninstall and reinstall printer driver and check if that helps.
     
    Here's how you can do:
     
    1. open programs and features by clicking on the Start button, clicking Control Panel, click programs, and then clicking programs and features.
    2. Select a program and then click on uninstall.  If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
     
    After you have uninstalled the driver to restart the computer, this should install it the appropriate drivers for it. You can also try to download the latest driver from the manufacturers website and install it.
     
     
    Kind regards
    Umesh P - Microsoft Support
  • Signal output data expressed on a serial port

    Hello everyone,

    I received a task which requires me to collect several channels in express signal analog voltages before displaying these data to the serial port of the computer. My programming experience is very limited as Im working on the back of the high school before going to College, and even though I have the foundations of basic labview stowed, Im struggling to understand how to approach this problem.

    I started looking at the base read the series and write vi provided in the examples and I know how to get labview vi to intergrate with signal on purpose, but because of my lack of knowledge related to the use of channels of communications, binary, hexadecimal and asqui I don't really know where to go from here. The writing and reading of strings for example, I don't understand.

    I would like the data are ideally output on the serial port in real time and data are collected continuously at 6 kHz.

    I realize that there probably is no simple answer to this question, given my lack of knowledge, but any help would be greatly appreciated!

    Thank you!

    Harry

    Hi hcook,

    As smercurio_fc said, the strings that you send are totally dependent on what you're talking about. I haven't used a 'box of dspace' before, but a normal serial device will wait to receive specific orders.  Once it receives an order of some, she will perform a certain task.  You are right in saying that you need to establish what string commands to send to the box of dspace.

    You can find these useful:
    General concepts of Serial Communication
    Overview of Serial Communication

    I hope this helps.

  • What functions can I use to read from a RS-422 serial port?

    I'm reading a continuous strem of three numbers of an anemometer connected via RS - 422. What is the easiest way to read these in LabVIEW? Also it would be easy to separate these numbers andplot them separately against the clock?

    Dear

    He's hit 422 network operations and Miss at best. We decided to use their equipment to convert RS232 RS422 but only use an intrument on each 422 network. So we didn't need mark of unity, we use a serial port, separate for each instrument. I just configured to run in default mode on several occasions where they send their status message. The default mode also transmits all three (if you use patterns 3-axis) for the playback speed.

    When operating in this mode and configuration, everything I have to do is surround data and analyze the updated.

    This screenshot should show you everything you need to get started.

    Have fun!

    Ben

  • Transmission of data via the Ad Hoc network in LabVIEW

    Hello

    I'm trying to transmit some data (position, speed, etc.) a laptop computer to a host computer.

    The laptop and desktop have the card installed wireless so I thought this would be a good

    the idea of transmitting data via Wi - Fi using TCP.

    However, the problem is that there is no router/modem in the area where the laptop is sitting

    so, I create a network of Ad-hoc (computer to computer) between the laptop and the desktop computer.

    Then, I use "ipconfig/all" in the Windows command prompt to extract the IP as follows.

    IP address wireless laptop: 169.254.165.72

    IP address Wireless Desktop: 169.254.102.126

    Desktop Ethernet IP address: 129.94.229.230

    I then use the code example in the TCP library named 'Data Server.vi' and "Data Client.vi."

    I listen on port 6340 times the wireless and ethernet desktop on the side map server.

    And on the side of the customer, I opened a connection to port 6340 169.254.102.126 IP address.

    However, the connection cannot be granted. Anyone know why this is the case?

    Note: I have disabled all firewalls.

    Interesting, when 2 computers are connected to the same modem, their IP addresses

    differ only by the last number (e.g. XXX.XXX. XXX.123 vs XXX.XXX. XXX.256), but when an ad

    the House of Commons network is established, their IP addresses have 2 numbers that are different. (XXX.XXX.

    102,126 vs XXX. XXX.165.72) I wonder if this has nothing to do with the failure.

    Thanks for all your help.

    Ron Liou

    I somehow this job.

    What I've done

    -Once again set up an Ad hoc network for the labtop and Office

    -verification of the IP address is always the same

    > Portable wireless IP address: 169.254.165.72

    > Portable wireless subnet mask: 255.255.0.0

    > Wireless Office IP address: 169.254.102.126

    > Wireless Office subnet mask: 255.255.0.0

    -switch on the ICS of the ethernet on the desktop card

    (This resulted in an IP different addresses assigned beng)

    > Portable wireless IP address: 192.168.137.21

    > Portable wireless Subnet Mask: 255.255.255.0

    > Wireless Office IP address: 192.168.137.1

    > Office Wireless Subnet Mask: 255.255.255.0

    Now I use the ip address of office (192.168.137.1) to open the connection

    and it works! ??

    I am very pleased with the fact that it works but I would like to have one

    explanation on why it takes an ICS.

    Thank you!

  • VISA serial port automatically configures scan of the available serial ports?

    I am using a VISA set a serial port to open a connection to the serial port, to enter data, make some manipulation of array and display it.

    My VI works perfectly until what I have build in exe and transfer it on a laptop with a USB converter to port series (as the laptop does not have a serial port).

    Windows allocated the converter to COM9, but I do not see it in LabVIEW.

    Do I need to use something like 'Find VISA resource'? If it does find something how can I change the name of resource VISA?

    I have attached a screenshot to give you an idea of what I'm doing.

    There is absolutely no reason to use all of this code. The original order of resource VISA name should work just fine. Have you installed the runtime VISA on the laptop? If so, did you also install MAX, so you can check the VISA resources on the latptop?

    In addition, since an exe file will run automatically when opening, have you provided a mechanism for a com port selection until the program begins the acquisition of VISA?

  • Second monitor not detected via the dvi - d port

    Hi I have a Hp slimline s5610y. Windows 7 64-bit. It is a new system with 3 ghz ram and more than 600 gaeremynck ram so I know that this is not a problem of performance, (duty handling system), I am looking to hook up two monitors, product sheet page on H.P. States that ports Vga and Dvi d may be used at the same time. I have the converter dvi-d/VGA, hooked to a monitor via the Vga port on a single computer (which doesn't work). The Vga port to vga works fine (the first monitor. I already check the easy as stuf "carrier dual monitor", unplug the monitor, update the latest driver for radeon 3000 and restart windows. I hooked two monitors before without any problem. Any ideas out there?

    Thank you

    Manny

    Hi again,

    If it is a dvi - d, you need a computer screens which have dvi - d.
    A graphics card with a dvi - i port also supports vga monitors.

    OK - page of your product (return i/o ports):
    http://support.HP.com/us-en/document/c02552467

    It is a true dvi - d - then Yes, you need a digital monitor with a dvi - d port.

    C.

  • Is vMotion road data via the server vCenter Server?

    Hello

    I need help to solve a query I have.

    We currently have a vCenter server that manages certain clusters, but also some stand-alone hosts with local storage (not shared). Stand-alone hosts are physically located on remote sites. Some sites have more than one of these stand-alone hosts. We have an obligation to move a VM to a standalone host guest to another independent host on the same remote site.

    As there is no shared storage the VM should be stopped before trying the vMotion.

    The virtual machine in question has a 4 TB thick VMDK accrued that is migrated between the physical host computers.

    I think when the vMotion is launched the data will be limited to the subnet that the two physical hosts are connected and therefore use the bandwidth available via local network equipment and will not let the physical site. My colleague suggested, however, that data travels through the vCenter server. Of course, this would cause a problem to try to move the data so much and would effectively mean that this 4TB would leave travel via the vCenter server, remote site, then return to the remote site. Not only this would be very slow, it could also have a negative impact on bandwidth to and from the site.

    So my question is who is correct? (Assuming that one of us is!)

    Thank you

    When you start migrating cold from a virtual computer by selecting migrate both (host and storage) where your hosts are based in the same place, it will happen with esxi source and target host, it will not go all the way to your host to vCenter.

    If your environment is vSphere client of web use 5.1 or higher, and you can move VM while it is powered on and residing in the local storage of the host. This feature is called Cross-host migration. available only by using the web client.

  • Problem with JMS via the SSL protocol in clustered environment

    Hello

    We run Weblogic 11 g Cluster (area) which consists of admin server and two managed server MS1, MS2.
    LIKE and run it on the computer 1, MS1 MS2 runs on machine 2. Both machines have two network interfaces, a public used for client connections and an intern for cluster communication, monitoring etc. The default channel of each Weblogic Server is listening on the internal network interface, and Moreover we have two channels (for http and t3 Protocol) configured to the public interface.
    The two managed servers are JMS provider and there is a JMS Module myModule in the field with the following JMS resources: custom connection factory myConnFactory (Load Balancing active = true = false server affinity, target: entire cluster JMS) and myQueue, which is a uniform distributed queue (targets: MS1, MS2). The queue is accessed by its logical JNDI name, but she is stuck on each managed server.

    JMS communication flows normally through t3 dedicated listening on the public interface. However, a new external client will send messages to myQueue and communication must be encrypted for security reasons. For this reason, we have implemented SSL. Instead activate a DefaultSecure channel, we left 'SSL listen Port active' = false (as the default channel would be linked to the internal network interface) and created a new channel T3SChannel t3s Protocol on the public interface for incoming client connections.

    The customer creates a t3s connection to the cluster (through T3SChannel) and gets the factory connections and the queue, use the JNDI ( source) search. The JMS connection is in real-time with MS1. If we want to create two consumers for this queue, the consumer of fist is created the MS1 and the second will be created on MS2 (thanks to active balancing). However, the creation of the second consumer fails with an exception (it is thrown on the client):

    java.rmi.ConnectException: no valid port known for: "DefaultSecure [t3s]: t3s (t3s): mserver1 - internal .company .com: 56213:null:-1 ';" No router available at destination
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:396)
    at weblogic.rjvm.RJVMImpl.ensureConnectionEstablished(RJVMImpl.java:303)
    at weblogic.rjvm.RJVMImpl.getOutputStream(RJVMImpl.java:347)
    at weblogic.rjvm.RJVMImpl.getRequestStreamInternal(RJVMImpl.java:610)
    ... 18 more

    We were told that the exception can be avoided with t3s < default protocol > - < / default protocol > element (default is t3) added to the config.XML in the Weblogic domain. If we configure t3s as default protocol, we also need to activate the DefaultSecure channel on each server and then everything works and the customer is able to correctly create consumers.

    However, as a side effect, the entire cluster on weblogic.rjvm communication layer and then by t3s. We do not want that because internal cluster communications are set enough with other methods and it will have impact on the notable performance in the production environment. In principle, it should be possible to enable the external client to connect to the JMS provider via the channel new, safe, without affecting the existing internal communication in the cluster (which should be a black box for the customer).

    My question: is it possible to run the example described without defining the default protocol to t3s?

    Thanks for the reply.

    My question: is it possible to run the example described without defining the default protocol to t3s?

    Thanks for the very clear problem description. I checked with our customer support guru and I'm sure that the answer to your question is no, I think you have encountered a known problem and have already struck with the recommended workaround.

    That said, you can be able to avoid at least partially the problem by setting "server-affinity = true" on your CF. as you probably well know, affinity = false encourages consumer and producer traffic to route customer, on its server host connection, then possibly on a "second leap" to another server in the cluster. It looks like the attempt of an implicit downgrade of a secure request origin SSL in the first bond on a channel not secure in this second jump is to throw the exception.

    HTH,

    Tom

Maybe you are looking for