java - Windows Mobile Bluetooth access on either Microsoft or Widcomm Stack -
i have java application running on windows mobile device. need able turn bluetooth on , off executing native code this. problem trying out on new device (the htc hd2) , native code doesn't work. reason hd2 device using widcomm bluetooth stack, whereas other device using microsoft stack.
i have found way of activating bluetooth on hd2 device using widcomm sdk. native code needs able run on device, somehow need able make decision @ runtime code run based on bluetooth stack present.
question 1: how can determine programmatically stack present?
question 2: if include header file required widcomm stack , try run on device doesn't use code fails. how can compile dll includes header file if widcomm dll exists?
i'm guessing can have dynamically:
- declare prototypes necessary widcomm functions in own code.
- use
loadlibrary
load widcomm dll. - if
loadlibrary
call fails know you're on microsoft stack , can run standard microsoft stack functions. - if
loadlibrary
succeeds you're on widcomm stack , can use widcomm functions.
it might bit messy depending on how many functions need widcomm header, can't statically compile in references functions, try , load , not find (which why you're seeing crash).
that's terrible bluetooth stack craziness exists on windows mobile well. thought confined desktop.
Comments
Post a Comment