PAN1322Application Note 20 Revision 1.2, 2013-12-18Design Guide4.3 Switch from Command Mode to Stream ModeAfter a Bluetooth SPP connection has been established, the host can send the command AT+JSCR incommand mode to switch the eUniStone to stream mode. A transparent communication will beenabled if both sides of the connection are using stream mode.4.4 Switch from Stream Mode to Command ModeThe host can send the escape string “^ ^ ^” to switch the eUniStone back to command mode. Thestring must be sent with the following timing: Pause time between each “^ “ sign: T1 = 100ms to 1 sec. Pause time after the last “^” sign: T0 > 1sec.If the remote device disconnects the link when the eUniStone module is in stream mode, theeUniStone module will immediately send a „Disconnect Indication“ +RDII to the host and switch backto command mode automatically.If the remote device is off (e.g. powered off or out of range) when the eUniStone module is in streammode, stream data cannot be transmitted any more on the air. Hardware flow control stops anyfurther UART communication as soon as the module’s UART input buffer is full. After the linksupervision timeout of 20 s, the module sends a „Disconnect Indication“ +RDII to the host. At thatinstant, Any UART data is flushed and the device switches back to command mode automatically.The host has to wait during the supervision timeout of 20 s. As soon as the UART buffer is full, it is notpossible to leave stream mode or to disconnect the link locally before the supervision timeout expires.There are two ways to detect a disconnection in stream mode:1. The host is searching for “+RDII“ in the data stream from the module. The host shallswitch from stream mode to command mode when it recognizes the “+RDII“indication. Any stream data sent after the “+RDII“ indication will be answered by anerror message “ERR=-1“ (syntax error). If the host after that sends a first commandit will be responded with “ERR=-1“, since the UART is out of sync. The secondcommand will get the expected response (e.g. “OK”).2. The GPIO pin P0.1 (pin E5) is used to indicate the connection status. P0.1 is HIGHwhen eUniStone device is connected and LOW when there is no connection. Thetransition from HIGH to LOW happens prior to sending the “+RDII” indication viaUART. Hosts that cannot monitor the incoming data stream for the "+RDII"indication in stream mode may monitor P0.1 in eUniStone.P0.1 is configured as input pin by default. To use this feature the host shall send the AT command“AT+JGPC=FFFD,0000,0000,0000,FFFD” which configures P0.1 as an output pin.