LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

In which layer does the bluetooch function work?


I am using the Labview7.1+WinXP Driver + Dongle, I wish I can do some development with the bluetooth functions in the labview. (On the PC)
I am wondering which layer  the bluetooth functions work in, I never succeed in transferring anything with them.
I used to think the bluetooth read and the bluetooth write functions can be used for application layer development, but I saw they can transfer string format only, I want to know how to transfer a file with them?
It would be best if any good man can give an example of transferring files with the bluetooth functions.
0 Kudos
Message 1 of 16
(4,811 Views)

I haven't used the BT functions, but as far as I know they act just like all the other communication functions in LV - you have to establish a connection between applications running on 2 devices and then transfer a byte stream (that's the string). The application on the other side is responsible for decoding that byte stream. My understanding is that the only difference in the BT function is that they work on BT (and not TCP or serial, for instance).

If you can run an LV program on the other side then you should be able to set it up to receive your string and use the file function to build it as a file. If there is another program receiving your BT connection, you need to know what that program does with the information you send it.


___________________
Try to take over the world!
Message 2 of 16
(4,796 Views)
I am glad to see that you knew how to use some other labview communication.

So how to transfer a file through IrDA ? As I see, labview IrDA functions support R/W string format only, just as the bluetooth did.

Would you please give me an example of IrDA transfering file?
0 Kudos
Message 3 of 16
(4,789 Views)
I don't understand what you mean with R/W string format.
A LabView string can host any character, not only ASCII. Just Write the string from one side, Read from the other side and write it to a file.
Of course, you need to take care of the part of protocol where you specify the file name, the file length, how to transfer (e.g. block length), how to terminate a transfer, how to manage communication error and so on.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 4 of 16
(4,786 Views)
Thanks for your reply.
As I know, the bluetooth stacks build many layers of application profiles and protocols in, so I am wondering in which layer the labview functions work.
If I know which layer the functions works, I can look for the layer's specification which may contain how to format a file from a string.
If not, I can only try... I 've already tried some, like OBEX...but failed.
So that why I am here asking the question, I wish some one may give me an example.
0 Kudos
Message 5 of 16
(4,784 Views)
Hi Loryyeah:

First, I haven't tried yet BT nor IrDA, but, if it is as tst said, I can help you.

You seem to be very worried of transferring files.

If you manage to transfer strings, you can transfer whatever you want.

LabView helps you with the functions to transfer strings. It's your work to use them to make VIs to transfer files.

If you try to communicate between two PCs, you can set your own protocol to transfer files.

For example, you can first send a string saying "Ready to Transfer", and wait until "Ready to Receive" is received.

When you receive it, communication is stablished, so you can send the file. How?, well, you open the file, read all data (you have a string), and send it as string to the other PC.

The receiving PC will save the string data to a file, using file functions.

You can send it in chunks of 100 chars with a header, or in any other way.

If you try to transfer files to a device in which you can't set it's transfer protocol, then you first have to get that protocol, and then, transfer files according to that.

There, "Ready to Transfer" and "Ready to Receive" will be different, and the file will have to be send with a specific header, and may be with a CRC or CheckSum. But all this information will be in the protocol.

Hope it helps,
Aitortxo.
Message 6 of 16
(4,783 Views)
I realized just now that you may want to connect to a device where you cannot or don't want to install your own software.
If this is the case, keep in mind that you can connect to a specific BT service, by specifying its UUID.
So far, I managed to connect to the Virtual Serial Port service. This is pretty easy: just connect and treat the open channel as a RS232 port.
I never tried with other services: I think that you can manage them (but I may be wrong), but it's up to you to implement the whole protocol, and this may be quite complicated.
Don't be stuck about strings: you can send/receive ANY byte sequence using strings. One way to do this is to prepare packets in byte arrays and using the Byte Array To String conversion function.
Hope this helps.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 7 of 16
(4,778 Views)
I studied the bluetooth core specification for a long time, and it SEEMS that these function should work AS the L2CAP layer. I will confirm that later, but I have to study the layers on the L2CAP.
As I am new to labview, bluetooth and communication, it will be hard, but I believe I will overcome all these.

ioryyeah

0 Kudos
Message 8 of 16
(4,759 Views)
Let me have a correction, that they truely work as a lower-layer of OBEX, what ever it is!
As I studied some OBEX commands these days, finally I can send a file now, I am really excited!
My final targets is BPP functions, I am sure it will be done soon!
Smiley Happy
0 Kudos
Message 9 of 16
(4,730 Views)

I've finished a program that pushs files and xhtml files, as attached.
Anyone interested can contact me to discuss.
It's funny!Smiley Happy
Message 10 of 16
(4,706 Views)