locked
seems the fucntion BthGetMode doesn't work, the error is 1359(an internal error occurs) RRS feed

  • Question

  • hi, experts
        I tried to get the bluetooth mode by the fucntion BthGetMode,  however, it seems  that the fucntion always doesn't work,  the return error is  1359(an internal error occurs).
      here is the code:
     
      DWORD mode = 0;
      int retBlue = BthGetMode( &mode);
      if ( ERROR_SUCCESS == retBlue )
      {
        //do something
      }else{
         //
      }

    thanks
    MobileLover
    Wednesday, November 4, 2009 2:14 AM

Answers

  • The following page will show you how to check the status of Microsoft bluetooth stack:
    Bluetooth Stack Status  
     
    There is also a sample in WM6 SDK (Windows Mobile 6 SDK Samples\PocketPC\CPP\win32\Bluetooth\btsearch). Here is a code snippet from it:

     // initialize searching procedure
     iResult = WSALookupServiceBegin(&wsaq,
      LUP_CONTAINERS,
      &hLookup);
     
     if (iResult != 0)
     {
      TCHAR tszErr[32];
      iResult = WSAGetLastError(); 
      ... ...
     }

    WSAGetLastError will return WSAENETDOWN if device doesn't have MS stack.

    A bluetooth stack other than MS's has its own API. Please read the following article for more details:
    Get Familiar: Microsoft Bluetooth Stack on Windows Mobile
     


    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    • Marked as answer by warrentang Tuesday, November 10, 2009 8:29 AM
    Monday, November 9, 2009 7:30 AM

All replies

  • Does the device use Microsoft stack or Broadcom stack? BthGetMode only works with Microsoft stack.


    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    Friday, November 6, 2009 6:38 AM
  • My device is the phone LG KT878. but how to check the bluetooth stack?


    thanks
    Monday, November 9, 2009 1:34 AM
  • The following page will show you how to check the status of Microsoft bluetooth stack:
    Bluetooth Stack Status  
     
    There is also a sample in WM6 SDK (Windows Mobile 6 SDK Samples\PocketPC\CPP\win32\Bluetooth\btsearch). Here is a code snippet from it:

     // initialize searching procedure
     iResult = WSALookupServiceBegin(&wsaq,
      LUP_CONTAINERS,
      &hLookup);
     
     if (iResult != 0)
     {
      TCHAR tszErr[32];
      iResult = WSAGetLastError(); 
      ... ...
     }

    WSAGetLastError will return WSAENETDOWN if device doesn't have MS stack.

    A bluetooth stack other than MS's has its own API. Please read the following article for more details:
    Get Familiar: Microsoft Bluetooth Stack on Windows Mobile
     


    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    • Marked as answer by warrentang Tuesday, November 10, 2009 8:29 AM
    Monday, November 9, 2009 7:30 AM