Sign in to follow this  
Followers 0
PhoenixXL

BlueSoleil Windows need help

9 posts in this topic

#1 ·  Posted (edited)

Hey Every 1

I was trying to make app which I could use to communicate with my mobile using Bluetooth

Unfortunately I'm having Bluesoleil and I didnt find a proper UDF for Bluesoleil

Therefore I tried to figure out some Functions

I get the error in the DllCall that is @error=1 Unable to use the DLL file

I dont understand if two functions can be used of the same DLL then why this particular error "Unable to use the DLL file" :huh:

I have already searched the Forum and even on Google but no luck

Here is the Total Code

#include <Array.au3>

Opt('TrayIconDebug',1)
OnAutoItExitRegister('_Exit')

Global $dllCallError[6] = [5,"Unable to use the DLL file","Unknown return type","Function not found in the Dll file",'Bad Number of Parameters','Bad Parameter']
Global $nDll=DllOpen(@ScriptDir&'btfunc.dll')


Global const $DEVICE_ADDRESS_LENGTH = 6
Global const $DEVICE_CLASS_LENGTH = 3
Global const $MAX_DEVICE_NAME_LENGTH = 64
Global Const $INQUIRY_GENERAL_MODE=0x00
Global Const $EVENT_INQUIRY_DEVICE_REPORT=0x06


Global $nFunc

Func _IsBluetoothReady($dwSeconds=1)
Local $aCall=DllCall($nDll,'BOOL:cdecl','BT_IsBluetoothReady','DWORD',$dwSeconds)
If @error Then Return DebugOut('!>'&$dllCallError[@error])
Return $aCall[0]
EndFunc

Func DebugOut($sOut)
ConsoleWrite($sOut&@CRLF)
Return -1
EndFunc

Func _StopBluetooth($bSwitch2HidMode)
Local $aCall=DllCall($nDll,'DWORD:cdecl','BT_StopBluetooth','BOOL',$bSwitch2HidMode)
If @error Then Return DebugOut('!>'&$dllCallError[@error])
Return $aCall[0]
EndFunc

Func _InitializeLibrary()
Local $aCall=DllCall($nDll,'Bool:cdecl','BT_InitializeLibrary')
If @error Then Return DebugOut('!>'&$dllCallError[@error])
Return $aCall[0]
EndFunc


Func _UninitializeLibrary()
DllCall($nDll,'none:cdecl','BT_UninitializeLibrary')
EndFunc


Func _InquireDevices()
$str= "DWORD dwSize;byte address[" & $DEVICE_ADDRESS_LENGTH & "];byte classOfDevice[" & $DEVICE_CLASS_LENGTH & "];char szName[" & $MAX_DEVICE_NAME_LENGTH & "];BOOL bPaired"
$struct_BLUETOOTH_DEVICE_INFO = DllStructCreate($str)
DllStructSetData($struct_BLUETOOTH_DEVICE_INFO,1,DllStructGetSize($struct_BLUETOOTH_DEVICE_INFO))
;$lpDevsListLength = DllStructCreate("DWORD")
;DllStructSetData($lpDevsListLength,1,DllStructGetSize($struct_BLUETOOTH_DEVICE_INFO))

$dll = DllCall($nDll,"dword","BT_InquireDevices" _
,"uchar",$INQUIRY_GENERAL_MODE _
,"uint",0x30 _
,"dword*",0 _
,"struct*",0)
If @error Then Return DebugOut('! _InquireDevices > '&$dllCallError[@error])
_ArrayDisplay($dll,"BT_InquireDevices")
EndFunc

Func _GetLocalDeviceInfo ()
Local $str= "DWORD dwSize;byte address[" & $DEVICE_ADDRESS_LENGTH & "];byte classOfDevice[" & $DEVICE_CLASS_LENGTH & "];char szName[" & $MAX_DEVICE_NAME_LENGTH & "];BOOL bPaired;"& _
'UCHAR ucLmpVersion;'& _
'WORD wManuName;'& _
'WORD wLmpSubversion;'& _
'BYTE reserved[16];'& _
'WORD wClockOffset;'& _
'BOOL bConnected;'& _
'DWORD dwDataRecvBytes;'& _
'DWORD dwDataSentBytes;'& _
'CHAR cSignalStrength'
Local $nFunc=DllStructCreate($str)
DllStructSetData($nFunc,1,DllStructGetSize($nFunc))
Local $aCall=DllCall($nDll,'DWORD:cdecl','BT_GetLocalDeviceInfo','long',0x00000001,'struct*',DllStructGetPtr($nFunc))
If @error Then Return DebugOut('! _GetLocalDeviceInfo > '&$dllCallError[@error])
Return $aCall[0]
EndFunc

Func _RegisterCallback()
Global $nFunc=DllCallbackRegister('_InquiredDevices','none:cdecl','ptr')
Local $aCall=DllCall($nDll,'DWORD:cdecl','BT_RegisterCallback','CHAR',$EVENT_INQUIRY_DEVICE_REPORT,'ptr',DllCallbackGetPtr($nFunc))
If @error Then Return DebugOut('! _RegisterCallback > '&$dllCallError[@error])
Return $aCall[0]
EndFunc

Func _InquiredDevices($BLUETOOTH_DEVICE_INFO_Struct)
For $i=1 To 5
DebugOut('Data:'&DllStructGetData($BLUETOOTH_DEVICE_INFO_Struct,$i))
Next
EndFunc

Func _Exit()
DllCallbackFree($nFunc)
_UninitializeLibrary()
DllClose($nDll)
EndFunc


DebugOut('_InitializeLibrary Return_Code:'&_InitializeLibrary())
DebugOut('_RegisterCallback Return_Code:'&_RegisterCallback())
DebugOut('_InquireDevice Return_Code:'&_InquireDevices())
DebugOut('_GetLocalDeviceInfo Return_Code:'&_GetLocalDeviceInfo()) ; Return Code 9 => BTSTATUS_PARAMETER_ERROR 0x00000009

The total Documentation is attached to the post

But the Constants are not present in the Documentation

Therefore I also posted the Header files

Place the Dll in the script dir

Thanks for your time :D

Regards

Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites



Anyone!

Please help me

Require it


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Not a pro at this subject, but what makes you use c-style declarations in dllcall?

I tried with _IsBluetoothReady() function, however, AutoIt fails to execute, popping up missing Dll files message like BsSDK.dll, BsTrace.dll, BsCommon.dll :D

Edited by MKISH

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites

Okay here are those Dlls

Maybe it got installed in my SystemDir when the Bluesoleil was being installed

Check the Attachment


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The Sequence should be

Typical API Calling Sequence:

1) BT_InitializeLibrary

2) BT_RegisterCallback

3) BT_InquireDevices

4) BT_PairDevice

5) BT_BrowseServices

6) BT_ConnectService

7) BT_DisconnectService

8) BT_UninitializeLibrary

in accordance to the Documentation

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

PhoenixXL, add BsProfileFunc.dll and BsMobileSDK.dll to the list as well...


----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites

Added all the requirement according to you


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

PhoenixXL, I have a final suggestion regarding files, please tell me where I can get BlueSoleil setup program (I hope it is small), as it still doesn't work.


----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites

But it is not Freeware though you can use the Trial Version

Here is the LINK

Its 61 MB.

U already tried to help me

thnx for that :D

If the size is much enough then dont bother

Thnx Again


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0