-
Notifications
You must be signed in to change notification settings - Fork 232
/
Copy pathHAPBLECharacteristic+Signature.c
72 lines (67 loc) · 2.39 KB
/
HAPBLECharacteristic+Signature.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// 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
HAPError HAPBLECharacteristicGetSignatureReadResponse(
const HAPCharacteristic* characteristic,
const HAPService* service,
HAPTLVWriterRef* responseWriter) {
HAPPrecondition(characteristic);
HAPPrecondition(service);
HAPPrecondition(responseWriter);
HAPError err;
err = HAPBLEPDUTLVSerializeCharacteristicType(characteristic, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeServiceInstanceID(service, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeServiceType(service, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeHAPCharacteristicPropertiesDescriptor(characteristic, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeGATTUserDescriptionDescriptor(characteristic, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeGATTPresentationFormatDescriptor(characteristic, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeGATTValidRange(characteristic, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeHAPStepValueDescriptor(characteristic, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeHAPValidValuesDescriptor(characteristic, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
err = HAPBLEPDUTLVSerializeHAPValidValuesRangeDescriptor(characteristic, responseWriter);
if (err) {
HAPAssert(err == kHAPError_OutOfResources);
return err;
}
return kHAPError_None;
}