File tree Expand file tree Collapse file tree 2 files changed +0
-55
lines changed Expand file tree Collapse file tree 2 files changed +0
-55
lines changed Original file line number Diff line number Diff line change @@ -28,56 +28,13 @@ BLECentralHelper::BLECentralHelper(BLEPeripheralRole* peripheral) :
2828 clearAddress ();
2929}
3030
31- BLECentralHelper::operator bool () const {
32- bt_addr_le_t zero;
33-
34- memset (&zero, 0 , sizeof (zero));
35-
36- return (memcmp (&_address, &zero, sizeof (_address)) != 0 );
37- }
38-
39- bool
40- BLECentralHelper::operator ==(const BLECentralHelper& rhs) const {
41- return (memcmp (&_address, &rhs._address , sizeof (_address)) == 0 );
42- }
43-
44- bool
45- BLECentralHelper::operator !=(const BLECentralHelper& rhs) const {
46- return !(*this == rhs);
47- }
48-
4931bool
5032BLECentralHelper::connected () {
5133 poll ();
5234
5335 return (*this && *this == _peripheral->central ());
5436}
5537
56- const char *
57- BLECentralHelper::address () const {
58- static char address[18 ];
59-
60- String addressStr = " " ;
61-
62- for (int i = 5 ; i >= 0 ; i--) {
63- unsigned char a = _address.val [i];
64-
65- if (a < 0x10 ) {
66- addressStr += " 0" ;
67- }
68-
69- addressStr += String (a, 16 );
70-
71- if (i > 0 ) {
72- addressStr += " :" ;
73- }
74- }
75-
76- strcpy (address, addressStr.c_str ());
77-
78- return address;
79- }
80-
8138void
8239BLECentralHelper::poll () {
8340 _peripheral->poll ();
Original file line number Diff line number Diff line change @@ -36,13 +36,6 @@ class BLECentralHelper: public BLEHelper{
3636 * @return boolean_t true if the central is connected, otherwise false
3737 */
3838 bool connected (void );
39-
40- /* *
41- * Get the address of the Central in string form
42- *
43- * @return const char* address of the Central in string form
44- */
45- const char * address (void ) const ;
4639
4740 /* *
4841 * Disconnect the central if it is connected
@@ -55,16 +48,11 @@ class BLECentralHelper: public BLEHelper{
5548 */
5649 void poll (void );
5750
58- operator bool (void ) const ;
59- bool operator ==(const BLECentralHelper& rhs) const ;
60- bool operator !=(const BLECentralHelper& rhs) const ;
61-
6251 protected:
6352 BLECentralHelper (BLEPeripheralRole* peripheral);
6453
6554 private:
6655 BLEPeripheralRole* _peripheral;
67- bt_addr_le_t _address;
6856};
6957
7058#endif
You can’t perform that action at this time.
0 commit comments