diff --git a/tools/parser/parser.c b/tools/parser/parser.c
index 9e62831..6444b81 100644
--- a/tools/parser/parser.c
+++ b/tools/parser/parser.c
#include <netinet/in.h>
#include "parser.h"
+#include "rfcomm.h"
struct parser_t parser;
{
int i, pos = -1;
- if (psm > 0 && psm < 0x1000)
+ if (psm > 0 && psm < 0x1000 && !channel)
return;
+ if (!psm && channel)
+ psm = RFCOMM_PSM;
+
for (i = 0; i < PROTO_TABLE_SIZE; i++) {
if (proto_table[i].handle == handle && proto_table[i].psm == psm && proto_table[i].channel == channel) {
pos = i;
{
int i, pos = -1;
+ if (!psm && channel)
+ psm = RFCOMM_PSM;
+
for (i = 0; i < PROTO_TABLE_SIZE; i++) {
if (proto_table[i].handle == handle && proto_table[i].psm == psm && proto_table[i].channel == channel)
return proto_table[i].proto;
- if (!proto_table[i].handle && (proto_table[i].psm == psm || (!proto_table[i].psm && proto_table[i].channel == channel)))
- pos = i;
+ if (!proto_table[i].handle) {
+ if (proto_table[i].psm == psm && proto_table[i].channel == channel)
+ pos = i;
+ }
}
return (pos < 0) ? 0 : proto_table[pos].proto;
diff --git a/tools/parser/rfcomm.c b/tools/parser/rfcomm.c
index a5ce993..40c68cf 100644
--- a/tools/parser/rfcomm.c
+++ b/tools/parser/rfcomm.c
frm->len--;
frm->channel = head->addr.server_chn;
- proto = get_proto(frm->handle, 0, frm->channel);
+ proto = get_proto(frm->handle, RFCOMM_PSM, frm->channel);
if (frm->len > 0) {
switch (proto) {