RE: Problem on HCI Command via Bluetooth Extension Layer
- From: RichardMAN <RichardMAN@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Apr 2007 01:54:03 -0700
It works!!!! thank you very much for your help. much appreciated !!!
"sea horse" wrote:
Because the HCI code have some problem..
When you call typedef int (*HCI_CustomCode_In) (HANDLE hDeviceContext,
void *pCallContext, unsigned short usOpCode, unsigned short cPacketSize,
unsigned char *pPacket, PacketMarker *pMarker, unsigned char cEvent);
the parameter(cEvent) you set what?
for example when you sent the HCI command (0xfc -- OCF) , you will return
the (0xff) event, so you must set the cEvent = 0xff, but MS Bt stack set:
#define HCI_NO_EVENT 0xff
so you have to change it in the bt_ddi.h
you can see the function
static void ProcessEvent (unsigned char *pBuffer, int cSize)
if the event code is not in the
enum HCI_EVENT_CODE {。。。}
it will come in the function UnknownEvent (cEventCode, cLength, pParms);
but it the function find the command packet in the (gpHCI->pPacketsPending)
eg. HCIPacket *pPacket = ExtractCommandPacketByEvent
(&gpHCI->pPacketsPending, cEventCode);
because it find fail the command packet, so when it call back your
HCI_CustomCodeEvent function. the pCallContext = NULL.
I change the ProcessEvent () function to support the CSR event. and
successful!
You can try it! good luck!
in HCI.cxx
if
"RichardMAN" wrote:
Dear All
I have create a HCI extension layer for issuing Vendor/Manufacturer specific
HCI commands, via HCI_CustomCode_In HCI interface callback, and I am able to
receive correct responses via HCI_CustomCodeEvent event.
However, any success HCI call will cause the extension later to receive
"STACK DOWN" indication, i.e. BT stack is down., within seconds right after
the corresponding HCI response is received.
Would anyone knows if there is anything I need to response to
HCI_CustomCodeEvent event callback?
One thing I noticed, is that for CallContext I pass into HCI_CustomCode_In,
I do not get the same CallContext pointer in HCI_CustomCodeEvent event
callback. In fact, HCI_CustomCodeEvent returns a NULL CallContext to me. And
there is UserContext HCI_CustomCodeEvent being returned, which I don't know
what it is, contain a non-NULL pointor.
typedef int (*HCI_CustomCode_In) (HANDLE hDeviceContext, void *pCallContext,
unsigned short usOpCode, unsigned short cPacketSize, unsigned char *pPacket,
PacketMarker *pMarker, unsigned char cEvent);
typedef int (*HCI_CustomCodeEvent) (void *pUserContext, void *pCallContext,
unsigned char cEventCode, unsigned char cEventLength, unsigned char *pEvent);
Before receiving STACK DOWN indication, I will also get a hci_AbortCall call
back. hci_AbortCall returns the same CallContext I passed into
HCI_CustomCode_In to me.
Can someone suggest where I should look at to tack down the reason why the
BT stack will goes down right after I send a vendor specific HCI command and
with success and correct HCI response?
Regards
RichardMAN
- References:
- RE: Problem on HCI Command via Bluetooth Extension Layer
- From: sea horse
- RE: Problem on HCI Command via Bluetooth Extension Layer
- Prev by Date: Ethernet Emulation
- Next by Date: Re: Ethernet Emulation
- Previous by thread: RE: Problem on HCI Command via Bluetooth Extension Layer
- Next by thread: Re: Problem to update device time using SNTP
- Index(es):
Relevant Pages
|