
Chapter 2 – AT Commands
Multi-Tech Systems, Inc. SocketWireless Bluetooth AT Commands (S000360H) 40
Park and Sniff (Connected Slave) Commands
Supported in Point-to-Point mode only!
Low Power Modes Using Sniff
Bluetooth connections are master/slave in nature. A master sends packets and a slave has to
acknowledge the packet in the next time slot. Time slots in Bluetooth are 625 microseconds wide. This
implies that a master will always know when packets will be sent and received, which further means it is
able to optimize power usage by switching on power-hungry circuitry only when needed.
A slave, on the other hand, does NOT have prior knowledge of when a packet will be received and has to
assume that a packet will be received from a master on every receive slot. This means that it has to leave
its receiving circuitry on for most of the receive slot duration. The result of this is high power consumption
because a slave with no data transmission still consumes around 5mA.
This problem was identified very early in the evolution of Bluetooth (especially since headsets spend all
their time as a slave in a Bluetooth connection) and it was solved by having a mode called Sniff, with
appropriate lower layer negotiating protocol.
Sniff mode during connection is basically an agreement between the slave and its master in which data
packets will only be exchanged for N time slots every M slots. The slave can then assume that it will never
be contacted during N-M slots, and so can switch its power-hungry circuitry off. The specification goes
further by also specifying a third parameter called ‘timeout’ (T) which specifies ‘extra’ time slots that the
slave will agree to listen for after receiving a valid data packet. Put another way, if a data packet is received
by the slave, then it knows that it MUST carry on listening for at least T more slots. If, within that T slot time
period, another data packet is received, then the timer is restarted. This mechanism ensures low power
consumption when there is no data transfer – at the expense of latency. When there is a lot of data to be
transferred, it acts as if sniff mode were not enabled.
It is stated above that during sniff mode, a slave listens for N slots every M slots. The Bluetooth
specification states that a master can have up to 7 slaves attached to it with all slaves having requested
varying sniff parameters. It may, therefore, be impossible to guarantee that each slave gets the M
parameter it requested. In light of this, the protocol for enabling sniff mode specifies that a requesting peer
specify the M parameter as a minimum and maximum value. This will allow the master to interleave the
sniff modes for all slaves attached.
SNIFF Enable Sniff
Manually enables sniff mode for Slave devices connected in time slots.
Format: ATSNIFF,<Max Interval>,<Min Interval>,<Attempt>,<Timeout>
Parameters:
• Max Interval: Integer Value
Time [ms] = Max Interval * 0.625ms
• Min Interval: Integer Value
Time [ms] = Min Interval * 0.625ms
• Attempt: Integer Value
Time [ms] = Attempt * 0.625ms
• Timeout: Integer Value
Time [ms] = Timeout * 0.625ms
EXAMPLE:
TYPE: ATSNIFF,1600,160,10,160<cr>
REPLY: <cr_lf>OK<cr_lf>
OR
<cr_lf>NO CARRIER<cr_lf>
Notes:
• Manually enabling sniff results in an always connected slave using only 2mA average
current when no data is sent. It takes about 7 seconds before the current drops after the
connection is established. Parameters are lost after the connection is dropped.
• The device will exit sniff mode once the connection is terminated. ATSNIFF must be
executed again upon establishing a new connection in order to start sniff mode again.
Comentarios a estos manuales