Filippo Casamassima / Nucleo_blueNRG

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers link_layer.h Source File

link_layer.h

00001 /******************** (C) COPYRIGHT 2012 STMicroelectronics ********************
00002 * File Name          : link_layer.h
00003 * Author             : AMS - HEA&RF BU
00004 * Version            : V1.0.0
00005 * Date               : 19-July-2012
00006 * Description        : Header file for BlueNRG's link layer. It contains
00007 *                      definition of functions for link layer, most of which are
00008 *                      mapped to HCI commands.
00009 ********************************************************************************
00010 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00011 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
00012 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
00013 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
00014 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
00015 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00016 *******************************************************************************/
00017 
00018 #ifndef _LINK_LAYER_H
00019 #define _LINK_LAYER_H
00020 
00021 #include <ble_status.h>
00022 
00023 /**
00024  * advertising policy for filtering (white list related) 
00025  */
00026 #define NO_WHITE_LIST_USE           (0x00)  /** Process scan and connection requests from all devices (i.e., the White List is not in use) */
00027 #define WHITE_LIST_FOR_ONLY_SCAN    (0x01)  /** Process connection requests from all devices and only scan requests from devices that are in the White List */
00028 #define WHITE_LIST_FOR_ONLY_CONN    (0x02)  /** Process scan requests from all devices and only connection requests from devices that are in the White List */
00029 #define WHITE_LIST_FOR_ALL          (0x03)  /** Process scan and connection requests only from devices in the White List. */
00030 
00031 /**
00032  * Bluetooth 48 bit address (in little-endian order).
00033  */
00034 typedef uint8_t tBDAddr[6];
00035 
00036 
00037 /** 
00038  * Bluetooth address type
00039  */
00040 #define RANDOM_ADDR     (1)
00041 #define PUBLIC_ADDR     (0)
00042 
00043 /** 
00044  * Advertising type
00045  */
00046 
00047 /**
00048  * undirected scannable and connectable 
00049  */ 
00050 #define ADV_IND         (0x00)
00051 
00052 /** 
00053  * directed non scannable
00054  */
00055 #define ADV_DIRECT_IND  (0x01)
00056 
00057 /**
00058  * scannable non connectable
00059  */
00060 #define ADV_SCAN_IND    (0x02)
00061 
00062 /**
00063  * non-connectable and no scan response (used for passive scan)
00064  */
00065 #define ADV_NONCONN_IND (0x03)
00066 
00067 
00068 /* 0X04-0XFF RESERVED */
00069 
00070 
00071 /** 
00072  * lowest allowed interval value for connectable types(20ms)..multiple of 625us
00073  */
00074 #define ADV_INTERVAL_LOWEST_CONN    (0X0020)
00075 
00076 /** 
00077  * highest allowed interval value (10.24s)..multiple of 625us.
00078  */
00079 #define ADV_INTERVAL_HIGHEST        (0X4000)
00080 
00081 /** 
00082  * lowest allowed interval value for non connectable types
00083  * (100ms)..multiple of 625us.
00084  */
00085 #define ADV_INTERVAL_LOWEST_NONCONN (0X00a0)
00086 
00087 /** 
00088  * Default value of advertising interval for both min/max values.
00089  * This will be used if host does not specify any advertising parameters 
00090  * including advIntervalMax and advIntervalMin
00091  * value = 1.28 sec (in units of 625 us)
00092  */
00093 #define ADV_INTERVAL_DEFAULT        (0x0800)
00094 
00095 #define ADV_CH_37 0x01
00096 #define ADV_CH_38 0x02
00097 #define ADV_CH_39 0x04
00098 
00099 
00100 
00101 #endif /* _LINK_LAYER_H */
00102