RSSI Data dBm

I have a XBee module and want to read the signal strength in dBm.
I have used the AT command 'ATDB' and it gives me the RSSI value.
But I don't know how to write code in arduino for it. Could you help.

Google says Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.
First link on first page of search results.

Does anybody know how to convert AT commands to C code?

I want to use the ATDB command and get the return value and save it in a variable.

Does anybody know how to convert AT commands to C code?

Yes.

I want to use the ATDB command and get the return value and save it in a variable.

Permission granted.

PaulS:

Does anybody know how to convert AT commands to C code?

Yes.

I want to use the ATDB command and get the return value and save it in a variable.

Permission granted.

could you help me

How do you send an AT command to the XBee now? You type some text into an application that sends the text to the XBee via the serial port. So:

Serial.print("ATDB");

Then, the application shows any serial data that came back:

while(Serial.available() > 0)
{
   char inChar = Serial.read();
   // Do something with inChar
}

If the Arduino is using a software serial port to talk to the XBee, replace Serial with the SoftwareSerial instance name.

These seemed related, so I merged them.

The code above worked only when i write +++ and it answers OK.
But when I use other AT commands like ATID or ATDB it doesnt answer anything. You can see my code below to see what I have done.

Sending AT Commands Code

import processing.serial.*;
Serial myPort; // The serial port

void setup() {
println(Serial.list());
myPort = new Serial(this, Serial.list()[0], 9600);
myPort.write("+++");
delay(1000);

}

void draw() {
while (myPort.available() > 0){
int inByte = myPort.read();
println(inByte);
myPort.write("ATID");
delay(1000);
}
}

Receiver Code

while(Serial.available() > 0)
{
char inChar = Serial.read();
Serial.write(inChar);
}

You know that you have to put the XBee in command mode, first, right? Then, when you get the OK, you can send it other AT commands.

PaulS:
You know that you have to put the XBee in command mode, first, right? Then, when you get the OK, you can send it other AT commands.

I send +++ and get OK but after that I can't send anything else.
Am I not getting the XBee in AT Command mode when I write +++?

Am I not getting the XBee in AT Command mode when I write +++?

Yes, but if commands don't arrive in a timely fashion, it exits command mode. As I recall, "timely fashion" means less than a second between commands. Your 1 second delay shoots that opportunity all to hell.