bnep: extract internal definitions from bluetooth.h

This commit is contained in:
Matthias Ringwald 2019-09-26 14:38:57 +02:00
parent 692bf1adaa
commit 9951ad9c4f
2 changed files with 38 additions and 37 deletions

View File

@ -520,43 +520,6 @@ typedef enum rpn_flow_control {
#define BNEP_MTU_MIN 1691
#define BNEP_EXT_FLAG 0x80
#define BNEP_TYPE_MASK 0x7F
#define BNEP_TYPE(header) ((header) & BNEP_TYPE_MASK)
#define BNEP_HEADER_HAS_EXT(x) (((x) & BNEP_EXT_FLAG) == BNEP_EXT_FLAG)
/* BNEP packet types */
#define BNEP_PKT_TYPE_GENERAL_ETHERNET 0x00
#define BNEP_PKT_TYPE_CONTROL 0x01
#define BNEP_PKT_TYPE_COMPRESSED_ETHERNET 0x02
#define BNEP_PKT_TYPE_COMPRESSED_ETHERNET_SOURCE_ONLY 0x03
#define BNEP_PKT_TYPE_COMPRESSED_ETHERNET_DEST_ONLY 0x04
/* BNEP control types */
#define BNEP_CONTROL_TYPE_COMMAND_NOT_UNDERSTOOD 0x00
#define BNEP_CONTROL_TYPE_SETUP_CONNECTION_REQUEST 0x01
#define BNEP_CONTROL_TYPE_SETUP_CONNECTION_RESPONSE 0x02
#define BNEP_CONTROL_TYPE_FILTER_NET_TYPE_SET 0x03
#define BNEP_CONTROL_TYPE_FILTER_NET_TYPE_RESPONSE 0x04
#define BNEP_CONTROL_TYPE_FILTER_MULTI_ADDR_SET 0x05
#define BNEP_CONTROL_TYPE_FILTER_MULTI_ADDR_RESPONSE 0x06
/* BNEP extension header types */
#define BNEP_EXT_HEADER_TYPE_EXTENSION_CONTROL 0x00
/* BNEP setup response codes */
#define BNEP_RESP_SETUP_SUCCESS 0x0000
#define BNEP_RESP_SETUP_INVALID_DEST_UUID 0x0001
#define BNEP_RESP_SETUP_INVALID_SOURCE_UUID 0x0002
#define BNEP_RESP_SETUP_INVALID_SERVICE_UUID_SIZE 0x0003
#define BNEP_RESP_SETUP_CONNECTION_NOT_ALLOWED 0x0004
/* BNEP filter response codes */
#define BNEP_RESP_FILTER_SUCCESS 0x0000
#define BNEP_RESP_FILTER_UNSUPPORTED_REQUEST 0x0001
#define BNEP_RESP_FILTER_ERR_INVALID_RANGE 0x0002
#define BNEP_RESP_FILTER_ERR_TOO_MANY_FILTERS 0x0003
#define BNEP_RESP_FILTER_ERR_SECURITY 0x0004
/**
* PAN Profile

View File

@ -61,6 +61,44 @@
#include "hci_dump.h"
#include "l2cap.h"
#define BNEP_EXT_FLAG 0x80
#define BNEP_TYPE_MASK 0x7F
#define BNEP_TYPE(header) ((header) & BNEP_TYPE_MASK)
#define BNEP_HEADER_HAS_EXT(x) (((x) & BNEP_EXT_FLAG) == BNEP_EXT_FLAG)
/* BNEP packet types */
#define BNEP_PKT_TYPE_GENERAL_ETHERNET 0x00
#define BNEP_PKT_TYPE_CONTROL 0x01
#define BNEP_PKT_TYPE_COMPRESSED_ETHERNET 0x02
#define BNEP_PKT_TYPE_COMPRESSED_ETHERNET_SOURCE_ONLY 0x03
#define BNEP_PKT_TYPE_COMPRESSED_ETHERNET_DEST_ONLY 0x04
/* BNEP control types */
#define BNEP_CONTROL_TYPE_COMMAND_NOT_UNDERSTOOD 0x00
#define BNEP_CONTROL_TYPE_SETUP_CONNECTION_REQUEST 0x01
#define BNEP_CONTROL_TYPE_SETUP_CONNECTION_RESPONSE 0x02
#define BNEP_CONTROL_TYPE_FILTER_NET_TYPE_SET 0x03
#define BNEP_CONTROL_TYPE_FILTER_NET_TYPE_RESPONSE 0x04
#define BNEP_CONTROL_TYPE_FILTER_MULTI_ADDR_SET 0x05
#define BNEP_CONTROL_TYPE_FILTER_MULTI_ADDR_RESPONSE 0x06
/* BNEP extension header types */
#define BNEP_EXT_HEADER_TYPE_EXTENSION_CONTROL 0x00
/* BNEP setup response codes */
#define BNEP_RESP_SETUP_SUCCESS 0x0000
#define BNEP_RESP_SETUP_INVALID_DEST_UUID 0x0001
#define BNEP_RESP_SETUP_INVALID_SOURCE_UUID 0x0002
#define BNEP_RESP_SETUP_INVALID_SERVICE_UUID_SIZE 0x0003
#define BNEP_RESP_SETUP_CONNECTION_NOT_ALLOWED 0x0004
/* BNEP filter response codes */
#define BNEP_RESP_FILTER_SUCCESS 0x0000
#define BNEP_RESP_FILTER_UNSUPPORTED_REQUEST 0x0001
#define BNEP_RESP_FILTER_ERR_INVALID_RANGE 0x0002
#define BNEP_RESP_FILTER_ERR_TOO_MANY_FILTERS 0x0003
#define BNEP_RESP_FILTER_ERR_SECURITY 0x0004
#define BNEP_CONNECTION_TIMEOUT_MS 10000
#define BNEP_CONNECTION_MAX_RETRIES 1