Thank you @jagobagascon and others for the work. Unfortunately on Windows (11) the AdvertisementPayload or manufacturer data is empty.
However, via Python I receive that data just fine, on the same machine.
Python code:
```Python
import asyncio
from bleak import BleakScanner
def print_advertisement(device, advertisement_data):
# Check if the device name starts with "BTH"
if device.name and device.name.startswith("BTH"):
print(f"Found Device - Name: {device.name}, Address: {device.address}, RSSI: {device.rssi}")
print("Advertisement Data:", advertisement_data)
async def main():
# Start scanning with a callback to filter devices by name
scanner = BleakScanner()
scanner.register_detection_callback(print_advertisement)
print("Scanning for BLE devices...")
await scanner.start()
# Scan for 30 seconds
await asyncio.sleep(30000)
await scanner.stop()
print("Scan completed.")
# Run the main function
asyncio.run(main())
```
I see this from args.GetAdvertisement();
*advertisement.BluetoothLEAdvertisement {IUnknown: github.com/go-ole/go-ole.IUnknown {RawVTable: *(unreadable could not resolve interface type)}}
Thank you @jagobagascon and others for the work. Unfortunately on Windows (11) the AdvertisementPayload or manufacturer data is empty. However, via Python I receive that data just fine, on the same machine.
Go results:
Go code:
```Go package main import ( "fmt" "strings" "tinygo.org/x/bluetooth" ) func main() { adapter := bluetooth.DefaultAdapter // Enable BLE adapter err := adapter.Enable() if err != nil { fmt.Printf("Error enabling adapter: %s\n", err) return } fmt.Println("Scanning for BLE devices...") err = adapter.Scan(func(adapter *bluetooth.Adapter, advertisement bluetooth.ScanResult) { // Check if the device name is available and starts with "BTH" if advertisement.LocalName() != "" && strings.Contains(advertisement.LocalName(), "T") { fmt.Printf("%s, Address: %s, RSSI: %d, Data:%v\n", advertisement.LocalName(), advertisement.Address.String(), advertisement.RSSI, advertisement.AdvertisementPayload, ) } }) if err != nil { fmt.Printf("Error during scan: %s\n", err) } } ```Python results:
Python code:
```Python import asyncio from bleak import BleakScanner def print_advertisement(device, advertisement_data): # Check if the device name starts with "BTH" if device.name and device.name.startswith("BTH"): print(f"Found Device - Name: {device.name}, Address: {device.address}, RSSI: {device.rssi}") print("Advertisement Data:", advertisement_data) async def main(): # Start scanning with a callback to filter devices by name scanner = BleakScanner() scanner.register_detection_callback(print_advertisement) print("Scanning for BLE devices...") await scanner.start() # Scan for 30 seconds await asyncio.sleep(30000) await scanner.stop() print("Scan completed.") # Run the main function asyncio.run(main()) ```Any idea what could be fixed?