Jump to content

Search the Community

Showing results for tags 'android'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 13 results

  1. Hello all, First, I wish you a happy new year. I am building with autoit a substitution tool to sync my iTunes playlist with my android phone. I have managed reading the itunes lib, but now I am stuck at reading / writing on my android device. From all the searches I made, it is using MTP protocol. The Windows Explorer can read and write on the device. The device appears as a "portable device". Does anyone of you can direct me in some direction to keep investigate. Thanks in advance Gilles
  2. This is an small script to Control Android Devices by USB using adb, you can use it with phones with a Cracked Screen or not working Touch Screen. What it Does: - Show your Android Screen on your Desktop. - Allow you to Swipe or Tap on the screen. - Allow you to send BACK button event. - Allow you to send WakeUp event. - Allow you to move in List Menu using Swipe gestures or Mouse Wheel Forward or Backward. - Refresh Screen with Wheel Click(Wheel Down)(To update your device screen on your desktop view). - Allow you to unlock your Device with Pattern only 3 points pattern for now. What it does not: - Complex Unlock Pattern not supported yet I'm working on that. - Complex Swipe gesture not supported yet, only straight lines. - PC Keyboard to write SMS or Email not Supported yet, I'm working on that. - Volume UP or Down not supported yet I will add it soon. - No configuration interface or file yet, keys and actions are pre set on script code. I will change that. What it Requires: - In order to Compile the Script you need 3 files: adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll - In order to use the script without these files or without compile it you need to copy that files to user Temp Dir, or windows Temp dir I mean @TempDir. Keys Used and Notes: - Left Click will tap on the screen. - Keep Left Click down, move the mouse and release it with perform a Swipe operation.(Mouse Drag = Swipe). - Right Click will go back. - Enter on the keyboard will send WakeUp event(Power Button) - Wheel Down will Refresh the screen on your desktop, also F5.(Take last pictures of your android device screen) IMPORTANT: There is an $scale variable on the script that scale down your Phone screenshot image to a good resolution to show on your Desktop, I use 1.5 of scale factor because my phone resolution is 480x800 and my Desktop Screen is 1366x768 and that scale factor is good enough for me.(I will calculate that in the future to make it automatic). IMPORTANT 2: If you feel is very slow feel free to decrease Sleep() values from 400 to 200, that will be faster but you will need to Refresh with Wheel Click after you perform certain actions. Thanks and Credits: UDFs\MouseControl.au3 Base on Low Level Mouse Hook by @_Kurt all credits to him. UDFs\GUICtrlPicPNG.au3 Based on PNG work around by @UEZ from the help file, All credits to him. Kind Regards Alien. AndroidControl.zip
  3. I am a huge autoit fan and have written several graphical apps. I would love to get started building simple and complex android apps. I am hoping someone here can recommend a good platform to get started with. Preferably something that had an Autoit-like feel
  4. Hi there - creating a simple script to triger cctv software to turn on when my phone is not connected to home wifi. But having issues with my phone (samsung s7) not answering ping when sleeping (despite wifi set to work when sleep) - not sure the issue... and ideas? Alternatively was wondering about pinging the bluetooth address of the phone - anyway to get this working in autoit?
  5. Hi, I would like to share this simple project which aims to be a first approach in order to use AutoIt as scripting language for mobile automation (Android). This project is an ImperiusGeorge client for mobile test automation that support native Android apps. You can find more information at https://ohtejera.github.io/ImperiusAutoIt and here's the link to the project on Github: https://github.com/ohtejera/ImperiusAutoIt Best regards. Henry
  6. Hello Im wondering if using this https://ohtejera.github.io/ImperiusAutoIt/#started UDF can i make that I can control my windows application with phone? like for example click button Start on android phone and then something would be done in my windows app?
  7. Hi All, I didn't know where to put this; my apologies if this is the wrong location. When you plug a Samsung mobile device (phone, tablet, etc.) into the USB of a Windows PC, you can right-click the device in My Computer and select Properties. Here, it will show you the correct serial number of the device. Clearly Windows doesn't use adb to get the SN so I'm stuck at how to get the SN without adb and where the device doesn't have a drive letter assigned to it. When I last picked this up, I tried seemingly everything I could from wmi(?) and winmgmts(?) but either it's hidden cloak-and-dagger style or I can't see the forest for the trees... Does anyone know what API Windows uses when getting the serial number of a device Windows calls a Portable Media Player?
  8. Hello, I found a couple of threads asking quite similar questions, but without finding a "straight" solution to Access the internal phone storage as well as the plugged in SD-Card. While the SD Card is quite an easy Job (shutdown phone, remove SD, plug into some Card Reader, Access it using a drive letter), the internal storage isn't accessible this way. Of course I *CAN* Access all the (regular visible) Content, when connected to a Windows box. But this way I cannot estimate, where all the space was eaten up. So I'd like to know, how to address the "root" Folder of the internal storage of my Android Phone to get it's subfolders and files. Going through the whole Folder tree recursively isn't my Problem, it's just howto address the very first Folder and then to read all files (with sizes) and names of the subfolders. Regards, Rudi.
  9. Hi all - was wondering if the following is possible: I have a motion detecting ccrv software on PC (icam or similar) - there is a bottom that turn surveillance (motion detection) on and off. I can get autoit to automate the clicking on the button. I want my android phone to send a trigger every time it disconnect from the home network (i.e when I leave home) to tell autoit to turn on surveillance and when reconnecting to home network to trigger it to click off does any one have a suggestion how to go about achieving this?
  10. Connect Android phone > enable USB file transfer > go to My Computer, there's an icon, but no drive letter - this is normal. Open phone icon > go to Internal Storage > go to DCIM > copy all files and folders to computer. Now, I want a quick AutoIt script / windows batch to do this automatically. Get USB path with this - it works OK: #include <WinAPICom.au3> Global Const $sCLSID_PortableDeviceManager = "{0af10cec-2ecd-4b92-9581-34f6ae0637f3}" Global Const $sIID_IPortableDeviceManager = "{a1567595-4c2f-4574-a6fa-ecef917b9a40}" Global Const $sTagIPortableDeviceManager = "GetDevices hresult(ptr;dword*); RefreshDeviceList hresult(); " & _ "GetDeviceFriendlyName hresult(wstr;wstr;dword*); GetDeviceDescription hresult(wstr;wstr;dword*); " & _ "GetDeviceManufacturer hresult(wstr;wstr;dword*); GetDeviceManufacturer hresult(wstr;wstr;ptr;dword*dword*); " & _ "GetPrivateDevices hresult(ptr;dword*)" Global Enum $eDevID, $eDevName, $eDevManufacturer, $eDevDescription Local $aPnPDevices = GetPortableDevices() If IsArray($aPnPDevices) Then _ArrayDisplay($aPnPDevices) ;~ Success: Return 0 ;~ Failure: Return 2DArray [n][4] |;[n][0]$eDevID, [n][1]$eDevName, [n][2]$eDevManufacturer,[n][3] $eDevDescription Func GetPortableDevices() Local $aDevicesInfo[0][0] ;[n][0]$eDevID, [n][1]$eDevName, [n][2]$eDevManufacturer,[n][3] $eDevDescription Local $oPortableDeviceManager = 0 Local $SizeofArray = 0 Local $hr = 0x80004005 ;E_Fail Just to Initialized <0 Local $taPnPDeviceIDs = 0 Local $tName = 0 $oPortableDeviceManager = ObjCreateInterface($sCLSID_PortableDeviceManager, $sIID_IPortableDeviceManager, $sTagIPortableDeviceManager) If Not IsObj($oPortableDeviceManager) Then Return 0 If FAILED($oPortableDeviceManager.GetDevices(Null, $SizeofArray)) Then Return 0 If $SizeofArray < 1 Then Return 0 $taPnPDeviceIDs = DllStructCreate("ptr[" & $SizeofArray & "]") If FAILED($oPortableDeviceManager.GetDevices(DllStructGetPtr($taPnPDeviceIDs), $SizeofArray)) Then Return 0 ReDim $aDevicesInfo[$SizeofArray][4] For $i = 0 To $SizeofArray - 1 $tName = DllStructCreate("wchar[512]", DllStructGetData($taPnPDeviceIDs, 1, $i + 1)) $aDevicesInfo[$i][$eDevID] = DllStructGetData($tName, 1) $aDevicesInfo[$i][$eDevName] = _GetFriendlyName($oPortableDeviceManager, $aDevicesInfo[$i][$eDevID]) $aDevicesInfo[$i][$eDevManufacturer] = _GetDeviceManufacturer($oPortableDeviceManager, $aDevicesInfo[$i][$eDevID]) $aDevicesInfo[$i][$eDevDescription] = _GetDeviceDescription($oPortableDeviceManager, $aDevicesInfo[$i][$eDevID]) $tName = 0 _WinAPI_CoTaskMemFree(DllStructGetData($taPnPDeviceIDs, 1, $i + 1)) Next Return $aDevicesInfo EndFunc ;==>GetPortableDevices Func _GetDeviceManufacturer($oInterface, $PnPDeviceID) Local $sString = "" $oInterface.GetDeviceManufacturer($PnPDeviceID, $sString, 128) Return $sString EndFunc ;==>_GetDeviceManufacturer Func _GetDeviceDescription($oInterface, $PnPDeviceID) Local $sString = "" Local Const $Size = 128 $oInterface.GetDeviceDescription($PnPDeviceID, $sString, 128) Return $sString EndFunc ;==>_GetDeviceDescription Func _GetFriendlyName($oInterface, $PnPDeviceID) Local $sString = "" Local Const $Size = 128 $oInterface.GetDeviceFriendlyName($PnPDeviceID, $sString, 128) Return $sString EndFunc ;==>_GetFriendlyName Func _GetProperty($oInterface, $PnPDeviceID) Local $sString = "" Local Const $Size = 128 $oInterface.GetDeviceFriendlyName($PnPDeviceID, $sString, 128) Return $sString EndFunc ;==>_GetProperty Func FAILED($hr) Return ($hr < 0) EndFunc ;==>FAILED Path looks like this: \\?\usb#vid_0e8d&pid_201d&mi_00#7&37c4bb9&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33} I can open this in a Windows Explorer windows and it works ok. Now, search for files using AutoIt - does not work: #include <GUIConstantsEx.au3> #include <Array.au3> #include <File.au3> Local $f $f = _RecFileListToArray("\\?\usb#vid_0e8d&pid_201d&mi_00#7&37c4bb9&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}", "*.*", 0, 1, 1) _ArrayDisplay($f) ; Name...........: _RecFileListToArray ; Description ...: Lists files and\or folders in a specified path (Similar to using Dir with the /B Switch) ; Syntax.........: _RecFileListToArray($sPath[, $sFilter = "*"[, $iFlag = 0[, $iRecur = 0[, $iFullPath = 0]]]]) ; Parameters ....: $sPath - Path to generate filelist for. ; $sFilter - Optional the filter to use, default is *. Search the Autoit3 helpfile for the word "WildCards" For details. ; $iFlag - Optional: specifies whether to return files folders or both ; |$iFlag=0 (Default) Return both files and folders ; |$iFlag=1 Return files only ; |$iFlag=2 Return Folders only ; $iRecur - Optional: specifies whether to search in subfolders ; |$iRecur=0 (Default) Do not search in subfolders ; |$iRecur=1 Search in subfolders ; $iFullPath - Optional: specifies whether to include initial path in result string ; |$iFullPath=0 (Default) Do not include initial path ; |$iFullPath=1 Include initial path ; Return values .: @Error - 1 = Path not found or invalid ; |2 = Invalid $sFilter ; |3 = Invalid $iFlag ; |4 = Invalid $iRecur ; |5 = Invalid $iFullPath ; |6 = No File/Folder Found ; Author ........: SolidSnake <MetalGX91 at GMail dot com> ; Modified.......: 22 Jan 09 by Melba23 - added recursive search and full path options ; Remarks .......: The array returned is one-dimensional and is made up as follows: ; $array[0] = Number of Files\Folders returned ; $array[1] = 1st File\Folder ; $array[2] = 2nd File\Folder ; $array[3] = 3rd File\Folder ; $array[n] = nth File\Folder ; Related .......: ; Link ..........; ; Example .......; Yes ; ==================================================================================================== ;Special Thanks to Helge and Layer for help with the $iFlag update ; speed optimization by code65536 ;=============================================================================== Func _RecFileListToArray($sPath, $sFilter = "*", $iFlag = 0, $iRecur = 0, $iFullPath = 0) Local $asFileList[1], $sFullPath If Not FileExists($sPath) Then Return SetError(1, 1, "") If StringRight($sPath, 1) <> "\" Then $sPath = $sPath & "\" If (StringInStr($sFilter, "\")) Or (StringInStr($sFilter, "/")) Or (StringInStr($sFilter, ":")) Or (StringInStr($sFilter, ">")) Or (StringInStr($sFilter, "<")) Or (StringInStr($sFilter, "|")) Or (StringStripWS($sFilter, 8) = "") Then Return SetError(2, 2, "") If Not ($iFlag = 0 Or $iFlag = 1 Or $iFlag = 2) Then Return SetError(3, 3, "") If Not ($iRecur = 0 Or $iRecur = 1) Then Return SetError(4, 4, "") If $iFullPath = 0 Then $sFullPath = $sPath ElseIf $iFullPath = 1 Then $sFullPath = "" Else Return SetError(5, 5, "") EndIf _FLTA_Search($sPath, $sFilter, $iFlag, $iRecur, $sFullPath, $asFileList) If $asFileList[0] = 0 Then Return SetError(6, 6, "") Return $asFileList EndFunc ;==>_FileListToArray ; #INTERNAL_USE_ONLY#================================================================================= ; Name...........: _FLTA_Search ; Description ...: Searches folder for files and then recursively searches in subfolders ; Syntax.........: _FLTA_Search($sStartFolder, $sFilter, $iFlag, $iRecur, $sFullPath, ByRef $asFileList) ; Parameters ....: $sStartFolder - Value passed on from UBound($avArray) ; $sFilter - As set in _FileListToArray ; $iFlag - As set in _FileListToArray ; $iRecur - As set in _FileListToArray ; $sFullPath - $sPath as set in _FileListToArray ; $asFileList - Array containing found files/folders ; Return values .: None ; Author ........: Melba23 based on code from _FileListToArray by SolidSnake <MetalGX91 at GMail dot com> ; Modified.......: ; Remarks .......: This function is used internally by _FileListToArray. ; Related .......: ; Link ..........; ; Example .......; ; ==================================================================================================== Func _FLTA_Search($sStartFolder, $sFilter, $iFlag, $iRecur, $sFullPath, ByRef $asFileList) Local $hSearch, $sFile If StringRight($sStartFolder, 1) <> "\" Then $sStartFolder = $sStartFolder & "\" ; First look for filtered files/folders in folder $hSearch = FileFindFirstFile($sStartFolder & $sFilter) If $hSearch > 0 Then While 1 $sFile = FileFindNextFile($hSearch) If @error Then ExitLoop Switch $iFlag Case 0; Both files and folders If $iRecur And StringInStr(FileGetAttrib($sStartFolder & $sFile), "D") <> 0 Then ContinueLoop Case 1; Files Only If StringInStr(FileGetAttrib($sStartFolder & $sFile), "D") <> 0 Then ContinueLoop Case 2; Folders only If StringInStr(FileGetAttrib($sStartFolder & $sFile), "D") = 0 Then ContinueLoop EndSwitch If $iFlag = 1 And StringInStr(FileGetAttrib($sStartFolder & $sFile), "D") <> 0 Then ContinueLoop If $iFlag = 2 And StringInStr(FileGetAttrib($sStartFolder & $sFile), "D") = 0 Then ContinueLoop _FLTA_Add($asFileList, $sFullPath, $sStartFolder, $sFile) WEnd FileClose($hSearch) ReDim $asFileList[$asFileList[0] + 1] EndIf If $iRecur = 1 Then ; Now look for subfolders $hSearch = FileFindFirstFile($sStartFolder & "*.*") If $hSearch > 0 Then While 1 $sFile = FileFindNextFile($hSearch) If @error Then ExitLoop If StringInStr(FileGetAttrib($sStartFolder & $sFile), "D") And ($sFile <> "." Or $sFile <> "..") Then ; If folders needed, add subfolder to array If $iFlag <> 1 Then _FLTA_Add($asFileList, $sFullPath, $sStartFolder, $sFile) ; Recursive search of this subfolder _FLTA_Search($sStartFolder & $sFile, $sFilter, $iFlag, $iRecur, $sFullPath, $asFileList) EndIf WEnd FileClose($hSearch) EndIf EndIf EndFunc ; #INTERNAL_USE_ONLY#================================================================================= ; Name...........: _FLTA_Add ; Description ...: Searches folder for files and then recursively searches in subfolders ; Syntax.........: _FLTA_Add(ByRef $asFileList, $sFullPath, $sStartFolder, $sFile) ; Parameters ....: $asFileList - Array containing found files/folders ; $sFullPath - $sPath as set in _FileListToArray ; $sStartFolder - Value passed on from UBound($avArray) ; $sFile - Full path of file/folder to add to $asFileList ; Return values .: Function only changes $asFileList ByRef ; Author ........: Melba23 based on code from _FileListToArray by SolidSnake <MetalGX91 at GMail dot com> ; Modified.......: ; Remarks .......: This function is used internally by _FileListToArray. ; Related .......: ; Link ..........; ; Example .......; ; ==================================================================================================== Func _FLTA_Add(ByRef $asFileList, $sFullPath, $sStartFolder, $sFile) Local $sAddFolder $asFileList[0] += 1 If UBound($asFileList) <= $asFileList[0] Then ReDim $asFileList[UBound($asFileList) * 2] If $sFullPath = "" Then $sAddFolder = $sStartFolder Else $sAddFolder = StringReplace($sStartFolder, $sFullPath, "") EndIf $asFileList[$asFileList[0]] = $sAddFolder & $sFile EndFunc File copy using Autoit - does not work: FileCopy("\\?\usb#vid_0e8d&pid_201d&mi_00#7&37c4bb9&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\Internal storage\DCIM\Camera MX\PHOTO_20161007_123935.jpg", 'd:\Diverse 2\654\0\') Copy using Windows batch - does not work: xcopy /Y /E "\\?\usb#vid_0e8d&pid_201d&mi_00#7&37c4bb9&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\Internal storage\DCIM\*.*" "d:\Diverse 2\654\0\"
  11. I REALLY liked Windows Phone 8.1 and Windows Phone 10. But when the final list of hardware came out from Microsoft, alas my 6 month old phone was not included. Then only weeks later, Microsoft sold their Nokia handset division only day ago, it was time to stop suffering and get back to Android (NO - I do not own or use Apple Products). It was only after hours of searching that I found that there was NO EASY WAY to move SMS Messages off of Windows Phone 8.1 or 10 TO Android...UNBELIEVABLE!! So I wrote a quick and dirty way to get this done. Here are the steps **** - Your existing SMS Messages will be DELETED!! YOU HAVE BEEN WARNED! Back them up if you do not want to lose them 1 - FROM your Windows Phone 8.1 or Windows Phone 10 - Download 'contacts + messages' app from store. EXPORT ONLY SMS (no MMS). Copy the output file (usually named .msg) to your PC **** - This version requires you to find/replace any colons ":" in your messages -like smiley faces - I replaced them with semi-colon ";" 2 - Run the attached script - choose your file - it will take a minute and then you should see an out.xml file 3 - Get the out.xml file to your android phone or someplace your android phone can get to is (like dropbox or the like) 4 - FROM the Android store, download titanium backup. You do NOT NEED root access - choose from the menu RESTORE from XML, Find and select out.xml. If it prompts you to "Change default message app to Titanium" - click YES (you can change it back after the import) 5 - It will take a while, but when completed, your sms messages will be restored! Post here and I will try and assist. Enjoy importSMS.au3
  12. Hi everyone, This is my special pet project. It is an example of how u can use autoit to control external devices. this script is made to comunicate with the MAX335 chip using the SPI protocol via the LPT(printer) port the beauty of the MAX335 chip is that the Clock, Data_In and the Chip_Select pins can be directly connected to the LPT port without any external components, and the 12V and 5V directly from an ATX PC power suply. aditionaly i made a custom GUI with CommandFusion instaled on an Android Tablet that sends TCP commands to an Autoit TCP server that controls three dasy chained MAX335 chips that totals 24 independent NO switches this script works perfectly for me i just finished this project and i think i will make an UDF including more SPI devices $DLLFileAndPath = @ScriptDir & "/inpout32.dll" Global $335_device_number=3 ;number of daisy chained chips Global $335_clock_bit=0 ;bit number for LPT pin 1 in the control Register of the LPT port(where i connected the CLK pin on te MAX335) Global $335_cs_bit=4;bit number for LPT pin 6 in the data Register of the LPT port(where i connected the CS pin on te MAX335) Global $335_data_in_bit=7;bit number for LPT pin 9 in the data Register of the LPT port(where i connected the DI pin on te MAX335) Global $clock_delay=1;this limits the clock speed but it works fine with 0 ;the ini file will be created and will keep the MAX335 pins statuses For $i=0 To $335_device_number*8-1 Step 1 IniWrite("355_buffer.ini","present_data",$i,"0") Next set_max335_output(2,3,1) ; this will activate switch 2 on device 3 on the daisy chain Func set_max335_output($output_no,$device_no,$status) $bit_no=($device_no-1)*8+$output_no-1 ; get the exact bit number of the switch IniWrite("355_buffer.ini","present_data",$bit_no,$status); whrite it to the buffer ;this part is where the SPI protocol begins set_control_bit($335_clock_bit,1); drop CLK set_data_bit($335_cs_bit,0) ;activate CS Sleep($clock_delay) For $i=$335_device_number*8-1 To 0 Step -1; start writing from buffer MostSignificantByte first $data=IniRead("355_buffer.ini","present_data",$i,"0") set_data_bit($335_data_in_bit,$data) ; set data bit value set_control_bit($335_clock_bit,0) ;raise CLK Sleep($clock_delay) set_control_bit($335_clock_bit,1); drop CLK Sleep($clock_delay) Next set_data_bit($335_cs_bit,1);deactivate CS EndFunc Func set_data_bit($bit,$stat=-1) ; it will write the value of the bit in the data reg of the LPT port $y= DllCall($DLLFileAndPath, "int", "Inp32", "int", "0x378") $bits=dec_to_bin($y[0]) If $stat = -1 Then If $bits[$bit]=0 Then $bits[$bit]=1 Else $bits[$bit]=0 EndIf $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x378", "int", $bcd) Return 1 Else If $bits[$bit]<>$stat Then $bits[$bit]=$stat $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x378", "int", $bcd) Return 1 Else Return 2 EndIf EndIf EndFunc Func set_control_bit($bit,$stat=-1); it will write the value of the bit in the control reg of the LPT port $y= DllCall($DLLFileAndPath, "int", "Inp32", "int", "0x37a") $bits=dec_to_bin($y[0]) If $stat = -1 Then If $bits[$bit]=0 Then $bits[$bit]=1 Else $bits[$bit]=0 EndIf $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x37a", "int", $bcd) Return 1 Else If $bits[$bit]<>$stat Then $bits[$bit]=$stat $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x37a", "int", $bcd) Return 1 Else Return 2 EndIf EndIf EndFunc Func dec_to_bin($dec) Local $bit_array[8] If $dec > 255 Then SetError(1,1,-1) If $dec < 0 Then SetError(2,1,-1) For $i=7 To 0 Step -1 If $dec >= 2^$i Then $bit_array[$i] = 1 $dec=$dec-2^$i Else $bit_array[$i] = 0 EndIf Next Return $bit_array EndFunc Func bin_to_dec($bit_array) If IsArray($bit_array) Then If UBound($bit_array) = 8 Then $dec=0 For $i=7 To 0 Step -1 $dec = $bit_array[$i]*(2^$i)+$dec Next Else SetError(2,1,-1) EndIf Else SetError(1,1,-1) EndIf Return $dec EndFunc
×
×
  • Create New...