what's new

palowireless
          Bluetooth Resource Center


Advanced search


Bluetooth Protocol Stack Technology Profiles
Bluetooth Stack Examples Overview FAQ
WPAN Technology Tutorial Baseband RFCOMM L2CAP LMP HCI


specs specifications docs pdfs WPAN Wireless Personal Area Network
 
 

Members

Member:

Password:

Forgot your
password?


New Member


 
 

 

 

Sniff Mode Nsniff Timeout Use

Original Post: Sniff mode (SIG Forum)     Date: 2000-04-04

The Bluetooth Specification , in section 10.8.2 states: "The slave has to listen at Dsniff slot every sniff period, Tsniff for a Nsniff attempt number of times. If the slave receives a packet in one of the Nsniff attempt RX slots, it should continue listening as long as it receives packets to its own AM_ADDR. Once it stops receiving packets, it should continue listening for Nsniff  timeout RX slots or remaining of the Nsniff attempt number of RX slots, whichever is greater."

This is all reasonably clear except the use of Nsniff   timeout, which can  can be interpreted in several different incompatible ways. These interpretations depend upon the meaning of "Once it stops receiving packets". I am assuming that "receiving packets" means "receiving packets with its AM_ADDR", since that phrase is included in the preceding sentence. My problem is that I can see two different interpretations for "Once it stops". Here are 2 possible  interpretations:

1)

"Once it stops receiving packets" means "As soon as it fails to receive a packet or receives a packet with another AM_ADDR". The slave will then set a slot counter to the Nsniff  timeout value. At each following receive slot it may or may not receive a packet that has its AM_ADDR, but will always decrement the slot counter. When both the slot counter equals zero and the Nsniff   attempt period has expired, it will stop receiving until the next Dsniff slot.

Possible Pseudo Code.  Note: Denote the number of the RX slots, in which the slave has to continue listening, AFTER receiving a packet with it's own AM_ADDR, as Tlisten:

i = 1;   For each RXslot(i)do

{
   listen;
   Tlisten = max(Nsniff - i, Nsniff_time_out - i);
   i = i + 1;
}

 

2)

"Once it stops receiving packets" means "In the receive slot following reception of the last packet with its AM_ADDR". The slave will then set a slot counter to the Nsniff  timeout value. At each following receive slot it may or may not receive a packet with its AM_ADDR. If it does not receive such a packet, then it will decrement the slot counter. If both the slot counter reaches zero and the Nsniff  attempt period has expired, it will stop receiving until the next Dsniff slot. If it does receive a packet with its AM_ADDR, then that packet becomes the "last" packet and it restarts the slot counter to the full Nsniff  timeout value.

Possible Pseudo Code  Note: Denote the number of the RX slots, in which the slave has to continue listening, AFTER receiving a packet with it's own AM_ADDR, as Tlisten. receive means 'receive a packet with it's own AM_ADDR'

i = j = 1;   For each RXslot(i)do

{
   listen;
   if (receive = true)
      then
      {
         Tlisten = max(Nsniff - i, Nsniff_time_out);
         j = 1;
      }
      else
      {
         Tlisten = max(Nsniff - i, Nsniff_time_out - j);
         j = j + 1;
      }
   i = i + 1;
}
Conclusion

The second interpretation was seen to be the correct one. Some reasons are:

  • In the first interpretation, one of the parameter (either Nsniff or Nsniff_time_out) plays no role and i think, the comparison to find out "whichever greater" is almost unnecessary.
  • As cited from the Specs.: "... it should continue listening for Nsniff_timeout RX slots or REMAINING of the Nsniff attempt number of RX slots, whichever is greater." So, the word "REMAINING" is only for Nsniff, and NOT for Nsniff_time_out. *
  • Furthermore, the spec., pp 209 of 1082, says: "The sniff timeout parameter determines for how many ADDITIONAL slots the slave must listen if it ..." That word "ADDITIONAL" here makes me again agree with the second interpretation.