Bluetooth 옵션 모듈 - 블루투스 명칭 유래, 역사
Bluetooth II 모듈
Bluetooth 옵션 모듈 II
1. 블루투스 명칭의 유래
블루투스라는 명칭은 10세기 덴마크와 노르웨이를 통일한 바이킹 헤럴드 블루투스(Harald Bluetooth; 910∼985)의 이름에서 따왔다. 그는 블루베리를 즐겨 먹어 치아가 항상 푸른빛을 띠고 있어 '푸른 이빨'로 불렸다고 한다. 블루투스가 스칸디나비아 반도를 통일한 것처럼 PC와 휴대폰 및 각종 디지털기기 등을 하나의 무선통신 규격으로 통일한다는 상징적 의미가 담겨 있다. 처음에는 프로젝트명으로 사용했으나 브랜드 이름으로 발전했다.
Bluetooth 옵션 모듈 II
2. 블루투스의 역사
1994년 세계적인 통신기기 제조회사인 스웨덴의 에릭슨은 휴대폰과 그 주변장치를 연결하는 무선 솔루션을 고안해 케이블을 대체하기 위한 연구를 시작했다. 즉 휴대폰과 주변기기 간에 소비전력은 적으면서 값싼 무선 인터페이스를 연구하기 시작한 것이다. 이후 에릭슨은 다른 휴대장치 제조사와 제휴를 추진했고 마침내 1998년 2월 에릭슨을 주축으로 노키아, IBM, 도시바, 인텔 등의 대표적인 첨단 IT 기술회사로 구성된 블루투스 SIG(Special Interest Group)가 발족했다. 블루투스 SIG에는 현재 모토로라•마이크로소프트, 루슨트테크롤로지, 스리콤 등 세계적인 기업이 참여하며 전 세계적인 표준 규격으로 자리잡았다.
Bluetooth 옵션 모듈 II
3. 블루투스의 기능
1. 무선헤드셋 : 전화기를 주머니나 가방에 넣어둔 채로 전화를 걸거나 받을 수 있다. 스테레오 헤드셋이라면 전화통화뿐 아니라 mp3 음악 감상도 무선헤드셋으로 가능하다.
2. 무선파일전송 : 휴대폰과 휴대폰 또는 휴대폰과 PC간에 사진이나 벨소리 등 파일을 전송한다. 요금이 발생하지는 않지만 블루투스가 가능한 휴대폰끼리만 가능하다.
Bluetooth 옵션 모듈 II
4. 블루투스가 주목받는 이유
첫째, 블루투스는 저렴한 가격에 저전력(100㎽)으로 사용할 수 있다는 점이 장점이다. 둘째, 블루투스는 주파수 대역을 나누기 때문에 데이터 전송을 여러 주파수에 걸쳐서 분할해 보낼 수 있다. 그렇기 때문에 무선 전송에 따른 보안 위협에서도 상대적으로 안전하다. 셋째, 블루투스 신호는 벽이나 가방 등을 통과해서 전송될 수 있으므로 배선이나 연결 상황을 육안으로 확인할 필요가 없고 장애물이 있어도 신호를 주고받을 수 있다. 넷째, 주파수 특성도 전 방향으로 신호가 전송되므로 각 장치를 연결하기 위해 일정한 각도를 유지할 필요가 없어 사용하기에 편리하다. 마지막으로 무엇보다 전 세계 수많은 국가가 블루투스 표준 규격을 준수하기 때문에 세계 어느 곳에서나 같은 기술을 이용할 수 있다. 따라서 블루투스를 이용한 무선 네트워크는 언제 어디서나 모든 정보기기 간의 자유로운 데이터 교환이 이뤄질 수 있다.
Bluetooth 옵션 모듈 II
Bluetooth 옵션 모듈 II
Bluetooth 옵션 모듈 II
Bluetooth 옵션 모듈 II
Bluetooth 옵션 모듈 II
5. 실습
OptBlueTooth_Test 예제는 두 개의 각각 USN모트끼리 서로 BlueTooth옵션 모듈을 이용하여 블루통신 통신을 테스트해 보는 간단한 예제이다. BlueTooth옵션 모듈을 장착한 하나의 USN모트는 PC와 시리얼로 연결하여 대기한다. 이때 다른 USN 모트에서 블루투스 통신을 요청하게 되고 두 사이의 블루투스 통신이 이루어 지게 된다. 블루투스 통신에 의해 받은 정보는 시리얼을 통해 PC로 보내지게 된다. 이 때, 두 프로그램 사이의 GroupID는 동일해야 한다. PC와 연결되는 USN 모트는 노드 아이디를 0으로 하고, 다른 하나는 노드 아이디를 1로 하여 실습해야 한다. 사용자는 PC상에서 동작되는 SerialTest프로그램을 통해 해당 센싱 값을 확인할 수 있다. 이번 예제의 구성도는 아래 그림과 같다.
Bluetooth 옵션 모듈 II
#include "Opt_App.h"
configuration Opt_BlueTooth_AppC {}
implementation {
components MainC, Opt_BlueTooth_AppM as Opt_AppM, LedsC, new TimerMilliC();
Opt_AppM.Boot -> MainC;
Opt_AppM.Leds -> LedsC;
Opt_AppM.Timer -> TimerMilliC;
// Interaction Components
components InteractionC;
Opt_AppM.Interaction -> InteractionC;
components SCSuartDBGC;
Opt_AppM.SCSuartDBGstd -> SCSuartDBGC;
Opt_AppM.SCSuartDBG -> SCSuartDBGC;
}
#include "Opt_App.h"
module Opt_BlueTooth_AppM {
uses {
interface Boot;
interface Leds;
interface Timer<TMilli>;
interface Interaction;
interface StdControl as SCSuartDBGstd;
interface SCSuartDBG;
}
} implementation {
#define MyOPT_Type OPT_BLUETOOTH
#define BlueTooth_Connector_Address 1
enum {B_Init=0x00, B_Info=0x01, B_Wait=0x02, B_Search=0x03, B_TryToConnect=0x04, B_SuccConnect=0x05};
norace uint8_t BlueTooth_status, ConnectAddr[32], ConnectAddrSize;
void BlueTooth_CommandOrder();
task void getBlueInfo();
task void getNeighborAddr();
task void runMaster();
task void runSlave();
task void runConnector();
task void Disconnector();
//////////////////////////////////////////////////////////
norace App_struct_t AP_Frame;
norace uint8_t MsgBuff[64], myAppType, myOptType, TestSeq=0;
norace uint8_t SendStrMsg[64]={0}, MsgSeq=0, SendMsgLen;
//void SensorsPrint (uint8_t App_size);
//////////////////////////////////////////////////////////
task void TryToConfigure() {call Interaction.StartConfiguration (&AP_Frame);}
task void TryToSetTimer() {call Interaction.SetSamplingTime(Default_Sampling_Time);}
//////////////////////////////////////////////////////////
event void Boot.booted() {
call SCSuartDBGstd.start();
post TryToConfigure();
}
event void Interaction.StartDoneConfiguration(uint8_t appType, uint8_t optType) {
sprintf(MsgBuff, "%d myAppType:%X, myOptType:%X\r\n", TOS_NODE_ID, appType, optType);
call SCSuartDBG.UARTSend(MsgBuff, strlen(MsgBuff));
if (optType != MyOPT_Type) {
post TryToConfigure();
return;
}
call Leds.led0On();
myAppType = appType;
myOptType = optType;
BlueTooth_status = B_Init;
post getBlueInfo();
}
event void Interaction.getSensorDataDone (App_struct_t *App_Payload, uint8_t App_size) {
call Leds.led0Toggle();
if(AP_Frame.AppData.message.dataLength<64)
AP_Frame.AppData.message.Msg_Data[AP_Frame.AppData.message.dataLength] = 0;
else
AP_Frame.AppData.message.Msg_Data[63] = 0;
sprintf(MsgBuff, "%d[%d]: %s", TOS_NODE_ID, BlueTooth_status, AP_Frame.AppData.message.Msg_Data);
call SCSuartDBG.UARTSend(MsgBuff, strlen(MsgBuff));
if(BlueTooth_status != B_SuccConnect)
BlueTooth_CommandOrder();
}
event void Interaction.Urgency_Data (uint8_t *Urgency_Payload, uint8_t len) {
}
//////////////////////////////////////////////////////////
event void Timer.fired(){
if(BlueTooth_status == B_SuccConnect){
call Leds.led1Toggle();
sprintf(SendStrMsg, "%d send this message[%d th] by using BlueTooth Communication\r\n", TOS_NODE_ID, MsgSeq++);
SendMsgLen = strlen(SendStrMsg);
if(SendMsgLen>64){
SendMsgLen = 64;
SendStrMsg[62] = '\r';
SendStrMsg[63] = '\n';
}
call Interaction.Send_LongData(OPT_BLUETOOTH, SUBCMD1_SEND_LONG_DATA, SendMsgLen, SendStrMsg);
}
return;
}
//////////////////////////////////////////////////////////
void BlueTooth_CommandOrder() {
if (BlueTooth_status==B_Info) {
if(TOS_NODE_ID==BlueTooth_Connector_Address){
post runSlave();
}else{
post runMaster();
}
}else if (BlueTooth_status==B_Search) {
if(TOS_NODE_ID==BlueTooth_Connector_Address){
post runSlave();
}
}else if (BlueTooth_status==B_TryToConnect) {
BlueTooth_status = B_SuccConnect;
call Timer.startPeriodic(Default_Sampling_Time);
}
}
task void getBlueInfo () {
Cmd_struct_t CMD_Frame;
BlueTooth_status = B_Info;
CMD_Frame.CMDType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.packetType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.optType = OPT_BLUETOOTH;
CMD_Frame.CMD_Data.OptConfig.subCmd1 = SUBCMD1_INFO_LONG_DATA;
CMD_Frame.CMD_Data.OptConfig.subCmd2 = 0;
memset(CMD_Frame.CMD_Data.OptConfig.ConfigData.GeneralData, 0, 16);
call Interaction.Process_CMD((void*)&CMD_Frame, sizeof(Cmd_struct_t));
}
task void getNeighborAddr () {
Cmd_struct_t CMD_Frame;
BlueTooth_status = B_Search;
CMD_Frame.CMDType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.packetType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.optType = OPT_BLUETOOTH;
CMD_Frame.CMD_Data.OptConfig.subCmd1 = SUBCMD1_NEIGHBOR_LONG_DATA;
CMD_Frame.CMD_Data.OptConfig.subCmd2 = 0;
memset(CMD_Frame.CMD_Data.OptConfig.ConfigData.GeneralData, 0, 16);
call Interaction.Process_CMD((void*)&CMD_Frame, sizeof(Cmd_struct_t));
}
task void runMaster () {
Cmd_struct_t CMD_Frame;
BlueTooth_status = B_SuccConnect;
CMD_Frame.CMDType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.packetType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.optType = OPT_BLUETOOTH;
CMD_Frame.CMD_Data.OptConfig.subCmd1 = SUBCMD1_SETMASTER_LONG_DATA;
CMD_Frame.CMD_Data.OptConfig.subCmd2 = 0;
memset(CMD_Frame.CMD_Data.OptConfig.ConfigData.GeneralData, 0, 16);
call Interaction.Process_CMD((void*)&CMD_Frame, sizeof(Cmd_struct_t));
}
task void runSlave () {
Cmd_struct_t CMD_Frame;
BlueTooth_status = B_TryToConnect;
CMD_Frame.CMDType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.packetType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.optType = OPT_BLUETOOTH;
CMD_Frame.CMD_Data.OptConfig.subCmd1 = SUBCMD1_SETSLAVE_LONG_DATA;
CMD_Frame.CMD_Data.OptConfig.subCmd2 = 0;
memset(CMD_Frame.CMD_Data.OptConfig.ConfigData.GeneralData, 0, 16);
call Interaction.Process_CMD((void*)&CMD_Frame, sizeof(Cmd_struct_t));
}
task void runConnector () {
Cmd_struct_t CMD_Frame;
BlueTooth_status = B_TryToConnect;
CMD_Frame.CMDType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.packetType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.optType = OPT_BLUETOOTH;
CMD_Frame.CMD_Data.OptConfig.subCmd1 = SUBCMD1_CONNECT_LONG_DATA;
CMD_Frame.CMD_Data.OptConfig.subCmd2 = 0;
if(ConnectAddrSize>16) ConnectAddrSize = 16;
memcpy(CMD_Frame.CMD_Data.OptConfig.ConfigData.GeneralData, ConnectAddr, ConnectAddrSize);
call Interaction.Process_CMD((void*)&CMD_Frame, sizeof(Cmd_struct_t));
}
task void Disconnector() {
Cmd_struct_t CMD_Frame;
BlueTooth_status = B_Init;
CMD_Frame.CMDType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.packetType = PACKET_CONTROL;
CMD_Frame.CMD_Data.OptConfig.optType = OPT_BLUETOOTH;
CMD_Frame.CMD_Data.OptConfig.subCmd1 = SUBCMD1_DISCONNECT_LONG_DATA;
CMD_Frame.CMD_Data.OptConfig.subCmd2 = 0;
if(ConnectAddrSize>16) ConnectAddrSize = 16;
memcpy(CMD_Frame.CMD_Data.OptConfig.ConfigData.GeneralData, ConnectAddr, ConnectAddrSize);
call Interaction.Process_CMD((void*)&CMD_Frame, sizeof(Cmd_struct_t));
}
}
'myPPT' 카테고리의 다른 글
magnetism & electromagnetism (자기와 & 전자기) (0) | 2015.09.16 |
---|---|
광합성 (0) | 2015.09.13 |
일반물리학 및 실험- 원운동과 구심력 (0) | 2015.09.08 |
낙하운동과 중력가속도 측정 Free-fall and Acceleration due to Gravity (0) | 2015.09.06 |
무역해상보험이란? (0) | 2015.09.03 |