Home

BTHMGR-CE60-09A-US Adeneo Headless Bluetooth Manager User

image

Contents

1. starts SPP and OPP but BthServices exe a p 1234 will not start any services until instructed to The application continues to run in the background until instructed to stop by running BthServices exe stop even if all running services are stopped SPP OPP and FTP services can be started and stopped while BthServices is running by running a new instance of the application with the correct flags When the application runs if it detects that it s not the first instance it will just set system wide events to communicate with the original instance of the application rather To change the PIN or Authentication it is necessary to stop the application completely with BthServices exe stop and then start it again with the proper p or a flags 1 2 3 3 Command Line Parameters By default the application will start SPP and OPP services and run until instructed to stop by another instance of the application If any services are specified only those services specified will start For all command line parameters can be substituted for h Display this help screen and exit This screen will also be displayed if there are any errors parsing the command line stop Stop all services and running instances of the application and exit service stop If stop is specified the service will be stopped if it s running spp stop Serial Port Profile January 2008 C000108 rev A Page 10 15 qualit mod les D3
2. if iPercentTransferred BTH_TRANSFER_STARTED iPercentTransferred 0 if ghTransferStarted NULL eg eege cla tease totales y morsa Ma gt anaren erence EE else if iPercentTransferred BTH_TRANSFER_COMPLETE iPercentTransferred 100 if ghTransferComplete NULL Souvenirs tea Crow ode e 5 wprintf L Transfer complete n else if iPercentTransferred BTH_TRANSFER_SIZEUNKNOWN Just print dots so that it s clear the transfer is progressing because there s no information available on the rate size women else wprintf L Transferred SOSS Rate SON ZER EN iPercentTransferred dRate 1 2 4 4 2 Initiating an object push pOpp gt PushObject sFileName TransferCallback NULL 1 2 5 Sample 5 BthFTP exe File Transfer Profile Client 1 2 5 1 Summary This application is a basic command line File Transfer Profile client It supports uploading downloading and listing the contents of remote directories January 2008 C000108 rev A Page 12 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual 1 2 5 2 Usage First find the name or Bluetooth address of a device that supports FTP by using BthListDevices exe then run BthFtp using the specified name or address Each time the program is run it will search for available remote devices initiate a new connection execute the action specified o
3. unused pointer passed in when the callback was registered N JIM Nasa d int OnDevicePairRequest LPARAM lpDevD LPARAM lpDevD2 CDeviceDistant pDeviceDistant NULL wprintf L nAnswering pairing request with pin s n sPin if lpDevD NULL pDeviceDistant CDeviceDistant lpDevD January 2008 C000108 rev A Page 9 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual pDeviceDistant gt AnswerPairRequest iPinLength sPin return Or 1 2 2 4 2 Obtaining a list of available COM ports vectorPortCom pSpp gt getAvailablePortComList if vectorPortCom size lt 1 wprintf L Error no COM ports available else A A A ome Com NOR for short ICOMiterator ip ICOMi ee zartor lt wectorEPortcom saige r ICOMi Cercaron wprintf L Sd vectorPortCom iCOMiterator se Ib Nia 1 2 2 4 3 Connecting to a remote SPP server pSpp gt Connect 1 2 3 Sample 3 BthServices exe Host SPP FTP and OBEX Push Profiles 1 2 3 1 Summary This application allows one to start and stop SPP OPP and FTP servers 1 2 3 2 Usage By default just running the application will enable the SPP and OPP services with authentication not required and will respond with a PIN of 42 when remote devices attempt to pair with the local device If any parameters are specified no services will be started by default so BthServices exe
4. 1 2 1 4 4 Looping through remote devices found ArrayDevices DeviceList LocalDevice GetDevices for ushort iDevice 0 iDevice lt DeviceList size iDevicett pDevice Devicelist at iDevice 1 2 1 4 5 Displaying information available about a device Note that BTAdar is a 64 bit variable ClassToString is defined in BthListDevices cpp it translates a class into Phone PDA etc wprintf L Name s n pDevice gt GetName c_str wprintf L BT ADDR 0x 08x 08x n DWORD pDevice gt GetBtAddr gt gt 32 DWORD pDevice gt GetBtAdar voraz Ub Class 5 0x x s n pDevice gt GetClass ClassToString pDevice gt GetClass if _WIN32_WCE gt 0x600 RSS e 0x x n pDevice gt GetRSSISignal fendif 1 2 1 4 6 Pairing with a Remote Device if pDevice gt IsPaired wprintf L Already paired with s n pDevice GetName c str else pDevice gt AskPairRequest iPinLength sPin if pDevice gt IsPaired wprintf L Paired successfully n wprintf L Unable to pair with device n 1 2 1 4 7 Initiate an Inquiry Thread for Remote Services January 2008 C000108 rev A Page 7 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual gbInquiryComplete FALSE if pDevice gt FindServices wprintf L Error could not start search thread n continue 1 2 1
5. 4 8 Displaying information available about a service pService Servicelist at iService wprintf L Name s n pService GetName c str mu ag E bY 1008 d n pService gt GetID wprintf L COM port 3d n pService gt GetComPort wprintf L Channel d n pService gt GetChannel wprintf L Nn 1 2 1 4 9 Wait for the thread to complete This could also be done with an event in this application it s primarily done with the while sleep to allow for printing periods to indicate progress while gbInquiryComplete Sleep 500 January 2008 C000108 rev A Page 8 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual 1 2 2 Sample 2 BthConnectSpp exe Find and connect to a Serial Port Profile 1 2 2 1 Summary T his application finds and connects to a remote Serial Port Profile server 1 2 2 2 Usage By default it requires a device name or bluetooth address to be specified with rn or rb respectively It connects to the device without pairing creates a virtual COM port and sends Hey there r n every second for two minutes The Bluetooth address is a 64 bit value which is written in hex and the format for entering it is identical to the format in which it s displayed by BthListDevices exe When entering a name with spaces be sure to enclose the entire name in double quotes Names and addresses are case insensitive 1 2 2 3 Command Line Parameters By default the app
6. 5 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual Adeneo Headless Bluetooth Manager 1 Sample Applications User Manual 1 1 Setting up a CE6 OS Design for use with Bluetooth Be sure to start with an OS Design that already boots and runs correctly Change to the catalog components view and add the following items Under Core OS CEBASE Communication Services and Networking Personal Area Network PAN Bluetooth Bluetooth Protocol Stack with Transport Driver Support add Bluetooth Stack with Integrated CSR Chipset Driver and either Bluetooth Stack with Integrated USB Driver or Bluetooth Stack with Integrated UART Driver depending on whether the Bluetooth adapter is connected via USB or serial Under Core OS CEBASE Applications and Services Development C Libraries and Runtimes add C Runtime Support for Exception Handling and Runtime Type Information Under Core OS CEBASE Component services Component Object Model add COM and DCOM Under Core OS CEBASE XML MSXML 3 0 add XML Core Services and Document Object Model DOM Under Core OS CEBASE Communication Services and Networking Personal Area Network PAN Bluetooth Bluetooth Profiles Support add HS HF and Audio Gateway Service for Bluetooth audio Under Core OS CEBASE Object Exchange Protocol OBEX add OBEX Client and OBEX Server if OPP
7. 6 a aeneo Adeneo Sample Applications User Manual sppc Number COM port to host SPP over also starts spp if spp is not specified but ftp and opp will not be started unless directed to Note If sppc is executed in a second instance of the application the SPP server will be restarted with the pr ftp stop File Transfer Profile opp stop Object Push Profile p pin Pin to use if one is requested a Require PIN authentication If a pin is not specified with p it will default to 42 1 2 3 4 Developers Notes The important parts of this application are 1 2 3 4 1 Start a service if gpServerFTP gt IsConnected wprintf Server already started stopping it n gpServerFTP gt Disconnect gpServerFTP gt SetAuthenticated gbAuthenticate gpServerFTP gt Connect 1 2 3 4 2 Stop a service if gpServerFTP gt IsConnected wprintf L Stopping FTP server n gpServerFTP gt Disconnect else wprintf L FTP server already stopped Wn 1 2 4 Sample 4 BthPush exe Push a file to a specified Bluetooth device 1 2 4 1 Summary This application connects to a specified Bluetooth device and sends a file via Object Push Profile OPP 1 2 4 2 Usage First use BthListDevices exe to obtain the name or Bluetooth address of a device then run the application with the name or address along with the name of the file to find the remote device and start the upload After the upload has fin
8. Hddeneo DENEO HEADLESS BLUETOOTH MANAGER SAMPLE APPLICATIONS USER MANUAL Ref C000108 REV A aeneo Adeneo Sample Applications User Manual Document History Revision py p NEN NEN January 2008 C000108 rev A Page 2 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual Table of Contents ADENEO HEADLESS BLUETOOTH MANAGER uusssssnssssnsossnsnsnsnssnsnssnonsosnnsnsnnsnsnsnsnnnnsnnsnsnsossnsnsnssnsnsnssnnssnsnensossnensnne 4 1 SAMPLE APPLICATIONS USER MANUAL uusssssnsossssnsnsnssnsnssnsnsnsnsnnenssnsnsnsnnnnsnssnsnsnsnsnnsnssssnsnsnsnnenssnsnsnsnssnsnssnsnsnn 4 1 1 SETTING UP A CE6 OS DESIGN FOR USE WITH BLUETOOTH s s sssssssssssesiseessssssstsrsrisrsressisrerinnsnsresrnreninssssesrsne 4 1 2 USING THE SAMPLE APPLICATIONS eerte retener tenete nennen terne rettet triente nennen 5 1 2 1 Sample 1 BthListDevices exe List Devices and Services sse 6 1 222 Sample 2 BthConnectSpp exe Find and connect to a Serial Port 9 1 2 3 Sample 3 BthServices exe Host SPP FTP and OBEX Push 85 10 1 2 4 Sample 4 BthPush exe Push a file to a specified Bluetooth device 11 1 25 Sample 5 BthFTP exe File Transfer Profile Client 12 1 8 BUILDING THE SAMPLE APPLICATIONS essent nennen eterne ennt rtt entren reete eren nnns 15 January 2008 C000108 rev A Page 3 1
9. a Windows CE gt s ipconfig Windows CE gt s XProgram Files BthManagerHeadless BthListDevices exe Windows CE gt s XProgram FilesXBthHanagerHeadlessXBthListDeuices exe Windows CE gt s XProgram Files BthManagerHeadless BthListDevices eye a g Windows CE gt l L ew 3 Show output from Windows CE Debug z liaud WE 541317 PID 1ac00 541317 PID lac00a 541318 PID 1ac00a 541319 PID 1ac00a 541321 PID 1ac00a 541322 PID 1ac00a 542323 PID 1acO00 542324 PID lac00 542324 PID lac00a TID 434000e Name ASUS 2626 TID 494000e BT ADDR O0x0000001aS2ab5b3f TID 494000e Class 0x1a0110 PDA TID 494000e RSSI 0x20 TID 494000e Searching for services provided by ASUS A626 TID 494000e TID 494000e TID 494000e Services available TID 494000e Name File Transfer nm A wm HM HY MH WH rn rn SS WD AD 542325 PID l1ac00a2 TID 494000e ID 2 542326 PID 1ac00a2 TID 494000e COM port 99 542326 PID lac00a2 TID 494000e Channel 99 542327 PID 1ac00a2 TID 494000e 542327 PID 1ac00a2 TID 494000e Name Serial Port a SATIS nrn I ann 2 TT A a4nnna TA January 2008 C000108 rev A Page 5 15 qualit mod les D36 a Mdenco Adeneo Sample Applications User Manual 1 2 1 Sample 1 BthListDevices exe List Devices and Services 1 2 1 1 Summary This is a relatively basic application which allows one to quickly verify that the Bluetooth driver is installed and working as well as list available Bluet
10. at for the current mode it s being built in the correct directory containing BthManagerDll lib and dll are referenced in Linker gt General gt Additional Library Directories and the correct header files are referenced in C C gt General gt Additional Include Directories It will also be necessary to have the DLL in the same directory as the sample application is deployed to which is configured in Configuration Properties gt Deployment and Configuration Properties gt Debugging 3 Build the solution and deploy to the embedded device automatically using CoreCon Activesync or by manually copying the files over If using Visual Studio to debug command line parameters are specified by right clicking the project name then selecting Debugging under Configuration Properties gt Debugging January 2008 C000108 rev A Page 15 15 qualit mod les D36 a
11. ished the application will exit 1 2 4 3 Command Line Parameters Usage BthPush exe p rn rb filename Connects to a remote device and attempts to send a file specified by filename h h Display this help screen and exit p p pin Attempt to pair with the remote device before listing services attempting to connect If PIN is not specified it will default to 42 If a pin with spaces is entered enclose it in double quotes PINs with double quotes and PINs that Start with a slash Wi or dash are not supported Filtering options One of either rn or rb is required rn Name rn Name Case insensitive search for a Bluetooth device called Name rb 0x BT ADDR rb 0x BT_ADDR Search for a Bluetooth device with a given 64 bit address specified in hex 0x before the address is optional Don t include any spaces in the address 1 2 4 4 Developers Notes January 2008 C000108 rev A Page 11 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual The important parts of this application are 1 2 4 4 1 Callback function for viewing file transfer status P fii NSsskewc Callback for seeing ele ccert Of a cile Ve param iPercentTransferred Percentage of the file transferred Nparam dRate kilobytes second Nparam lParam unused 24 return 0 Md static void TransferCallback int iPercentTransferred double dRate LPARAM lParam
12. ith a given 64 bit address specified in hex 0x before the address is optional Don t include any spaces in the address 1 2 1 4 Developers Notes The important parts of this application are Create an instance of CDeviceLocal CDeviceLocal LocalDevice 1 2 1 4 1 Activate the Bluetooth Adapter if LocalDevice Activate TRUI E wprintf L Error activating the Bluetooth adapter n return 0 1 2 1 4 2 Initiate an Inquiry Thread for Remote Devices int InquiryCallback LPARAM lParam LPARAM lParam2 B gbInquiryComplete TRU return Or Register InquiryCallback with the DLL and WM_BTINQUIRY_OVER message sone cams when the search asi complete January 2008 C000108 rev A Page 6 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual BTHMNG RegisterCallback WM BTINQUIRY OVER InquiryCallback NULL Begin a search for available remote devices When it is complete InquiryCallback will be called and set gbInquiryComplete to TRUE gbInquiryComplete FALSE if LocalDevice FindDevices wprintf L Error searching for devices n 1 2 1 4 3 Wait for the thread to complete and send a WM BTINQUIRY OVER message Note this waiting could also be done with events see BthPush exe for an example of how to do it with CE events rather than polling global variables while gbInquiryComplete Sleep 500
13. lication will display information on the local device then search for a remote device and attempt to connect to its SPP server Once the SPP connection is established the application opens the COM port and sends Hey there r n every second for two minutes h h Display this help screen and exit m m Don t send a default message or open the COM port created just leave it open for other applications t t number Time to leave the connection open in seconds c port COM port to use p p pin Attempt to pair with the remote device before listing services attempting to connect via SPP If PIN 15 not specified IE will default to 22 If a pin with spaces is entered enclose it in double quotes PINs with double quotes and PINs Filtering options If rn or rb is specified the program will attempt to open a serial connection only with devices that have the specified address name rn Name rn Name Case insensitive search for a Bluetooth device called Name rb Ox BT_ADDR rb 0x BT ADDR Search for a Bluetooth device with a given 64 bit address specified in hex 0x before the address is optional Don t include any spaces in the address 1 2 2 4 Developers Notes The important parts of this application are 1 2 2 4 1 Callback for answering Pair requests NINAS Callback encime 5 NEN param lpDevD a pointer to the remote device the query is coming from param lpDevD2
14. n odo fe Geter alt oO RON M d ura OD break j Wm 1 2 5 4 3 Uploading a file pWorkingFolder new CFtpFolder pFTP NULL sRemotePath pWorkingFolder gt PutFile sLocalPath TransferCallback NULL 1 2 5 4 4 Downloading a file Set the directory to download the file to pFTP gt SetPath sLocalPath pFileToGet gt Get TransferCallback NULL 1 2 5 4 5 Deleting a file Although it s not currently implemented it would be easy to add deleting remote files to an FTP client Just run a folder s DeleteObject method on a CFtpObject pointer contained within a folder like so pWorkingFolder DeleteObject pFtpObject January 2008 C000108 rev A Page 14 15 qualit mod les D36 a Mdenco Adeneo Sample Applications User Manual 1 3 Building the sample applications 1 Install a CE6 SDK and modify the sin and vcproj files to use it This is an unfortunate requirement as there is no Microsoft Standard SDK for CE6 development It is necessary to create and install a CE6 SDK then open the SLN and VCPROJ files in the HeadlessSamples folder with a text editor such as Notepad or PSPAD and replace all instances of PXA270 DK SDK ARMVAI with the name of the newly created SDK 2 This step should already be done for the binary version but is necessary whenever a new version of BthManagerDIl dll is built Open the Property Pages for each project contained in the BthManagerHeadless solution and verify th
15. n the command line and then exit This means that each operation is completely independent of any other but it also means that each operation takes roughly 10 30 seconds It would be straightforward to redesign the application using a GUI or terminal interface to keep a connection open and execute multiple commands without restarting the connection in which case operations would be executed much more quickly as in the MFC based Bluetooth Manager GUI 1 2 5 3 Command Line Parameters Usage Note parameters are not case sensitive If l s and g are unspecified by default the program will list the files folders in the root of the remote FTP server h h Display this help screen and exit p p pin Attempt to pair with the remote device using pin If pin is not specified it will default to 42 If a pin with spaces is entered enclose it in double quotes PINs with double quotes and PINs that start with a slash or dash are not supported l 1 Remote Path List files folders in remote path specified by Remote Path For example BthFTP exe p 339215 rn Home Computer f Images Camera October s s Local Path Remote Path Send the file at Local Path on the local device to the remote device and store it in Remote Path g g Remote Path Local Path Get the file at Remote Path on the remote device and store it in Local Path defaults to the current directory Filtering options Either
16. ooth devices and services 1 2 1 2 Usage Just run the application without any parameters to list devices and for each device list all available services By default the application will not initiate or respond to pairing requests Using command line parameters it s possible to toggle displaying information available on the local bluetooth adapter attempt to pair with remote devices before listing their available services or only list devices services with a specified device name bluetooth address 1 2 1 3 Command Line Parameters By default the application will display information on the local device then list all remote devices and services h h Display this help screen and exit d d Print information on the local device 1 1 List remote devices p p pin Attempt to pair with each remote device before listing services it has IAIN abes eeng specified it will default to 42 If a pin with spaces is entered enclose it in double quotes PINs with double quotes and PINs that start with a slash or dash are not supported s s List remote services for each device services will be listed for any device specified with rb or rn regardless of this option Filtering options If rn or rb is specified only devices that match the given name and or address will be displayed rn Name rn Name Search for a Bluetooth device called Name rb Ox BT_ADDR rb 0x BT ADDR Search for a Bluetooth device w
17. or FTP will be used Also add both items underneath OBEX Server or OBEX OPP FTP servers will not function properly January 2008 C000108 rev A Page 4 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual 1 2 Using the sample applications Copy the sample executables and BthManagerDIl dll to the same directory on the device They can be executed from the Command Window like any other windows program see screenshot below Note that they are somewhat slow because each time any of the sample applications is run it loads the Bluetooth stack then has to find the device it communicates with all over again For example if one runs BthListDevices exe to find a name then BthPush exe with the name of the device BthPush will have to search for devices all over again which will take time With the GUI Bluetooth Manager or a custom Bluetooth enabled application this would only be necessary once so the interface will run much more quickly tv 4 X Windows CE Co Prompt Alt 1 P85 explorer exe 636F6666 00000000 66616666 66666666 P66 touchcalibrate1 exe 83790006 888888680 00010000 66666000 P67 servicesd exe 038b0006 00000000 00010000 66666666 P88 ConmanClient2 exe 85e48802 00888888 600108088 66666660 P89 cmaccept exe 639F666a 686666666 080108080 66666666 Windows CE gt s ipconfig Windows CE gt s conmanclient2 Windows CE gt s cmaccept G Windows CE gt s XProgram Files BthManagerHeadless BthListDevices exe
18. rn or rb is required to use FTP rn Name rn Name Case insensitive search for a Bluetooth device called Name rb 0x BT ADDR ro 0x BT_ADDR Search for a Bluetooth device with a given 64 bit address specified in hex 0x before the address is optional Don t include any spaces in the address 1 2 5 4 Developers Notes The important parts of this application are 1 2 5 4 1 Connecting to an FTP server 1 2 5 4 2 Listing the contents of a folder if pWorkingFolder gt Browse wprintf L Error enumerating contents of folder PFTP gt Disconnect continue wprintf L Nn d objects found n pWorkingFolder gt GetFtpObjects size Eet ellene proleezr NULLS CFtpFile pFile NULL CFtpObject pFtpObject NULL for unsigned int iFtpObject 0 iFtpObject lt pWorkingFolder gt GetFtpObjects size iFtpObject pFtpObject pWorkingFolder gt GetFtpObjects at iFtpObject wprintf L Name s pFtpObject GetName c str switch pFtpObject gt GetID January 2008 C000108 rev A Page 13 15 qualit mod les D36 a aeneo Adeneo Sample Applications User Manual Case OBEX T ETET ETNE pFile CFtpFile pFtpObject 1 ile Sizes Ed bytes Full Barca pFile gt GetSize pFile gt GetPath c_str pFile gt GetName c_str break case OBEX FTP FOLDER pFolder CFtpFolder pFtpObject a Elda pawns UE WU e

Download Pdf Manuals

image

Related Search

Related Contents

ISI30/31/32/33 Betriebsanleitung Operating instructions Instructions  取扱説明書  Thank You For Choosing Garrett Metal Detectors!    Petit guide juridique, 2ème partie    Wentronic HDMI, 5m  VB5-100SPS_ Manual  Téléchargement FDR  Scanner Manual for ADF Scanner  

Copyright © All rights reserved.
Failed to retrieve file