Data Structures | Macros | Typedefs
BleTypes.h File Reference
#include "BleConfig.h"
+ Include dependency graph for BleTypes.h:

Data Structures

struct  BD_ADDR


#define BLEADDRESS_PUBLIC   0x00
#define BLEADDRESS_RANDOM   0x01
#define BLECONNROLE_SLAVE   0x01
#define BLESTATUS_BUSY   0x03
#define BLESTATUS_FAILED   0x01
#define BLESTATUS_PENDING   0x02
#define BLESTATUS_SUCCESS   0x00
#define LE_TO_U16(ptr)   (U16)( (U16)(*(ptr)) + (U16) (*(ptr + 1) << 8) )


typedef U8 BleAddressType
typedef U8 BleConnRole
typedef U8 BleDisconnectionReason
typedef U8 BleStatus
typedef signed short S16
typedef signed char S8
typedef unsigned short U16
typedef unsigned long U32
typedef unsigned char U8

Macro Definition Documentation

#define BLEADDRESS_PUBLIC   0x00
#define BLEADDRESS_RANDOM   0x01
#define BLECONNROLE_SLAVE   0x01
#define BLESTATUS_BUSY   0x03
#define BLESTATUS_FAILED   0x01
#define BLESTATUS_PENDING   0x02
#define BLESTATUS_SUCCESS   0x00
#define LE_TO_U16 (   ptr)    (U16)( (U16)(*(ptr)) + (U16) (*(ptr + 1) << 8) )

LE_TO_U16 This macro convert a LSO First (Less Significant Octets first - Little endian) single byte based and formatted (U8) buffer into a 2 octets unsigned integer. The macro definitions do the same thing: if the input buffer is 0x01 0x02 the output U16 is 0x0201. For a Big-Endian based microprocessor; there is only one choice :

  • Take the first octets and adding a shift of the second octets. For a Little-Endian based microprocessor; there is two choices:
  • Also take the first octets and adding a sift of the second octets.
  • Cast directly the buffer into a U16, It saves some instructions and uses less registers ( generally, three registers are used for addition and shifting, none for direct cast)

ptr is an U8 *

Typedef Documentation

typedef U8 BleAddressType

Definition for the AddressType type The Bluetooth device Address (BD_ADDR) could be a public address (BLEADDRESS_PUBLIC) or a random address (BLEADDRESS_RANDOM)

typedef U8 BleConnRole

Definition for the BleConnRole type

Indicates the connection role of the local device in the connection information could be Master role (BLECONNROLE_MASTER) or Slave role (BLECONNROLE_SLAVE)

Definition for the BleDisconnectionReason type

Indicates the disconnection reason reported during a link layer disconnection. This subset is the most common disconnection error codes received the complete list of possible error code can be found in the Bluetooth Core Specification 4.0 Volume 2 part D: Error Code

typedef U8 BleStatus

Definition for the BleStatus type, representing general status information in the stack

typedef signed short S16

Definition for the S16 type, signed 16-bit size (2 byte)

typedef signed char S8

Definition for the S8 type, signed 8-bit size (1 byte)

typedef unsigned short U16

Definition for the U16 type, unsigned 16-bit size (2 byte)

typedef unsigned long U32

Definition for the U32 type, unsigned 32-bit size (4 byte)

typedef unsigned char U8

Definition for the U8 type, unsigned 8-bit size (1 byte)

This documentation file has been automatically generated on Fri Oct 4 2019 03:47:04 by doxygen 1.8.8