[data-poll-manager] check user-specified poll period (#3401)

This commit is contained in:
rongli
2018-12-27 22:35:57 -08:00
committed by Jonathan Hui
parent 3fb736c566
commit 328239878d
9 changed files with 41 additions and 19 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ public:
property uint32_t PollPeriod
{
uint32_t get() { return otLinkGetPollPeriod(DeviceInstance); }
void set(uint32_t value) { otLinkSetPollPeriod(DeviceInstance, value); }
void set(uint32_t value) { ThrowOnFailure(otLinkSetPollPeriod(DeviceInstance, value)); }
}
property uint8_t Channel
+8 -4
View File
@@ -2424,15 +2424,19 @@ otLinkGetPollPeriod(
return Result;
}
OTAPI
void
OTAPI
otError
OTCALL
otLinkSetPollPeriod(
_In_ otInstance *aInstance,
_In_ otInstance *aInstance,
uint32_t aPollPeriod
)
{
if (aInstance) (void)SetIOCTL(aInstance, IOCTL_OTLWF_OT_POLL_PERIOD, aPollPeriod);
otError result = OT_ERROR_INVALID_ARGS;
if (aInstance) result = DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_POLL_PERIOD, aPollPeriod));
return result;
}
OTAPI
+1 -2
View File
@@ -4971,8 +4971,7 @@ otLwfIoCtl_otPollPeriod(
if (InBufferLength >= sizeof(uint32_t))
{
otLinkSetPollPeriod(pFilter->otCtx, *(uint32_t*)InBuffer);
status = STATUS_SUCCESS;
status = ThreadErrorToNtstatus(otLinkSetPollPeriod(pFilter->otCtx, *(uint32_t*)InBuffer));
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(uint32_t))