PDA

View Full Version : How to write a BT application?


scarletbast
01-11-2004, 20:45
Hi all. I'm currently doing a project to obtain the RSSI value of another BT device. It should be simple enough to anser so I really hope someone can help.

I'm using a USB dongle and BlueLab.

My question is, do I have to do all the initialisation procedure like the manual says (i.e initialise the scheduler, configure the HCI driver, etc)? The example applications provided (e.g bridge.c) do not follow this procedure.

Also when to call the Sched() (do I even have to call it)? In the bridge.c for example, it is called at the end of main(). What if there is an event occurring before this function is called. Will I miss the event?

Generally this is what I've done so far. Please feel free to comment on it:
------------------------------------------------
#define malloc macros

int main()
{
call functions
}

void function()
{
call #define to malloc for this prim (e.g MAKE_PRIM_C(DM_HCI_INQUIRY))
set param
VmSendBlueStackPrim(DM_PRIM,prim);
}

void handleBlueStack()
{
case statements
}

Thanks everyone.