[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bluetooth-dev] hci command timers



Mats Fridén wrote:

> We should release the timer when the host controller is ready to receive a new command from the host.

Ah... ok, I checked the spec and now I understand.

> In some cases this is when we receive a Command Complete and in some cases this is when we receive a Command Status. Though I agree that, we shouldn't always delete the timer when we receive a Command Status. I would be more correctly if we only deleted the timers for those command that have set the timers.

>
> I don't have time to go through this in the code right now, so you more than welcome to do it :)
>

Ok. My idea is to add a global cmd_timer_active flag. If it's set when we get a Command_Result or a Command_Status packet then we'll cancel the timer and post a wakeup. We'll set the flag when we set the timer and clear it when we clear the timer. I assume we'll need cli()/sti() protection... though maybe not (I'll doublecheck if the existing semaphores protect us). Thoughts?

--gmcnutt

-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com