mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-30 07:34:27 +08:00
tools/l2test: Fix default LE PSM value
LE has different ranges for dynamic PSMs.
This commit is contained in:
parent
44b3d5e480
commit
32b31f91b8
@ -48,6 +48,9 @@
|
||||
|
||||
#define NIBBLE_TO_ASCII(c) ((c) < 0x0a ? (c) + 0x30 : (c) + 0x57)
|
||||
|
||||
#define BREDR_DEFAULT_PSM 0x1011
|
||||
#define LE_DEFAULT_PSM 0x0080
|
||||
|
||||
/* Test modes */
|
||||
enum {
|
||||
SEND,
|
||||
@ -87,7 +90,7 @@ static long buffer_size = 2048;
|
||||
|
||||
/* Default addr and psm and cid */
|
||||
static bdaddr_t bdaddr;
|
||||
static unsigned short psm = 0x1011;
|
||||
static unsigned short psm = 0;
|
||||
static unsigned short cid = 0;
|
||||
|
||||
/* Default number of frames to send (-1 = infinite) */
|
||||
@ -1525,6 +1528,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (!psm) {
|
||||
if (bdaddr_type == BDADDR_BREDR)
|
||||
psm = BREDR_DEFAULT_PSM;
|
||||
else
|
||||
psm = LE_DEFAULT_PSM;
|
||||
}
|
||||
|
||||
if (need_addr && !(argc - optind)) {
|
||||
usage();
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user