Accurate time is essential to determining the order in which events occur and is a fundamental aspect of transaction integrity, logging/auditing, troubleshooting and forensics. Accuracy, reliable time is necessary for many applications involving widely distributed resources. PTG-S1001C includes a proprietary CDMA receiver for synchronization to universal Coordinate Time(UTC). It receives its timing information from GPS via the CDMA mobile telecommunications network used by cellular telephones. This means the antenna can be conveniently located inside buildings, anywhere a cell phone signal is available
1. 2017 스마트디바이스지능통신 기말 고사(100)
Smart Device M2M
Date: 2017-06-21
1. Bluetooth가 Read/Write이 가능하도록 설정하는 절차를, 관련 Code를 이용하여 Flowchart로
제시하시오. (Bluetooth 연결과 통신 활용) (30)
2. I2C 방식으로 설계된 기압계를 Arduino Mega에 연결하였다. (30)
1) 결선도를 구체적으로 그리시오. (10)
2. SCL: Serial Clock
SDA: Serial Data
2) 아래 밑줄친 Code를 자세히 설명하시오. (20)
CBMP085 sensor; 기압계 정보를 담고 있는 CBMP085 class 를 sensor 로 선언
void setup() {
Wire.begin(); I2C 를 지원하는 Wire class를 초기화
sensor.Calibration(); } sensor 정보를 정확히 획득하기 위해 초기 보정 작업 실행
void loop() {
long pres = sensor.GetPressure(); 여러 sensor 정보중 기압을 측정하여 pres에 저장
delay(1000); }
3. SensorManager를 이용해 Smartphone으로 온도 정보를 얻으려 한다. (40)
1) Sensor 정보를 Event Listener로 획득하는 이유를 제시하라. (10)
Android에서 OS Message를 획득하는 방법은 BroadcastReceiver와 EventListener 두 가지가 있
다. EventListener는 빈번하게 발생하는 정보, 특정한 App만 필요로 하는 정보에 특화되어 있
으므로, 빈번하게 발생하여 특정 App만 필요한 Sensor 정보를 수신하는 목적으로
EventListener가 적절하다.
2) 아래 Code의 빈곳(#1, #2)을 채우라. (20)
public class MainActivity extends
AppCompatActivity {
public SensorManager sensorMx;
public Sensor sensorTemp;
public SensorEventLx sensorLx;
…
protected void onCreate(Bundle savedInstanceState) {
[#1: sensorMx, sensorTemp, sensorLx 초기화]
[#2: sensorLx 등록]
…
}
3. [#1: sensorMx, sensorTemp, sensorLx 초기화]
sensorMx = (SensorManager) getSystemService(SENSOR_SERVICE);
sensorTemp = sensorMx.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE);
sensorLx = new SensorEventLx();
[#2: sensorLx 등록]
sensorMx.registerListener(sensorLx, sensorTemp, SensorManager.SENSOR_DELAY_NORMAL);
3) SensorEventListener를 상속받은 SensorEventLx의 세부 Code를 제시하라. (10)
public class SensorEventLx implements SensorEventListener {
public float temp;
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_AMBIENT_TEMPERATURE)
temp = event.values[0];
… 나머지는 생략 가능
}