Kernel API to read Bluetooth clock?

I search all Microsoft Bluetooth APIs but couldn’t find one that reads the Bluetooth clock value like the HCI command HCI_Read_Clock does. Does Microsoft Bluetooth stack expose this HCI command to the kernel/user API in SDK/WDK? I would like to call such HCI_Read_Clock API in my kernel or user space program to read the current Bluetooth clock value in real time. Does anybody know how to do this?
Any comment or input is greatly appreciated.

Thanks.

xxxxx@yahoo.com wrote:

I search all Microsoft Bluetooth APIs but couldn’t find one that reads the Bluetooth clock value like the HCI command HCI_Read_Clock does. Does Microsoft Bluetooth stack expose this HCI command to the kernel/user API in SDK/WDK? I would like to call such HCI_Read_Clock API in my kernel or user space program to read the current Bluetooth clock value in real time. Does anybody know how to do this?

How is that useful? Unlike USB, I didn’t think Bluetooth allowed you to
schedule things in advance.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I am working on a Bluetooth device that has strict timing requirements and it would be really helpful to get real-time Bluetooth clock value (in resolution of 312 us). Do you know such API exist on Windows?

Thanks.

There is no real time in windows. Continuously polling the local radio for the clock value is not feasible, you will consume all of the command credits I would think

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Monday, November 08, 2010 3:18 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Kernel API to read Bluetooth clock?

I am working on a Bluetooth device that has strict timing requirements and it would be really helpful to get real-time Bluetooth clock value (in resolution of 312 us). Do you know such API exist on Windows?

Thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I understand it’s not a RTOS. But the point is, does such Bluetooth clock polling API exist?

Thanks.

xxxxx@yahoo.com wrote:

I understand it’s not a RTOS. But the point is, does such Bluetooth clock polling API exist?

The absolute value of the clock is local to each device. There is no
global clock in Bluetooth. Even if you asked the local radio for its
clock, that wouldn’t help you align that to your device. Using
KeQueryPerformanceCounter has to be a better solution.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

System clock doesn’t help because bluetooth is synced to its own bluetooth clock boundary.
I am using a Bluetooth USB dongle plugged in to a Win7 host. All the USB transactions from the host Bluetooth driver are locked to 625 us clock, and this window is too big for us. I am looking for a way to synchronize with a smaller granularity than 625 us.
If I could query the local Bluetooth clock value, I can find a way to sync more accurately.
So, is there such mechanism to query local Bluetooth clock? I know Bluetooth HCI layer stack implements HCI_read_clock command which does exactly this. But does Microsoft expose this to some API in user or kernel mode app/driver?

Thanks.

xxxxx@yahoo.com wrote:

System clock doesn’t help because bluetooth is synced to its own bluetooth clock boundary.
I am using a Bluetooth USB dongle plugged in to a Win7 host. All the USB transactions from the host Bluetooth driver are locked to 625 us clock, and this window is too big for us. I am looking for a way to synchronize with a smaller granularity than 625 us.

Bluetooth runs on a 3.2kHz clock, which means a 312.5us cycle time. So,
you’re getting 2 clock cycle granularity as it is. If your device is
syncing to USB as well, it’s not entirely clear to me that it is
possible to do any better.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Not exposed at all. If you need micro second accuracy on windows to something via usb connected bth dongle, you are hosed. Even if you got the clock, who knows how old that value is b/c the usb bus itself does not tell you how long it took to send and complete the transfer

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Monday, November 08, 2010 4:17 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Kernel API to read Bluetooth clock?

System clock doesn’t help because bluetooth is synced to its own bluetooth clock boundary.
I am using a Bluetooth USB dongle plugged in to a Win7 host. All the USB transactions from the host Bluetooth driver are locked to 625 us clock, and this window is too big for us. I am looking for a way to synchronize with a smaller granularity than 625 us.
If I could query the local Bluetooth clock value, I can find a way to sync more accurately.
So, is there such mechanism to query local Bluetooth clock? I know Bluetooth HCI layer stack implements HCI_read_clock command which does exactly this. But does Microsoft expose this to some API in user or kernel mode app/driver?

Thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer