File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 40
40
speed_cad_connection = pyloton .speed_cad_connect ()
41
41
if not radio :
42
42
print ("Running ams_connection" )
43
- radio = ams_connection
43
+ radio = pyloton . ams_connect ()
44
44
45
45
if time .time ()- start >= 45 :
46
46
pyloton .timeout ()
Original file line number Diff line number Diff line change @@ -153,22 +153,23 @@ def heart_connect(self):
153
153
return self .hr_connection
154
154
155
155
def ams_connect (self ):
156
- self .radio = adafruit_ble .BLERadio ()
156
+ self ._status_update ("Connect your phone now" )
157
+ radio = adafruit_ble .BLERadio ()
157
158
a = SolicitServicesAdvertisement ()
158
159
a .solicited_services .append (AppleMediaService )
159
- self . radio .start_adversising (a )
160
+ radio .start_advertising (a )
160
161
161
- while not self . radio .connected :
162
+ while not radio .connected :
162
163
pass
163
164
164
- print ( "connected " )
165
+ self . _status_update ( "Connected " )
165
166
166
- for connection in self . radio .connections :
167
+ for connection in radio .connections :
167
168
if not connection .paired :
168
169
connection .pair ()
169
- print ("paired" )
170
+ self . _status_update ("paired" )
170
171
known_notifications = set ()
171
-
172
+ self . radio = radio
172
173
return self .radio
173
174
174
175
You can’t perform that action at this time.
0 commit comments