don't typedef enum for bit flags

This commit is contained in:
matthias.ringwald@gmail.com 2014-10-14 19:33:15 +00:00
parent aa82504ef4
commit 0414dabd12
6 changed files with 22 additions and 20 deletions

View File

@ -81,11 +81,11 @@ static hci_uart_config_t hci_uart_config_csr8811 = {
};
#endif
typedef enum {
enum {
SET_ADVERTISEMENT_PARAMS = 1 << 0,
SET_ADVERTISEMENT_DATA = 1 << 1,
ENABLE_ADVERTISEMENTS = 1 << 2,
} todo_t;
};
const uint8_t adv_data[] = {
// Flags general discoverable
@ -97,7 +97,7 @@ const uint8_t adv_data[] = {
};
uint8_t adv_data_len = sizeof(adv_data);
static todo_t todos = 0;
static uint16_t todos = 0;
static void app_run(){

View File

@ -75,14 +75,14 @@
// test profile
#include "profile.h"
typedef enum {
enum {
DISABLE_ADVERTISEMENTS = 1 << 0,
SET_ADVERTISEMENT_PARAMS = 1 << 1,
SET_ADVERTISEMENT_DATA = 1 << 2,
SET_SCAN_RESPONSE_DATA = 1 << 3,
ENABLE_ADVERTISEMENTS = 1 << 4,
} todo_t;
static todo_t todos = 0;
};
static uint16_t todos = 0;
///------
static int advertisements_enabled = 0;

View File

@ -52,12 +52,12 @@ const uint8_t adv_data[] = {
};
uint8_t adv_data_len = sizeof(adv_data);
typedef enum {
enum {
SET_ADVERTISEMENT_PARAMS = 1 << 0,
SET_ADVERTISEMENT_DATA = 1 << 1,
ENABLE_ADVERTISEMENTS = 1 << 2,
} todo_t;
static todo_t todos = 0;
};
static uint16_t todos = 0;
static void gap_run(){

View File

@ -1223,11 +1223,11 @@ static void daemon_retry_parked(void){
Minimal Code for LE Peripheral
typedef enum {
enum {
SET_ADVERTISEMENT_PARAMS = 1 << 0,
SET_ADVERTISEMENT_DATA = 1 << 1,
ENABLE_ADVERTISEMENTS = 1 << 2,
} todo_t;
};
const uint8_t adv_data[] = {
// Flags general discoverable
@ -1236,7 +1236,7 @@ const uint8_t adv_data[] = {
0x08, 0x09, 'B', 'T', 's', 't', 'a', 'c', 'k'
};
uint8_t adv_data_len = sizeof(adv_data);
static todo_t todos = 0;
static uint16_t todos = 0;
static void app_run(){

View File

@ -52,12 +52,12 @@ const uint8_t adv_data[] = {
};
uint8_t adv_data_len = sizeof(adv_data);
typedef enum {
enum {
SET_ADVERTISEMENT_PARAMS = 1 << 0,
SET_ADVERTISEMENT_DATA = 1 << 1,
ENABLE_ADVERTISEMENTS = 1 << 2,
} todo_t;
static todo_t todos = 0;
};
static uint16_t todos = 0;
static void gap_run(){

View File

@ -255,9 +255,7 @@ typedef struct le_connection_parameter_range{
uint16_t le_supervision_timeout_max;
} le_connection_parameter_range_t;
/**
* Connection State
*/
// Authentication flags
typedef enum {
AUTH_FLAGS_NONE = 0x0000,
RECV_LINK_KEY_REQUEST = 0x0001,
@ -279,6 +277,9 @@ typedef enum {
CONNECTION_ENCRYPTED = 0x8000,
} hci_authentication_flags_t;
/**
* Connection State
*/
typedef enum {
SEND_CREATE_CONNECTION = 0,
SENT_CREATE_CONNECTION,
@ -292,7 +293,8 @@ typedef enum {
SENT_DISCONNECT
} CONNECTION_STATE;
typedef enum {
// bonding flags
enum {
BONDING_REQUEST_REMOTE_FEATURES = 0x01,
BONDING_RECEIVED_REMOTE_FEATURES = 0x02,
BONDING_REMOTE_SUPPORTS_SSP = 0x04,
@ -302,7 +304,7 @@ typedef enum {
BONDING_SEND_ENCRYPTION_REQUEST = 0x40,
BONDING_DEDICATED = 0x80,
BONDING_EMIT_COMPLETE_ON_DISCONNECT = 0x100
} bonding_flags_t;
};
typedef enum {
BLUETOOTH_OFF = 1,