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) :
28
28
clearAddress ();
29
29
}
30
30
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
-
49
31
bool
50
32
BLECentralHelper::connected () {
51
33
poll ();
52
34
53
35
return (*this && *this == _peripheral->central ());
54
36
}
55
37
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
-
81
38
void
82
39
BLECentralHelper::poll () {
83
40
_peripheral->poll ();
Original file line number Diff line number Diff line change @@ -36,13 +36,6 @@ class BLECentralHelper: public BLEHelper{
36
36
* @return boolean_t true if the central is connected, otherwise false
37
37
*/
38
38
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 ;
46
39
47
40
/* *
48
41
* Disconnect the central if it is connected
@@ -55,16 +48,11 @@ class BLECentralHelper: public BLEHelper{
55
48
*/
56
49
void poll (void );
57
50
58
- operator bool (void ) const ;
59
- bool operator ==(const BLECentralHelper& rhs) const ;
60
- bool operator !=(const BLECentralHelper& rhs) const ;
61
-
62
51
protected:
63
52
BLECentralHelper (BLEPeripheralRole* peripheral);
64
53
65
54
private:
66
55
BLEPeripheralRole* _peripheral;
67
- bt_addr_le_t _address;
68
56
};
69
57
70
58
#endif
You can’t perform that action at this time.
0 commit comments