-
Notifications
You must be signed in to change notification settings - Fork 232
/
Copy pathHAPPDU.c
28 lines (26 loc) · 1.01 KB
/
HAPPDU.c
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
// Copyright (c) 2015-2019 The HomeKit ADK Contributors
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// See [CONTRIBUTORS.md] for the list of HomeKit ADK project authors.
#include "HAP+Internal.h"
HAP_RESULT_USE_CHECK
bool HAPPDUIsValidOpcode(uint8_t value) {
HAPAssert(sizeof(HAPPDUOpcode) == sizeof value);
switch ((HAPPDUOpcode) value) {
case kHAPPDUOpcode_CharacteristicSignatureRead:
case kHAPPDUOpcode_CharacteristicWrite:
case kHAPPDUOpcode_CharacteristicRead:
case kHAPPDUOpcode_CharacteristicTimedWrite:
case kHAPPDUOpcode_CharacteristicExecuteWrite:
case kHAPPDUOpcode_ServiceSignatureRead:
case kHAPPDUOpcode_CharacteristicConfiguration:
case kHAPPDUOpcode_ProtocolConfiguration:
case kHAPPDUOpcode_Token:
case kHAPPDUOpcode_TokenUpdate:
case kHAPPDUOpcode_Info: {
return true;
}
}
return false;
}