@@ -64,62 +64,57 @@ extern "C"
64
64
class AdafruitBluefruit
65
65
{
66
66
public:
67
- AdafruitBluefruit (void ); // Constructor
67
+ // Constructor
68
+ AdafruitBluefruit (void );
68
69
69
70
err_t begin (bool prph_enable = true , bool central_enable = false );
70
-
71
- void autoConnLed (bool enabled);
72
- void setConnLedInterval (uint32_t ms);
73
- void startConnLed (void );
74
- void stopConnLed (void );
75
-
76
- void setName (const char * str);
77
- char * getName (void );
78
-
79
- bool setTxPower (int8_t power);
80
- int8_t getTxPower (void );
81
71
82
72
/* ------------------------------------------------------------------*/
83
- /* Advertising & Scan Response (active scan )
73
+ /* Lower Level Classes (Bluefruit.Advertising.*, etc. )
84
74
*------------------------------------------------------------------*/
85
75
BLEAdvertising Advertising;
86
76
BLEAdvertising ScanResponse;
77
+ BLECentral Central;
87
78
88
79
/* ------------------------------------------------------------------*/
89
- /*
80
+ /* General Purpose Functions
90
81
*------------------------------------------------------------------*/
91
- bool connected (void );
92
- void disconnect (void );
93
-
94
- err_t setConnInterval (uint16_t min, uint16_t max);
95
- err_t setConnIntervalMS (uint16_t min_ms, uint16_t max_ms);
96
-
97
- uint16_t connHandle (void );
98
- bool connBonded (void );
99
- uint16_t connInterval (void );
82
+ void autoConnLed (bool enabled);
83
+ void setConnLedInterval (uint32_t ms);
84
+ void startConnLed (void );
85
+ void stopConnLed (void );
86
+ void setName (const char * str);
87
+ char * getName (void );
88
+ bool setTxPower (int8_t power);
89
+ int8_t getTxPower (void );
100
90
101
- void clearBonds (void );
91
+ /* ------------------------------------------------------------------*/
92
+ /* GAP, Connections and Bonding
93
+ *------------------------------------------------------------------*/
94
+ bool connected (void );
95
+ void disconnect (void );
96
+ err_t setConnInterval (uint16_t min, uint16_t max);
97
+ err_t setConnIntervalMS (uint16_t min_ms, uint16_t max_ms);
98
+ uint16_t connHandle (void );
99
+ bool connBonded (void );
100
+ uint16_t connInterval (void );
101
+ void clearBonds (void );
102
102
103
103
ble_gap_addr_t peerAddr (void );
104
104
105
105
bool txbuf_get (uint32_t ms);
106
106
107
- COMMENT_OUT ( bool setPIN (const char * pin); )
108
-
109
107
/* ------------------------------------------------------------------*/
110
- /* Central API object
111
- *------------------------------------------------------------------*/
112
- BLECentral Central;
113
-
114
- /* ------------------------------------------------------------------*/
115
- /* Callback
108
+ /* Callbacks
116
109
*------------------------------------------------------------------*/
117
110
typedef void (*connect_callback_t ) (void );
118
111
typedef void (*disconnect_callback_t ) (uint8_t reason);
119
112
120
113
void setConnectCallback ( connect_callback_t fp);
121
114
void setDisconnectCallback ( disconnect_callback_t fp);
122
115
116
+ COMMENT_OUT ( bool setPIN (const char * pin); )
117
+
123
118
// internal usage only
124
119
err_t _registerCharacteristic (BLECharacteristic* chars);
125
120
@@ -194,6 +189,3 @@ COMMENT_OUT(
194
189
};
195
190
196
191
extern AdafruitBluefruit Bluefruit;
197
-
198
-
199
-
0 commit comments