Download Accessing RFCOMM Using RFCLI and TCL Application
Transcript
Contents Contents 1 Introduction .................................................................................................................................................... 4 2 RFCOMM Protocol Layer............................................................................................................................... 5 2.1 Local Server Channel and Mux ID........................................................................................................... 8 Flow Control ................................................................................................................................................. 12 3.1 Credit Based Flow Control..................................................................................................................... 12 3.2 Maximum Frame Size............................................................................................................................ 15 3.3 Flow Control Layer ................................................................................................................................ 16 4 RFCOMM Firmware Build ............................................................................................................................ 18 5 Accessing RFCOMM Functionality Using RFCLI and TCL ....................................................................... 19 5.1 RFCLI ................................................................................................................................................... 19 5.2 TCL ................................................................................................................................................... 19 5.3 Setting Up RFCOMM Link ..................................................................................................................... 19 5.4 Over Air Sniffer ...................................................................................................................................... 35 5.5 Serial Sniffer .......................................................................................................................................... 39 6 Example of Accessing RFCOMM Using RFCLI and TCL .......................................................................... 40 6.1 Details of the RFCLI Source Script Example ......................................................................................... 41 6.2 Local and Remote Device Source Script ............................................................................................... 41 6.3 Initialisation of RFCOMM Layer in the Local Device.............................................................................. 42 6.3.1 Connect to Casira ...................................................................................................................... 42 6.3.2 Initialise Port Entity Transmit and Receive Buffers..................................................................... 43 6.3.3 Put Messages in Transmit Buffer ............................................................................................... 43 6.3.4 Initialise System Variables ......................................................................................................... 44 6.3.5 Register with RFCOMM ............................................................................................................. 44 6.3.6 Initialise RFCOMM ..................................................................................................................... 44 6.3.7 Register with Device Manager ................................................................................................... 44 6.3.8 Request RFCOMM Start ............................................................................................................ 45 6.3.9 RFCOMM Parameter Negotiation .............................................................................................. 45 6.3.10 RFCOMM Establishment ........................................................................................................... 45 6.4 Initialisation of the RFCOMM Layer of the Remote Device.................................................................... 46 6.4.1 Connect to Casira ...................................................................................................................... 47 6.4.2 Initialise Port Entity Transmit and Receive Buffers..................................................................... 47 6.4.3 Initialise System Variables ......................................................................................................... 47 6.4.4 Register with RFCOMM ............................................................................................................. 47 6.4.5 Initialise RFCOMM ..................................................................................................................... 47 6.4.6 Register with Device Manager ................................................................................................... 47 6.4.7 Listen ......................................................................................................................................... 47 6.4.8 Output “Waiting For Connection” Message ................................................................................ 47 6.4.9 Connect as Slave ....................................................................................................................... 48 6.5 Main Loop and State Machine ............................................................................................................... 48 6.6 Main Loop Functions ............................................................................................................................. 52 6.6.1 Check Transmit Buffer for Packets to Transmit.......................................................................... 53 6.6.2 Check Receiver Buffer for Space ............................................................................................... 53 6.6.3 Check for Packet in Receiver Buffer .......................................................................................... 53 6.6.4 Flow Control Layer ..................................................................................................................... 53 6.6.5 Process Next Received Packet in Receiver Buffer..................................................................... 54 6.6.6 Steady State .............................................................................................................................. 54 6.7 Other Functions ..................................................................................................................................... 54 6.7.1 Start Request ............................................................................................................................. 55 6.7.2 Register RFCOMM..................................................................................................................... 55 6.7.3 Receive RFCOMM Data ............................................................................................................ 56 6.7.4 Transmit RFCOMM Data ........................................................................................................... 56 6.7.5 Read Bluetooth Address Message............................................................................................. 57 6.7.6 Read Local Name Message ....................................................................................................... 58 bcore-an-006Pa © Copyright CSR 2002 This material is subject to CSR’s non-disclosure agreement. Page 2 of 77 _äìÉ`çêÉ Accessing RFCOMM Using RFCLI and TCL 3