Skip to content

Commit

Permalink
Device 상태 변경 iotoasis#331
Browse files Browse the repository at this point in the history
  • Loading branch information
pahnjy01 committed Jan 19, 2017
1 parent a55418a commit 2eba340
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ public String deviceExecute(String deviceId,String deviceCommand, String session
* Device 제어 후 제어 결과가 Success면 Device Subscription 요청
*/
if(resultMessage.getCode().equals(ClientProfile.RESPONSE_SUCCESS_ONEM2MCODE)) {
// 디바이스 상태 저장.
device.setDeviceStatus(deviceCommand);
deviceStore.update(device);

String subscriptionUri = device.getDeviceUri() + (ClientProfile.actionDeviceCommand(device.getDeviceUri()) ? ClientProfile.SI_CONTAINER_ACTION : ClientProfile.SI_CONTAINER_POWER) + ClientProfile.SI_CONTAINER_STATUS;
String response = deviceSubscription(subscriptionUri, deviceControlMessage.get_commandId());
logger.debug(LogPrint.LogMethodNamePrint() + " | Device Subscription : " + " , Device Uri = " + device.getDeviceUri() + " , Result : " + response + " , Session ID = " + sessionId);
Expand Down

0 comments on commit 2eba340

Please sign in to comment.