2017-01-10 16:23:42 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation.
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2017-01-10 16:23:42 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Bluetooth L2 stack public header
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __BT_H__
|
|
|
|
#define __BT_H__
|
|
|
|
|
|
|
|
#include <net/net_mgmt.h>
|
|
|
|
|
|
|
|
/* Management part definitions */
|
|
|
|
|
|
|
|
#define _NET_BT_LAYER NET_MGMT_LAYER_L2
|
|
|
|
#define _NET_BT_CODE 0x155
|
|
|
|
#define _NET_BT_BASE (NET_MGMT_IFACE_BIT | \
|
|
|
|
NET_MGMT_LAYER(_NET_BT_LAYER) | \
|
|
|
|
NET_MGMT_LAYER_CODE(_NET_BT_CODE))
|
|
|
|
#define _NET_BT_EVENT (_NET_BT_BASE | NET_MGMT_EVENT_BIT)
|
|
|
|
|
|
|
|
enum net_request_bt_cmd {
|
2017-07-31 21:58:16 +08:00
|
|
|
NET_REQUEST_BT_CMD_ADVERTISE = 1,
|
|
|
|
NET_REQUEST_BT_CMD_CONNECT,
|
2017-01-10 20:43:24 +08:00
|
|
|
NET_REQUEST_BT_CMD_SCAN,
|
2017-01-12 21:53:00 +08:00
|
|
|
NET_REQUEST_BT_CMD_DISCONNECT,
|
2017-01-10 16:23:42 +08:00
|
|
|
};
|
|
|
|
|
2017-07-31 21:58:16 +08:00
|
|
|
#define NET_REQUEST_BT_ADVERTISE \
|
|
|
|
(_NET_BT_BASE | NET_REQUEST_BT_CMD_ADVERTISE)
|
|
|
|
|
|
|
|
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_ADVERTISE);
|
|
|
|
|
2017-01-10 16:23:42 +08:00
|
|
|
#define NET_REQUEST_BT_CONNECT \
|
|
|
|
(_NET_BT_BASE | NET_REQUEST_BT_CMD_CONNECT)
|
|
|
|
|
|
|
|
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_CONNECT);
|
|
|
|
|
2017-01-10 20:43:24 +08:00
|
|
|
#define NET_REQUEST_BT_SCAN \
|
|
|
|
(_NET_BT_BASE | NET_REQUEST_BT_CMD_SCAN)
|
|
|
|
|
|
|
|
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_SCAN);
|
|
|
|
|
|
|
|
enum net_event_bt_cmd {
|
|
|
|
NET_EVENT_BT_CMD_SCAN_RESULT = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NET_EVENT_BT_SCAN_RESULT \
|
|
|
|
(_NET_BT_EVENT | NET_EVENT_BT_CMD_SCAN_RESULT)
|
|
|
|
|
2017-01-12 21:53:00 +08:00
|
|
|
#define NET_REQUEST_BT_DISCONNECT \
|
|
|
|
(_NET_BT_BASE | NET_REQUEST_BT_CMD_DISCONNECT)
|
|
|
|
|
|
|
|
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_DISCONNECT);
|
|
|
|
|
2017-01-10 16:23:42 +08:00
|
|
|
#endif /* __BT_H__ */
|