bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9....
TRANSCRIPT
![Page 1: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/1.jpg)
Embedded System Lab. II
BluetoothBluetooth
경희대학교 컴퓨터공학과
조 진 성
![Page 2: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/2.jpg)
Embedded System Lab. II 2
Bluetooth 유래Bluetooth 이름의유래
10세기덴마크와노르웨이를통일한바이킹지도자 Harald Blaatand의별명말그대로파란이빨이란의미
다른통신장치기기들간의연결을통일하자는의미로 Project명으로사용서로다른기기들을선이없이연결하겠다는뜻과경쟁관계에있는통신표준을제치고 세계시장을장악하겠다는뜻이담김
Ericsson Mobile Communication의사내프로젝트로시작,1994
![Page 3: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/3.jpg)
Embedded System Lab. II 3
Bluetooth 개념Bluetooth SIG (Special Interest Group)
MembersPromoters : Ericsson, Nokia, IBM, Toshiba, Intel, Microsoft, Motorola , 3Com, Lucent TechnologiesAssociateAdopter
Website : www.bluetooth.com , www.bluetooth.org
![Page 4: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/4.jpg)
Embedded System Lab. II 4
Bluetooth Concept
PDAPDA
노트북 PC데스크탑 PC
디지털카메라
무선온라인게임
무선 LAN연결
전자우편
무선전송
무선데이터전송
전송거리10~100m
무선데이터전송
온라인게임
Bluetooth
![Page 5: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/5.jpg)
Embedded System Lab. II 5
Bluetooth Concept
Data/Voice Data/Voice Access PointsAccess Points
Personal AdPersonal Ad--hoc hoc NetworksNetworks
Cable Cable ReplacementReplacement
![Page 6: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/6.jpg)
Embedded System Lab. II 6
Bluetooth 특징특징
저렴한비용, 낮은전력소모, 작은범위Low Cost : $5 per ChipLow Power : 0.3~30mA (휴대용기기에적합)Short Range : 10m~100m네트워크의자유도, 개인성 (PAN), 다른기종과의접속, 글로벌성
스펙
2.4GHz ISM (Industrial Scientific Medical) Band79 Channel ,1MHz/CH 사용범위 : 10~100m최대전송속도 : 1Mbps
![Page 7: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/7.jpg)
Embedded System Lab. II 7
Bluetooth 적용범위적용범위
핸드폰, PDA, 노트북과같은정보기기들간의양방향근거리통신을위한기술로 SIG (Special Interest Group) 에서개발한무선홈네트워크기술, 표준및제품을총칭한다.휴대폰 : 무선헤드셋, 인터넷접속, 인터콤/무선전화/휴대폰의복합기능폰노트북 : 휴대폰을통한인터넷접속자동차, 컴퓨터주변기기, 가전제품등에적용
![Page 8: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/8.jpg)
Embedded System Lab. II 8
Bluetooth 코어규격
주파수대역 2400~2483.5Mhz 가드밴드 일본: 상하 2Mhz 미국/유럽 : 하측 2Mhz 상측 3.5Mhz
변조방식 BT = 0.5인 GFSK, 변조속도 : 약 1Mbps, 변조지수 : 0.28~0.35
확산변조 - FH 방식 ( 초당 1,600 회호핑, 1 time slot = 625usec- 79 채널호핑 (1MHz 간격), 일본은 23 채널호핑
-클래스 1 : 100 mW, 전력제어기능은옵션송신전력 -클래스 2 : 0.25~25 mW, 전력스텝폭은 8~2 dB
-클래스 3 : 1 mW
수신강도 70 dBm (최소), BER = 10
복신방식 TDD ( Time Division Duplex) 방식마스터 : 짝수슬롯, 슬레이브 : 홀수슬롯
접속방식 -동기접속형, 대칭 : 432.6 kbps-비동기접속형, 비대칭 : 721 kbps
-부호화율 1/3 : 동일한정보를 3회반복하는단순반복코드적용에러정정 -부호화율 2/3 : (15,10) 쇼트하밍 (Shortened /hamming) 부호적용
- ARQ (Automatic Repeat Request)
Bluetooth 1.0b
![Page 9: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/9.jpg)
Embedded System Lab. II 9
Bluetooth 무선접속형태단말기 : 휴대전화, PC (노트북 PC), PC주변기기, PDA, 헤드폰스테레오, AV기기, 디지털카메라, 카네비게이터, 레지스터, 무선 LAN (단말측) 등고정기기 : 고정전화회선, 무선 LAN (고정회선), 오피스네트워크등인프라측의설비
단말기기-단말기기
단말기기-고정기기
고정기기-고정기기
- 노트북 PC로 무선 인터넷을 하는 경우 휴대전화의 접속- 디지털 카메라의 영상의 PC (또는 휴대전화)로 송신하는경우의 접속- PDA와 PC간의 데이터를 교환하는 경우의 접속- PC와 주변기기간의 접속- 헤드폰 스테레오와 휴대전화의 접속- 카 네비게이션과 휴대전화의 접속- PC와 무선 LAN 단말과의 접속
- PC와 전화회선의 접속- 레지스터와 전화회선의 접속- A/V 기기와 전화 회선의 접속
- 오피스 네트워크 (SOHO 등)와 전화회선의 접속- 오피스 네트워크와 CATV 회선의 접속- 인접 네트워크간의 접속
케이블을 연결할 필요가 없이이동성 개선
단말을 전화회선 등 고정단가가까이 배치할 필요가 없어진다.
![Page 10: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/10.jpg)
Embedded System Lab. II 10
Bluetooth 네트워크구성무선접속형태
피코넷 (Piconet)Bluetooth의최소단위네트워크1대의 Master 주위약 10m 이내의거리에최대 7대까지 Slave를접속
스캐터넷 (Scatternet)피코넷을연결하여구성하는네트워크
100m 범위내에서구현가능이론상피코넷을 100개이상접속한스캐터넷구축가능
![Page 11: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/11.jpg)
Embedded System Lab. II 11
유사기술비교
![Page 12: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/12.jpg)
Embedded System Lab. II 12
Pxa255 Pro Bluetooth ModuleProduct Name : BlueSEM-CII Bluetooth V1.1 Module
New Product ID : BTxZ50x2xx(Old ID :BTM1C2NR50, BTMZ5012x0 &BTMZ5012x1)
Product ID DefinitionDigit 1~2 : Product's Abbreviation (BT: Bluetooth)Digit 3 : Interface/Application
(A: USB Interface) (B: RFCOMM Interface)(E: UART Interface, 115.2k) (x: Undecided Code)
Digit 4~6 : Module Size ( Z50 : 0.5cc )Digit 7 : Hardware Revision (Starting from 0 ; x: Undecided Code)Digit 8 : Power Class ( 2 : Class2 )Digit 9 : Customer Code (x: Undecided Code)Digit 10 : Firmware Revision (x: Undecided Code)
![Page 13: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/13.jpg)
Embedded System Lab. II 13
Bluetooth Block Diagram
![Page 14: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/14.jpg)
Embedded System Lab. II 14
Bluetooth Physical Dimension
![Page 15: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/15.jpg)
Embedded System Lab. II 15
Bluetooth Pin Description
![Page 16: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/16.jpg)
Embedded System Lab. II 16
Bluetooth Pin Description
![Page 17: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/17.jpg)
Embedded System Lab. II 17
Bluetooth Test ApplicationPXA-255 Bluetooth 사용준비점퍼스위치 : 7번스위치 OnBluetooth는 ttyS1으로통신
Ramdisk에서 ttys2 이외것들은사용되지않도록수정
![Page 18: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/18.jpg)
Embedded System Lab. II 18
Bluetooth Test Application#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <termios.h> // 시리얼통신프로그램 tcgetattr(), tcsetattr()#include <stdio.h>
#include <strings.h>#include <signal.h>#define BAUDRATE B115200 //속도제어#define MODEMDEVICE "/dev/ttyS1" //ttys!으로통신#define _POSIX_SOURCE 1#define FALSE 0volatile int STOP=FALSE;
![Page 19: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/19.jpg)
Embedded System Lab. II 19
Bluetooth Test Applicationint main(){
int test = 0;int c, res;struct termios oldtio,newtio; //termids구조체설정pid_t pid;int fdttyS1;char my_nick[9];char other_nick[9];char sendtemp[255];char sendbuf[255];char receivebuf[255];char ch;int nicksize,sendsize,i;
![Page 20: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/20.jpg)
Embedded System Lab. II 20
Bluetooth Test ApplicationfdttyS1 = open(MODEMDEVICE, O_RDWR | O_NOCTTY );// 읽기, 쓰기모드로모뎀장치를연다
if (fdttyS1 <0) {perror(MODEMDEVICE); exit(-1); }tcgetattr(fdttyS1,&oldtio); //guswo wkdclfmf djesmsek , termios구조체초기화, 기존세팅모드저장bzero(&newtio, sizeof(newtio));//새로운포트를위한구조체 clearnewtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD;//사이즈조정, 전송속도, 8bit문자, local connetction(모뎀제어하지않음), 문자수신가능
newtio.c_iflag = IGNPAR | ICRNL;/*IGNPAR : Parity 에러가있는문자바이트를무시한다.ICRNL : CR 문자를 NL 문자로변환처리한다. (이설정을안하면다른컴퓨터는 CR 문자를한줄의종
료문자로인식하지않을수있다.)otherwise make device raw (no other input processing)*/
newtio.c_oflag = 0;newtio.c_lflag = ICANON;/*ICANON : canonical 입력을가능하게한다.disable all echo functionality, and don't send signals to calling program*/
![Page 21: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/21.jpg)
Embedded System Lab. II 21
Bluetooth Test Applicationnewtio.c_cc[VINTR] = 0; //ctrl-cnewtio.c_cc[VQUIT] = 0; //ctrl-/newtio.c_cc[VERASE] = 0; //delnewtio.c_cc[VKILL] = 0; //@newtio.c_cc[VEOF] = 4; //ctrl-dnewtio.c_cc[VTIME] = 0; //time 시간설정 -> inter-character timer unused newtio.c_cc[VMIN] = 1; //read시최소한의문자갯수, blocking read until 1 character arrives newtio.c_cc[VSWTC] = 0; //'\0' newtio.c_cc[VSTART] = 0; //ctrl-qnewtio.c_cc[VSTOP] = 0; //ctrl-snewtio.c_cc[VSUSP] = 0; //ctrl-z newtio.c_cc[VEOL] = 0; //'\0'newtio.c_cc[VREPRINT] = 0; //ctrl-rnewtio.c_cc[VDISCARD] = 0; //ctrl-unewtio.c_cc[VWERASE] = 0; //ctrl-wnewtio.c_cc[VLNEXT] = 0; //ctrl-vnewtio.c_cc[VEOL2] = 0; //'\0'/*이제 modem 라인을초기화하고포트세팅을마친다.*/tcflush(fdttyS1, TCIFLUSH);tcsetattr(fdttyS1,TCSANOW,&newtio);
![Page 22: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/22.jpg)
Embedded System Lab. II 22
Bluetooth Test Applicationprintf("input your nickname(length<=8):");scanf("%8s",&my_nick);nicksize=strlen(my_nick);for(i=0;i<nicksize;i++)
sendbuf[i]=my_nick[i]; //닉사이즈만큼 my_nick의내용을버퍼에저장
sendbuf[nicksize++]='`'; //버퍼에추가내용기입sendbuf[nicksize++]='s';sendbuf[nicksize++]='a';sendbuf[nicksize++]='y';sendbuf[nicksize++]=':';sendsize=0;
char recv_ID[9];char allo_ID[9];//broadcast로전송함으로모든 bluetooth메세지를받으나그중원하는 nickname에게서온메시지만화면에출력한다printf("Input nickname to communicate(length<=8):");scanf("%8s",&allo_ID);printf("Input 'q' to quit\n");
![Page 23: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/23.jpg)
Embedded System Lab. II 23
Bluetooth Test Applicationif((pid=fork())<0){//child process생성
printf("error!!");return -1;
}if(pid>0){//parent process
//terminal에서 data를 read하여화면에출력while(ch!='q'){
res = read(fdttyS1,receivebuf,255);//ttyS1에서읽어옴.for(i = 0; i < 9; i++){
if(receivebuf[i] != '`')recv_ID[i] = receivebuf[i];
elsebreak;
}if(!strcmp(allo_ID, recv_ID)){//설정한 nickname과같은지비교후출력
if(res>0)printf("%s\n",receivebuf);
ch=receivebuf[nicksize];}
}kill(pid, SIGQUIT);
}
![Page 24: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/24.jpg)
Embedded System Lab. II 24
Bluetooth Test Applicationelse{//child process
//입력받은 data를 terminal에 writegets(sendtemp);while(ch!='q'){
printf("=>");gets(sendtemp);sendsize=strlen(sendtemp);if(sendsize>0){
for(i=nicksize;i<nicksize+sendsize;i++)sendbuf[i]=sendtemp[i-nicksize];
sendbuf[sendsize+nicksize]='\0';sendbuf[sendsize+nicksize+1]='\n';test = write(fdttyS1,sendbuf,nicksize+2+sendsize);if(test == 0)
printf("write error\n");printf("%s\n",sendbuf);ch=sendtemp[0];
}}kill(pid, SIGQUIT);
}tcsetattr(fdttyS1,TCSANOW,&oldtio);return 0;
}
![Page 25: Bluetooth - khu.ac.krmesl.khu.ac.kr/.../esl2/closed.pxa255/esl2-06-bluetooth.pdf · 2016. 9. 10. · Embedded System Lab. II 2 Bluetooth 유래 Bluetooth 이름의유래 910세기덴마크와노르웨이를통일한바이킹지도자Harald](https://reader034.vdocuments.us/reader034/viewer/2022051805/5ff49ed42c13ce66ac478d17/html5/thumbnails/25.jpg)
Embedded System Lab. II 25
Bluetooth 실행화면