블루투스를 이용한 스마트 도어락
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
해당 자료는 10페이지 까지만 미리보기를 제공합니다.
10페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

블루투스를 이용한 스마트 도어락에 대한 보고서 자료입니다.

목차

국문요지 -----------------------------------------------2

1. 서론 ------------------------------------------------6
1) 배경
2) 동기 및 필요성

2. 본론 ------------------------------------------------6
1) 구상
2) 구현 내용
3) 주요 이론
4) 실험 구성 및 과정
5) 부품 선정

3. 결과 및 고찰 ------------------------------------------18
1) 실험 결과
2) 연구 계획

4. 공동 팀원 및 역할 분담 -----------------------------------19

5. 참고 문헌 ---------------------------------------------19

6. 부록 -------------------------------------------------20
1) 데이터시트
2) 회로도
3) 프로그램소스코드

본문내용

xt = context;
try {
// UUID를 사용하여 서버 소켓을 만듭니다.
tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(
"My Bluetooth", mUuid);
} catch (IOException e) {
showToast("서버 소켓을 만드는데 실패하였습니다. " + e.toString());
}
mmServerSocket = tmp;
}
public void run() {
showToast("클라이언트를 기다리는 중입니다.");
BluetoothSocket socket = null;
// 클라이언트가 접속을 시도할때까지 기다립니다.
while (true) {
try {
if (mmServerSocket != null) {
socket = mmServerSocket.accept();
}
} catch (IOException e) {
break;
}
// If a connection was accepted
if (socket != null) {
// 클라이언트와 연결되고 소켓이 생성되면
// 소켓을 통해 데이터 송수신을 시작합니다.
startConnectedThread(socket);
showToast("클라이언트와 연결되었습니다.");
try {
if (mmServerSocket != null) {
mmServerSocket.close();
}
} catch (IOException e) {
e.printStackTrace();
showToast("서버 소켓을 종료하는 중 에러가 발생하였습니다. " + e.toString());
}
break;
}
}
}
// 리스닝 소켓을 닫고 스레드를 종료합니다.
public void cancel() {
try {
if (mmServerSocket != null) {
mmServerSocket.close();
}
} catch (IOException e) {
}
}
}
private void showToast(String msg) {
Message message = handler.obtainMessage();
message.what = SHOW_TOAST;
message.arg1 = 0;
message.arg2 = 0;
message.obj = msg;
handler.sendMessage(message);
}
}

package com.example.doorlock;
import java.util.ArrayList;
import java.util.Set;
import android.app.ListActivity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class SearchBluetoothDeviceActivity extends ListActivity {
private ArrayAdapter mArrayAdapter;
private ArrayList mBluetoothDeviceList;
BluetoothAdapter mBluetoothAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search_bluetooth_device_activity);
ArrayList arrayList = new ArrayList();
mArrayAdapter = new ArrayAdapter(this,
android.R.layout.simple_list_item_1, arrayList);
setListAdapter(mArrayAdapter);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothDeviceList = new ArrayList();
if (mBluetoothAdapter == null) {
finish();
}
if (!mBluetoothAdapter.isEnabled()) {
Intent it = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(it, MyBluetoothAppActivity.REQUEST_ENABLE_BT);
}
Set pairedDevices = mBluetoothAdapter
.getBondedDevices();
if (pairedDevices.size() > 0) {
for (BluetoothDevice device : pairedDevices) {
mArrayAdapter
.add(device.getName() + "\n" + device.getAddress());
mBluetoothDeviceList.add(device);
}
}
}
@Override
public void onListItemClick(ListView parent, View v, int position, long id) {
super.onListItemClick(parent, v, position, id);
BluetoothDevice device = mBluetoothDeviceList.get(position);
Intent it = new Intent();
it.putExtra("device", device);
setResult(MyBluetoothAppActivity.SEARCH_BT_DEVICE, it);
finish();
}
}
  • 가격10,000
  • 페이지수43페이지
  • 등록일2014.04.21
  • 저작시기2013.11
  • 파일형식한글(hwp)
  • 자료번호#914614
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니