Added support for obtaining BLE device name by parsing advertising data.
Fork of BLE_BlueNRG by
hci/inc/link_layer.h@0:309c845d289d, 2014-07-16 (annotated)
- Committer:
- mridup
- Date:
- Wed Jul 16 04:59:51 2014 +0000
- Revision:
- 0:309c845d289d
Full BlueNRG library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mridup | 0:309c845d289d | 1 | /******************** (C) COPYRIGHT 2012 STMicroelectronics ******************** |
mridup | 0:309c845d289d | 2 | * File Name : link_layer.h |
mridup | 0:309c845d289d | 3 | * Author : AMS - HEA&RF BU |
mridup | 0:309c845d289d | 4 | * Version : V1.0.0 |
mridup | 0:309c845d289d | 5 | * Date : 19-July-2012 |
mridup | 0:309c845d289d | 6 | * Description : Header file for BlueNRG's link layer. It contains |
mridup | 0:309c845d289d | 7 | * definition of functions for link layer, most of which are |
mridup | 0:309c845d289d | 8 | * mapped to HCI commands. |
mridup | 0:309c845d289d | 9 | ******************************************************************************** |
mridup | 0:309c845d289d | 10 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
mridup | 0:309c845d289d | 11 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
mridup | 0:309c845d289d | 12 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
mridup | 0:309c845d289d | 13 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
mridup | 0:309c845d289d | 14 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
mridup | 0:309c845d289d | 15 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
mridup | 0:309c845d289d | 16 | *******************************************************************************/ |
mridup | 0:309c845d289d | 17 | |
mridup | 0:309c845d289d | 18 | #ifndef _LINK_LAYER_H |
mridup | 0:309c845d289d | 19 | #define _LINK_LAYER_H |
mridup | 0:309c845d289d | 20 | |
mridup | 0:309c845d289d | 21 | #include <ble_status.h> |
mridup | 0:309c845d289d | 22 | |
mridup | 0:309c845d289d | 23 | /****************************************************************************** |
mridup | 0:309c845d289d | 24 | * Types |
mridup | 0:309c845d289d | 25 | *****************************************************************************/ |
mridup | 0:309c845d289d | 26 | |
mridup | 0:309c845d289d | 27 | /** |
mridup | 0:309c845d289d | 28 | * advertising policy for filtering (white list related) |
mridup | 0:309c845d289d | 29 | */ |
mridup | 0:309c845d289d | 30 | typedef tHalUint8 tAdvPolicy; |
mridup | 0:309c845d289d | 31 | #define NO_WHITE_LIST_USE (0X00) |
mridup | 0:309c845d289d | 32 | #define WHITE_LIST_FOR_ONLY_SCAN (0X01) |
mridup | 0:309c845d289d | 33 | #define WHITE_LIST_FOR_ONLY_CONN (0X02) |
mridup | 0:309c845d289d | 34 | #define WHITE_LIST_FOR_ALL (0X03) |
mridup | 0:309c845d289d | 35 | |
mridup | 0:309c845d289d | 36 | /** |
mridup | 0:309c845d289d | 37 | * Bluetooth 48 bit address (in little-endian order). |
mridup | 0:309c845d289d | 38 | */ |
mridup | 0:309c845d289d | 39 | typedef tHalUint8 tBDAddr[6]; |
mridup | 0:309c845d289d | 40 | |
mridup | 0:309c845d289d | 41 | |
mridup | 0:309c845d289d | 42 | /** |
mridup | 0:309c845d289d | 43 | * Bluetooth address type |
mridup | 0:309c845d289d | 44 | */ |
mridup | 0:309c845d289d | 45 | typedef tHalUint8 tAddrType; |
mridup | 0:309c845d289d | 46 | #define RANDOM_ADDR (1) |
mridup | 0:309c845d289d | 47 | #define PUBLIC_ADDR (0) |
mridup | 0:309c845d289d | 48 | |
mridup | 0:309c845d289d | 49 | /** |
mridup | 0:309c845d289d | 50 | * Advertising type |
mridup | 0:309c845d289d | 51 | */ |
mridup | 0:309c845d289d | 52 | typedef tHalUint8 tAdvType; |
mridup | 0:309c845d289d | 53 | /** |
mridup | 0:309c845d289d | 54 | * undirected scannable and connectable |
mridup | 0:309c845d289d | 55 | */ |
mridup | 0:309c845d289d | 56 | #define ADV_IND (0x00) |
mridup | 0:309c845d289d | 57 | |
mridup | 0:309c845d289d | 58 | /** |
mridup | 0:309c845d289d | 59 | * directed non scannable |
mridup | 0:309c845d289d | 60 | */ |
mridup | 0:309c845d289d | 61 | #define ADV_DIRECT_IND (0x01) |
mridup | 0:309c845d289d | 62 | |
mridup | 0:309c845d289d | 63 | /** |
mridup | 0:309c845d289d | 64 | * scannable non connectable |
mridup | 0:309c845d289d | 65 | */ |
mridup | 0:309c845d289d | 66 | #define ADV_SCAN_IND (0x02) |
mridup | 0:309c845d289d | 67 | |
mridup | 0:309c845d289d | 68 | /** |
mridup | 0:309c845d289d | 69 | * non-connectable and no scan response (used for passive scan) |
mridup | 0:309c845d289d | 70 | */ |
mridup | 0:309c845d289d | 71 | #define ADV_NONCONN_IND (0x03) |
mridup | 0:309c845d289d | 72 | |
mridup | 0:309c845d289d | 73 | |
mridup | 0:309c845d289d | 74 | /* 0X04-0XFF RESERVED */ |
mridup | 0:309c845d289d | 75 | |
mridup | 0:309c845d289d | 76 | |
mridup | 0:309c845d289d | 77 | /** |
mridup | 0:309c845d289d | 78 | * lowest allowed interval value for connectable types(20ms)..multiple of 625us |
mridup | 0:309c845d289d | 79 | */ |
mridup | 0:309c845d289d | 80 | #define ADV_INTERVAL_LOWEST_CONN (0X0020) |
mridup | 0:309c845d289d | 81 | |
mridup | 0:309c845d289d | 82 | /** |
mridup | 0:309c845d289d | 83 | * highest allowed interval value (10.24s)..multiple of 625us. |
mridup | 0:309c845d289d | 84 | */ |
mridup | 0:309c845d289d | 85 | #define ADV_INTERVAL_HIGHEST (0X4000) |
mridup | 0:309c845d289d | 86 | |
mridup | 0:309c845d289d | 87 | /** |
mridup | 0:309c845d289d | 88 | * lowest allowed interval value for non connectable types |
mridup | 0:309c845d289d | 89 | * (100ms)..multiple of 625us. |
mridup | 0:309c845d289d | 90 | */ |
mridup | 0:309c845d289d | 91 | #define ADV_INTERVAL_LOWEST_NONCONN (0X00a0) |
mridup | 0:309c845d289d | 92 | |
mridup | 0:309c845d289d | 93 | /** |
mridup | 0:309c845d289d | 94 | * Default value of advertising interval for both min/max values. |
mridup | 0:309c845d289d | 95 | * This will be used if host does not specify any advertising parameters |
mridup | 0:309c845d289d | 96 | * including advIntervalMax and advIntervalMin |
mridup | 0:309c845d289d | 97 | * value = 1.28 sec (in units of 625 us) |
mridup | 0:309c845d289d | 98 | */ |
mridup | 0:309c845d289d | 99 | #define ADV_INTERVAL_DEFAULT (0x0800) |
mridup | 0:309c845d289d | 100 | |
mridup | 0:309c845d289d | 101 | #define ADV_CH_37 0x01 |
mridup | 0:309c845d289d | 102 | #define ADV_CH_38 0x02 |
mridup | 0:309c845d289d | 103 | #define ADV_CH_39 0x04 |
mridup | 0:309c845d289d | 104 | |
mridup | 0:309c845d289d | 105 | |
mridup | 0:309c845d289d | 106 | |
mridup | 0:309c845d289d | 107 | #endif /* _LINK_LAYER_H */ |