Silicon Laboratories Finland WRAP2022-1-B2B Bluetooth Board-to-Board Module User Manual ASCII Interface 2 0 0 Manual

Silicon Laboratories Finland Oy Bluetooth Board-to-Board Module ASCII Interface 2 0 0 Manual

Contents

AI Manual

ASCII Interface 2.0.0 Manual$Revision: 1.4 $Bluegiga Technologies
ASCII Interface 2.0.0 Manualby Bluegiga TechnologiesCopyright © 2004 Bluegiga TechnologiesBluegiga Technologies assumes no responsibility for any errors, which may appear in this manual. Furthermore,Bluegiga Technologies reserves the right to alter the hardware, software, and/or specifications detailed herein at anytime without notice, and does not make any commitment to update the information contained herein. BluegigaTechnologies’ products are not authorized for use as critical components in life support devices or systems.The WRAP is a registered trademark of Bluegiga TechnologiesThe Bluetooth trademark is owned by the Bluetooth SIG Inc., USA, and is licensed to Bluegiga Technologies.All other trademarks listed herein are owned by their respective owners.
Table of ContentsPreface..................................................................................................................................... iTypographical Conventions........................................................................................ i1. Usage ...................................................................................................................................12. Operational Modes...........................................................................................................3Command Mode...........................................................................................................3Data mode .....................................................................................................................33. Commands .........................................................................................................................5CALL..............................................................................................................................5CLOSE............................................................................................................................6INQUIRY .......................................................................................................................6LIST ................................................................................................................................8NAME ..........................................................................................................................10RESET...........................................................................................................................10SELECT........................................................................................................................10SET................................................................................................................................11SET BT ................................................................................................................12SET CONTROL .................................................................................................14TESTMODE.................................................................................................................164. Events ................................................................................................................................17CONNECT ..................................................................................................................17INQUIRY_PARTIAL ..................................................................................................17NO CARRIER .............................................................................................................18READY.........................................................................................................................18NAME ..........................................................................................................................18NAME ERROR ...........................................................................................................19RING ............................................................................................................................19SYNTAX ERROR ........................................................................................................195. Troubleshooting ..............................................................................................................21A. Acronyms and Definitions...........................................................................................23iii
iv
PrefaceWRAP THOR ASCII Interface is firmware which allows easy access to Bluetoothfunctionality. It makes the radio interface totally transparent and host system cancontrol connections with simple ASCII commands strings. This makes transition towireless world easy as no specific Bluetooth know-how has to be obtained.Typographical ConventionsDifferent typographical conventions used in this manual are described in this chap-ter.•Screen output seen on terminal is presented as follows:OUTPUT FROM ASCII InterfaceINPUT FROM USERMORE OUTPUT•Command and output synopsis are presented as follows:COMMAND {required parameter} [optional parameter] STATIC TEXT [2nd op-tional parameter]•Command and event references are presented as follows:COMMAND and EVENT.i
Prefaceii
Chapter 1. UsageASCII Interface is terminal controlled firmware which means it can be used withany terminal emulation software, such as Hyperterminal in Windows or Minicom inLinux. Initial port settings for ASCII interface are 115200,8n1 (baud rate 115200 bps,8 data bits, no parity, one stop bit) and hardware flow control enabled. When youpower-on the module or evaluation kit you should see the command prompt appearon the terminal emulation software.After power-on you can check ASCII Interface configuration, such as Bluetooth de-vice address, by command SET.Example 1-1. ASCII Interface at initial stateWRAP THOR AI (version 2.0.0-rc1 build 344 $ bt1.1)Copyright (c) 2003-2004 Bluegiga Technologies Inc.READY.SETSET BT BDADDR 00:07:80:a5:c1:11SET BT NAME WRAP AISET BT CLASS 001f00SET Control BAUD 115200,8n1SET Control ECHO 7SET1
Chapter 1. Usage2
Chapter 2. Operational ModesASCII Interface has two operational modes, command mode and data mode. Com-mand mode is default mode when there is no connections. It is possible to switchbetween modes at any time when there are any connections. Data mode is not avail-able if there is no connections (because there is not any data available).Switching from data mode to command mode is issued with the following escapesequence:<at least 1 second sleep> +++ <at least 1 second sleep>Same sequence or command SELECT may be used to return to data mode.When ASCII Interface enters to command mode READY event is delivered (unlessmasked away with SET CONTROL ECHO).Command ModeCommand mode is default mode when ASCII Interface is powered. In commandmode commands can be entered to ASCII Interface to perform various activities.Incoming data from remote devices is buffered when ASCII Interface is in commandmode.Note: Because of embedded nature of ASCII Interface buffering capabilities are low andonly small amounts of data can be received to buffers.Mode is changed from command mode to data mode when•User switches mode either using escape sequence <1s>+++<1s> or using com-mand SELECT.•Connection is successfully created using command CALL (CONNECT event is usedto notify for successful link creation).•Remote device has connected us (RING event is used to notify for incoming con-nections).Data modeData mode is default mode when there are any connections. In data mode all datais sent totally transparently from UART over the Bluetooth RFCOMM link to otherdevice and vice versa.Mode is changed from data mode to command mode when•User switches mode using escape sequence <1s>+++<1s>.•Link is terminated (closed by remote device or link loss) (NO CARRIER event is usedto notify for link termination).3
Chapter 2. Operational Modes4
Chapter 3. CommandsThis chapter describes different commands used to control the behaviour of ASCIIInterface.Every command is typed into one line and is executed by line feed (CR+LF,ASCII13+ASCII10). ASCII Interface is case insensitive ie. command may be enteredin upper-, lower- or even mixed case letters.CALLCommand CALL is used to initiate connections to the remote device. Connectionsare closed using command CLOSE. Currently open connections can be viewed usingcommand LIST.SynopsisCALL {address} {target} RFCOMMDescriptionaddressBluetooth device address of the remote devicetargetRFCOMM target for the connection. Target may be one of the following:channelRFCOMM channel numberFormat: xx (hex)uuid1616 bit UUID for searching channelFormat: xxxx (hex)uuid3232 bit UUID for searching channelFormat: xxxxxxxx (hex)uuid128128 bit UUID for searching channelFormat: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (hex)ResponseCALL {link_id}5
Chapter 3. Commandslink_idNumeric connection identifierEvents•CONNECT event is delivered after successful CALL command.•NO CARRIER event is delivered if CALL fails.ExamplesExample 3-1. Creating successful connection to 00:07:80:bf:bf:01 channel 1CALL 00:07:80:bf:bf:01 1 RFCOMMCALL 0CONNECT 0 RFCOMM 1Example 3-2. Creating successful connection to 00:07:80:bf:bf:01 Serial Port Profile(UUID16 SPP = 1101)CALL 00:07:80:bf:bf:01 1101 RFCOMMCALL 0CONNECT 0 RFCOMM 2Example 3-3. Unsuccessful connection attempt to 00:07:80:bf:bf:01CALL 00:07:80:bf:bf:01 1 RFCOMMCALL 0NO CARRIER 0 ERROR 406 RFC_CONNECTION_FAILEDCLOSECommand CLOSE is used to terminate previously opened connection. See commandCALL for more information about opening connections.SynopsisCLOSE {link_id}Descriptionlink_idNumeric connection identifier from previously used command CALL or fromevent RING.ResponseNo response.Events•NO CARRIER event is delivered after link is closed.INQUIRYCommand INQUIRY is used to find other Bluetooth devices in the area.6
Chapter 3. CommandsSynopsisINQUIRY {timeout} [NAME]DescriptiontimeoutThe maximum amount of time (in units of 1.28 seconds) before the inquiry pro-cess is haltedNote: It may take up to 10.24 seconds for Bluetooth device to answer inquiry scanand thus timeout value should be at least 8 if it is necessary to find every device inthe area.NAMEOptional flag to automatically request friendly name for found devices, see com-mand NAME for more information about remote name requestResponseINQUIRY {num_of_devices}INQUIRY {addr} {class_of_device}*num_of_devicesAmount of found devicesaddrBluetooth device address of found deviceclass_of_deviceBluetooth Class of Device of found deviceNote: Response from INQUIRY comes after specified timeout.Events•INQUIRY_PARTIAL events are delivered as devices are found.•NAME events are delivered after INQUIRY if NAME flag is present.ExamplesExample 3-4. Inquiry without friendly name requestINQUIRY 10INQUIRY_PARTIAL 00:07:80:bf:bf:01 001f00INQUIRY_PARTIAL 00:07:80:80:05:65 920300INQUIRY_PARTIAL 00:07:80:80:32:e0 920300INQUIRY 3INQUIRY 00:07:80:bf:bf:01 001f00INQUIRY 00:07:80:80:05:65 920300INQUIRY 00:07:80:80:32:e0 9203007
Chapter 3. CommandsExample 3-5. Inquiry with friendly name requestINQUIRY 10 NAMEINQUIRY_PARTIAL 00:07:80:bf:bf:01 001f00INQUIRY_PARTIAL 00:07:80:80:05:65 920300INQUIRY_PARTIAL 00:07:80:80:32:e0 920300INQUIRY 3INQUIRY 00:07:80:bf:bf:01 001f00INQUIRY 00:07:80:80:05:65 920300INQUIRY 00:07:80:80:32:e0 920300NAME 00:07:80:bf:bf:01 "AI bf:01"NAME 00:07:80:80:05:65 "WRAP AS"NAME 00:07:80:80:32:e0 "WRAP THOR"LISTCommand LIST shows information about connections currently open.SynopsisLISTResponseLIST {num_of_links}LIST {link_id} CONNECTED RFCOMM {blocksize} 0 0 {elapsed_time}{local_msc} {remote_msc} {addr} {channel} {direction} {powermode}{role} {crypt}*num_of_linksNumber of currently open linkslink_idNumeric connection identifierblocksizeData packet size, ie. how many bytes data can be sent in one packetelapsed_timeLink life time in secondslocal_msc & remote_mscSerial port status bits, "8d" is normal valueaddrBluetooth device address of the remote devicechannelRFCOMM channel number at remote devicedirectionDirection of the link"OUTGOING"Link is initiated by local device (using command CALL)8
Chapter 3. Commands"INCOMING"Link is initiated by the remote devicepowermodePower mode for the link"ACTIVE"Link is in active mode"SNIFF"Link is in sniff mode"HOLD"Link is in hold mode"PARK"Link is in park moderoleRole of the link"MASTER"ASCII Interface is the master device of this link"SLAVE"ASCII Interface is the slave device of this linkcryptEncryption state of the link"PLAIN"Link is not encrypted"ENCRYPTED"Link is encryptedEventsNone.ExamplesExample 3-6. List with 1 active connection and 1 connection in sniff modeLISTLIST 2LIST 0 CONNECTED RFCOMM 669 0 0 40 8d 8d 00:07:80:80:31:e6 1 INCOMING SNIFF SLAVE EN-CRYPTED9
Chapter 3. CommandsLIST 1 CONNECTED RFCOMM 669 0 0 18 8d 8d 00:07:80:80:32:0e 1 OUTGOING AC-TIVE MASTER ENCRYPTEDNAMECommand NAME is used retrieve friendly name of the device.SynopsisNAME {address}DescriptionaddrBluetooth device address of the device.ResponseNone.Events•NAME event is delivered when friendly name is known.•NAME ERROR event is delivered if friendly name lookup fails.ExamplesExample 3-7. Successful name queryNAME 00:07:80:bf:bf:01NAME 00:07:80:bf:bf:01 "AI bf:01"Example 3-8. Unsuccessful name queryNAME 00:07:80:bf:bf:bfNAME ERROR 104 00:07:80:bf:bf:bf HCI_ERROR_PAGE_TIMEOUTRESETCommand RESET is used to reset ASCII Interface.SynopsisRESETResponseNone.EventsNone.SELECTCommand SELECT is used to switch to data mode.10
Chapter 3. CommandsSynopsisSELECT {link_id}Descriptionlink_idNumeric connection identifierResponseNone. ASCII Interface goes to data mode with the link link_id.EventsNone.SETSET displays or sets configuration values of ASCII Interface.SynopsisSET [{category} {option} {value}]DescriptionWithout any parameters SET displays current configuration.categoryCategory of setting"BT"Changes different Bluetooth related settings. See SET BT for more informa-tion about options."CONTROL"Changes different ASCII Interface settings. See SET CONTROL for moreinformation about options.optionOption name, depends on category. See following sections for more information.valueValue for option. See following sections for more information.Response•If issued without parameters:SET {category} {option} [value]*SET•If issued with parameters:11
Chapter 3. CommandsNone.EventsNone.SET BTBluetooth related settings.SET BT BDADDRList formatSET BT BDADDR {addr}addrBluetooth device address of local deviceNote: This value is read-only.SET BT NAMEList formatSET BT NAME {friendly_name}Set formatSET BT NAME [friendly_name]friendly_nameFriendly name of local deviceWarningIf friendly_name is left empty some device may have prob-lems showing device.SET BT CLASSList formatSET BT CLASS {class_of_device}12
Chapter 3. CommandsSet formatSET BT CLASS {class_of_device}class_of_deviceBluetooth Class of Device of local deviceSET BT AUTHList formatSET BT AUTH * {pin_code}Note: SET BT AUTH is not visible if pin_code is disabled.Set formatSET BT AUTH * [pin_code]pin_codePin code for authorized connections. Authorization is required if this optionis present.SET BT PAIRList formatSET BT PAIR {addr} {link_key}Note: SET BT PAIR is not visible if there are not paired devices.Set formatSET BT PAIR {addr} [link_key]addrBluetooth device address of the paired device13
Chapter 3. Commandslink_keyLink key for authenticated connectionTo remove device from list of known devices left link_key parameter empty.Tip: To remove every known device use * as addr (SET BT PAIR *).SET CONTROLCommon ASCII Interface settings.SET CONTROL BAUDList formatSET CONTROL BAUD {baud_rate},8{parity}{stop_bits}Set formatSET CONTROL BAUD {baud_rate} ,8 {parity} {stop_bits}Important: Parameters in SET CONTROL BAUD must be typed together!baud_rateUART baud rate in bps",8"Static string indicating UART uses 8 data bitsparityUART parity setting"n"None parity"e"Even parity"o"Odd paritystop_bitsNumber of stop bits in UART communications14
Chapter 3. Commands"1"One stop bit"2"Two stop bitsSET CONTROL ECHOList formatSET CONTROL ECHO {echo_mask}Set formatSET CONTROL ECHO {echo_mask}echo_maskBit mask for controlling echo and events displayingBit 0If set start-up banner is visibleBit 1If set characters are echoed back to client in command modeBit 2If set events are displayed when in command modeDefault value for SET CONTROL ECHO is 7 (bits 0..2 set).WarningIf every bit is set off (value 0) it is quite impossibleto know the status of ASCII Interface.If Bit 2 is set off it is very hard to detect whetherASCII Interface is in command mode or in datamode.SET CONTROL INITList formatSET CONTROL INIT {command}15
Chapter 3. CommandsSet formatSET CONTROL INIT [command]commandAny ASCII Interface command string.This command is automatically executed every time ASCII Interface starts(after power-on, RESET or watchdog event)TESTMODECommand TESTMODE enables Bluetooth Test Mode in which Bluetooth Testersmay be used to test radio environment.SynopsisTESTMODEResponseTEST 0EventsNone.16
Chapter 4. EventsEvents are mechanism that ASCII Interface uses to notify the User for completedcommands, incoming connections, etc. If ASCII Interface is in data mode only possi-ble event is NO CARRIER event for corresponding link.Events may be masked away by removing Bit 2 on command SET CONTROLECHO.Note: ASCII Interface is designed so that unwanted events can be safely ignored. EventsCONNECT,NO CARRIER and RING change the mode of operation and therefore they cannotbe ignored.CONNECTCONNECT event is used to notify for successful link establishment.Note: ASCII Interface automatically goes into data mode after CONNECT event.SynopsisCONNECT {link_id} RFCOMM {channel}Descriptionlink_idNumeric connection identifier.channelConnected RFCOMM channel number.See alsoCALL,LISTINQUIRY_PARTIALINQUIRY_PARTIAL event is used to notify found Bluetooth device. This event pre-cedes response for INQUIRY command.SynopsisINQUIRY_PARTIAL {addr} {class_of_device}DescriptionaddrBluetooth device address of found device.class_of_deviceBluetooth Class of Device of found device.17
Chapter 4. EventsSee alsoINQUIRYNO CARRIERNO CARRIER event is used to notify for link loss or alternatively failure in link estab-lishment.SynopsisNO CARRIER {link_id} RFCOMM {error_code} [message]Descriptionlink_idNumeric connection identifiererror_codeCode describing errormessageOptional verbose error messageSee alsoCALL,CLOSE,LIST,RINGREADYREADY event is used to notify for switching to command mode.SynopsisREADY.See alsoOperational modesNAMENAME event is used to notify for successful lookup for Bluetooth friendly name of theremote device.SynopsisNAME {addr} {"friendly_name"}DescriptionaddrBluetooth device address of the device.friendly_nameFriendly name of the device.18
Chapter 4. EventsSee alsoINQUIRY,NAMENAME ERRORNAME ERROR event is used to notify for Bluetooth friendly name lookup failure.SynopsisNAME ERROR {error_code} {addr} [message]Descriptionerror_codeCode describing error.addrBluetooth device address of the device.messageOptional verbose error message.See alsoINQUIRY,NAMERINGRING event is used to notify for incoming connection. Incoming connections are ac-cepted only if there is no existing links.SynopsisRING {link_id} {addr} {channel} RFCOMMDescriptionlink_idNumeric connection identifieraddrBluetooth device address of the remote devicechannelLocal RFCOMM channelSee alsoCLOSE,LISTSYNTAX ERRORSYNTAX ERROR is not an actual event but error message describing faulty typed com-mand or error in command parameters.19
Chapter 4. EventsSynopsisSYNTAX ERROR20
Chapter 5. TroubleshootingThis chapter introduces some usual error situations with possible solutions. Beforecontacting Bluegiga Technologies Technical Support at <support@bluegiga.com>please carefully check through this chapter.Problem Possible solutionsASCII Interface does not start or outputis just some garbageCheck your cable and terminalemulation settings.Default terminal settings are 115200,8n1(baud rate 115200 bps, 8 data bits, no par-ity, one stop bit).21
Chapter 5. Troubleshooting22
Appendix A. Acronyms and DefinitionsBluetoothTM Set of technologies providing audio anddata transfer over short-range radioconnectionsbps bits per secondhold mode Bluetooth low power modepark mode Bluetooth low power modeRFCOMM Serial cable emulation protocol; elementof Bluetoothsniff mode Bluetooth low power modeUART Universal Asynchronous ReceiverTransmitterUUID Universally Unique IdentifierWRAP Wireless Remote Access Platform;Bluegiga Technologies’ wireless productfamily23
Appendix A. Acronyms and Definitions24

Navigation menu