Is there a way to establish a Bluetooth Connection between Arduino uno and RasPI

I'm new to the following boards and I am wondering if any of you guys have any experience.
I was wondering if you guys know the code to establish or send the data to the Raspberry Pi B+. And im wondering if the following code is the code to do this.

void loop() {
//Read from bluetooth and write to usb serial
if(bluetooth.available()) {
char toSend = (char)bluetooth.read();
Serial.print(toSend);
flashLED();
}

//Read from usb serial to bluetooth
if(Serial.available()) {
char toSend = (char)Serial.read();
bluetooth.print(toSend);
flashLED();
}

What happened when you tried it?

And you need to post a complete program that I can compile.

...R

In essence the two are treated simply as serial ports.

bluetooth.read();

Means nothing without knowing the library it is calling and that information would be in the code you did not post. See:-
http://snippets-r-us.com/