pycycling.rear_view_radar module¶
A module for interacting with Bluetooth LE devices which support the Radar (RDR) service
Jason Sohn 2022
This service is tested on Garmin Varia RVR315. Other models which are expected to support RDR service are:
Garmin RTR515, RTR516 (German market version), and RCT715
Bryton Gardia R300
Magene L508
Example¶
This example prints radar information broadcast from the Bluetooth device to the console. Please see also information on obtaining the Bluetooth address of your device.
import asyncio
from bleak import BleakClient
from pycycling.rear_view_radar import RearViewRadarService
async def run(address):
async with BleakClient(address) as client:
def my_measurement_handler(data):
print(data)
await client.is_connected()
radar_service = RearViewRadarService(client)
radar_service.set_radar_measurement_handler(my_measurement_handler)
await radar_service.enable_radar_measurement_notifications()
await asyncio.sleep(30.0)
await radar_service.disable_radar_measurement_notifications()
if __name__ == "__main__":
import os
os.environ["PYTHONASYNCIODEBUG"] = str(1)
device_address = "DEVICE_ADDRESS_HERE"
loop = asyncio.get_event_loop()
loop.run_until_complete(run(device_address))