Presentation is loading. Please wait.

Presentation is loading. Please wait.

Bluetooth HCI Terminal

Similar presentations


Presentation on theme: "Bluetooth HCI Terminal"— Presentation transcript:

1 Bluetooth HCI Terminal
Final Presentation By : Ofri Rahat & Moti Zeltser Supervisor:Ilan Hazan

2 Project Goals Implementation of a HCI terminal, which based on the Ericsson – PC Reference stack, in order to help debugging of future BT implementations. The application will support the following features: Operating the Bluetooth device through the HCI layer, using HCI commands. Monitoring all HCI events. Convenience for future extension of the project

3 Project Phases Study the MFC and Windows programming.
Study the Bluetooth specification Dig into Ericsson BT Stack’s open source in order to learn how to integrate with it. Design the HCI Terminal application. Implement the HCI Terminal application. Application Testing. Application and project documentation.

4 A Brief Description of The Bluetooth Technology And Its Lower Components.

5 The BT Lower Level Layers

6 Point to Point HW/SW Layers Model

7 The HCI Layer The HCI layer purpose HCI commands HCI events

8 HCI Command Packet Structure HCI Event Packet Structure

9 Windows Programming and MFC Fundamentals

10 Event Driven Applications
What is event driven applications ? Why use event driven applications ? Who create those events ? What information passed on those events ? How does Windows (the Win32 API) support event (message) handling ? How does MFC support event (message) handling ?

11 Default Window Procedure
Messages in The Win 32 API Message Loop System Queue (Windows OS) App2 Message Queue App3 Message Queue Window Procedure 1 Application 1 Default Window Procedure Windows (OS) Window Procedure 2 App1 Message Queue Hardware Events Post Message Send Message

12 Events in MFC MFC - general architecture The CCmdTarget class
The CWin class Message maps Types of messages (Windows, Command, User Interface Update, Event Notification) User defined messages

13 A Few Words About COM Technology
The Component Object Model Benefits of COM COM objects Client of COM objects COM Server How COM clients communicates with COM servers

14 Ericsson’s Bluetooth PC Reference Stack

15 BT Stack Higher Layers (BT API)
RF COMM SCM L2CAP HCI HCI Driver SDP Service Discovery Protocol Stack Connection Manager Host Controller Interface HCI lower Level Application or Higher Protocols Transport Protocol, RS-232 Emulation Logical Link Control and Adaptation Protocol BT Stack API OSI stack components Ericsson stack components To USB Driver

16 Data Flow Between 2 Layers
Layer A Layer B Request (Req) Command (Cmd) Confirm (Cnf/CnfNeg) Indication (Ind) Response (Rsp/RspNeg) Air Remote Host Function Event (Message)

17 Other Interfaces BT COM Server VOS TIM Other h files SendMsg ()
MsgReceived () GetCurrentProcessID () GetExternalProcessID ()

18 Host Data Flow - General Description
Data from the application to the Bluetooth device – function calls (using any of the BT stack API) Data from the BT device to the application – H/W events and Windows messages (using the COM Server) Application BT Interface H/W VOS USB Driver Windows COM Server

19 Summery of Stack Interfaces
COM Server, VOS and other interfaces (BT_COMServer.exe & vos2com.lib) BT_COMserver.h bstr.h global.h vos.h vos2com.h nt-thread.h safearray.h tim.h standards.h BT Interface (BTinterface.lib) com.h scm.h sd.h, sds.h l2ca.h hci.h hci_drv.h bt.h msg.h Product.h dbm.h, dbg.h

20 Communication Procedure - HCI Initialization
Host HCI HCI_ReqStart HCI_START_CNF tSeqNr = N HCI_CmdRegister tMessageGroup = HCI_CONNECT_GROUP tMessageGroup = HCI_DATA_GROUP

21 Communication Procedure - Inquiry
Host HCI HCI_ReqInquiry HCI_INQUIRY_EVT tSeqNr = N, tLap = (0x9E,0x8B,0x33), tInquiryLength = 5, tNrOfResponses = 10 tSeqNr = N, BT_TAddress = 0x , … HCI_INQUIRY_CNF tSeqNr = N, BT_TAddress = 0xAA BB CC DD EE FF, … tSeqNr = N, tNrOfResponses = 2

22 Communication Procedure – ACL Connection
Host HCI Remote HCI_ReqConnect HCI_CONNECT_COMPLETE_EVT HCI_CONNECT_IND HCI_RspConnect Air tSeqNr = N , tAddress = 0xAABBCCDDEEFF, tPacketType = HCI_DM1, …., tAcceptRoleSwitch = HCI_ACCEPT_ROLE_SWITCH tAddress = 0x , tCOD, tLinkType = ACL tSeqNr = N , tHandle = 1, tAddress = 0xAABBCCDDEEFF, tLinkType, tEncryptionMode tSeqNr = N , tHandle = 1, tAddress = 0x , tLinkType, tEncryptionMode tSeqNr = N, tErrorCode, HCI_Troll = HCI_SLAVE

23 Communication Procedure – Data Send
Host HCI Remote HCI_DataAlloc (a pointer is returned) HCI_DATA_CNF HCI_DATA_IND HCI_RspData Air uiLength = N tSeqNr = N, tHandle = 1 HCI_DataExtract (a pointer is returned) tSeqNr = N , tHandle = 1 ptDataMsg, ptHandle, puiLength, ptPacketBoundary tSeqNr = N, tErrorCode, tHandle = 1 HCI_DataSend tSeqNr = N, pucData, tHandle = 1, uiLength = N, tPacketBoundary

24 The HCI Terminal Application

25 The Application Main Window

26 Detail’s Window

27 Software Block Diagram
USB Driver GUI Logic DB Main Application Ericsson Interface COM Server HCI Commands BT Messages BT Events BT API Other Messages Other Output

28 Software Logical View

29 Sending HCI Command Edit Command Parse Command Execute Command
BT API Function Create Detail Object Add to Monitor Add to Log File Show Parameters Lower Layers Unknown Command or Bad Parameters Send Button Known Command Return Void Event

30 HCI Event Sequence Message Map Extract Parameters BT API Function
Create Detail Object Add to Monitor Add to Log File Messages Handlers Lower Layers BT Event Msg Other Messages Return Value - Void Event Respond (or Init Sequence)

31 ?

32 The End Thank you all


Download ppt "Bluetooth HCI Terminal"

Similar presentations


Ads by Google