1. 2014 Final-Term Examination (100)
Smart Device Intelligent Communication
Date: June 18, 2014.
1. 스마트 저울에 대해 다음을 답하라. (50)
1) PC + Arduino + 압력 센서(I2C) + Bluetooth(Serial Port)를 이용해 Smartphone에 무게
정보를 전달하려 한다. 스마트 저울을 위한 기기간 연결 구조에 대한 Block Diagram
을 그려라. (HW Block, Arduino Sketch에서 활용한 가능한 Class 제시) (10)
2) Bluetooth Module(VCC, GND, TXD, RXD)과 Arduino(5V, GND, D0-D13)의 결선 구조를
그림으로 그리고 이를 구동할 Arduino Sketch Code를 제시하라. (20)
- B의 VCC, GND를 A의 5V, GND에 각각 연결
- B의 TXD를 A의 D2, B의 RXD를 A의 A3에 연결(D0, D1을 제외한 어떤 번호든 좋음)
- Arduino Sketch Code
#include <SoftwareSerial.h>
SoftwareSerial blueSerial(2, 3);
void setup()
{
blueSerial.begin(115200);
}
3) Arduino의 난수 함수를 이용해 무게 정보를 암호화 및 복호화하는 Arduino Sketch
Code를 작성하라. 무게 정보는 “int nScale”에 있다고 가정하라. (20)
int nScale;
int myKey = 1234;
2. void loop()
{
randomSeed(myKey);
nScale += random(1024);
randomSeed(myKey);
nScale -= random(1024);
}
2. Bluetooth에 대해 다음을 답하라. (50)
1) Google이 API level 14부터 Android에 BluetoothHealth Class를 제공하는 이유는 무엇
인지 논리적으로 설명하시오. (10)
- 현재 인기를 얻고 있는 헬스 기기의 Profile을 제공하기 위해서
- 헬스 기기 제어를 Android에서 간편하게 하기 위해
2) Bluetooth 기기 연결에는 MAC Address와 UUID or GUID가 필요하다. 다른 Bluetooth
장치의 MAC Address를 Android로 얻는 방법을 설명하라. (30)
- 함수 Bluetooth.getDefaultAdapter()를 이용하여 현재 기기의 BluetoothAdapter 정보 획득
- 함수 Bluetooth.startDiscovery()를 이용하여 주변 기기의 탐색 시작
- 탐색을 위해 BroadcastReceiver를 미리 생성하여 등록시킴
- BroadcastReceiver의 함수 onReceive에서 BluetoothDevice 정보를 획득
- 획득한 BluetoothDevice를 이용하면 BluetoothDevice.getAddress()를 통해 MAC Address
얻을 수 있음
3) UUID or GUID를 구체적으로 설명하라. (10)
- 문자열로 생성하는 128비트 크기의 고유한 식별자
- UUID를 이용하면 중복되지 않는 고유한 숫자를 생성하여 앱이나 프로그램을 유일하게 구
별할 수 있음