Skip to content

Commit aa76031

Browse files
1000msec以下の間隔が指定された場合の調整。
1 parent 5952002 commit aa76031

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

dConnectDevicePlugin/dConnectDeviceAllJoyn/dConnectDeviceAllJoyn/Sources/Profiles/DPAllJoynLightProfile.mm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,10 @@ - (void) didReceivePostLightRequestForSingleLampWithResponse:(DConnectResponseMe
672672
int delay = [flashing[i] intValue];
673673
if (i % 2 == 0) {
674674
proxy.OnOff = YES;
675-
sleep(delay / 1000);
675+
usleep(delay * 1000);
676676
} else {
677677
proxy.OnOff = NO;
678-
sleep(delay / 1000);
678+
usleep(delay * 1000);
679679
}
680680
}
681681
}
@@ -832,14 +832,14 @@ - (void) didReceivePostLightRequestForLampControllerWithResponse:(DConnectRespon
832832
transitionPeriod:@10
833833
responseCode:&responseCode
834834
lampID:&ignored];
835-
sleep(delay / 1000);
835+
usleep(delay * 1000);
836836
} else {
837837
[proxy transitionLampStateWithLampID:_lightId
838838
lampState:offState
839839
transitionPeriod:@10
840840
responseCode:&responseCode
841841
lampID:&ignored];
842-
sleep(delay / 1000);
842+
usleep(delay * 1000);
843843
}
844844
}
845845
} else {
@@ -969,10 +969,10 @@ - (void) didReceivePutLightRequestForSingleLampWithResponse:(DConnectResponseMes
969969
int delay = [flashing[i] intValue];
970970
if (i % 2 == 0) {
971971
proxy.OnOff = YES;
972-
sleep(delay / 1000);
972+
usleep(delay * 1000);
973973
} else {
974974
proxy.OnOff = NO;
975-
sleep(delay / 1000);
975+
usleep(delay * 1000);
976976
}
977977
}
978978
}
@@ -1126,14 +1126,14 @@ - (void) didReceivePutLightRequestForLampControllerWithResponse:(DConnectRespons
11261126
transitionPeriod:@10
11271127
responseCode:&responseCode
11281128
lampID:&ignored];
1129-
sleep(delay / 1000);
1129+
usleep(delay * 1000);
11301130
} else {
11311131
[proxy transitionLampStateWithLampID:_lightId
11321132
lampState:offState
11331133
transitionPeriod:@10
11341134
responseCode:&responseCode
11351135
lampID:&ignored];
1136-
sleep(delay / 1000);
1136+
usleep(delay * 1000);
11371137
}
11381138
}
11391139
} else {

0 commit comments

Comments
 (0)