Mistake on this page? Email us
pt_common_api.h
Go to the documentation of this file.
1 /*
2  * ----------------------------------------------------------------------------
3  * Copyright 2018 ARM Ltd.
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ----------------------------------------------------------------------------
19  */
20 
21 #ifndef PT_API_VERSION
22 #define PT_API_VERSION 2
23 #endif
24 #if PT_API_VERSION != 2
25 #error "Including mixed versions of Protocol API"
26 #endif
27 
28 #ifndef PT_COMMON_API_H
29 #define PT_COMMON_API_H
30 
36 #include <stdint.h>
37 #include "common/constants.h"
39 
40 typedef struct pt_api_mutex_s pt_api_mutex_t;
41 typedef int32_t connection_id_t;
42 #define PT_API_CONNECTION_ID_INVALID -1
43 
44 typedef struct pt_client_data_s pt_client_t;
45 
46 typedef enum { NONE, QUEUE } queuemode_t;
47 
51 typedef enum {
52  PT_STATUS_SUCCESS = 0,
53  PT_STATUS_ERROR,
54  PT_STATUS_UNNECESSARY,
55  PT_STATUS_ITEM_EXISTS,
56  PT_STATUS_INVALID_PARAMETERS,
57  PT_STATUS_ALLOCATION_FAIL,
58  PT_STATUS_NOT_CONNECTED,
59  PT_STATUS_NOT_FOUND,
60  PT_STATUS_FEATURE_INITIALIZATION_FAIL
61 } pt_status_t;
62 
66 typedef enum {
67  PT_STATE_UNREGISTERED,
68  PT_STATE_REGISTERING,
69  PT_STATE_REGISTERED,
70  PT_STATE_UNREGISTERING
72 
76 typedef enum {
77  PT_DEVICE_FEATURE_NONE = 0,
78  PT_DEVICE_FEATURE_CERTIFICATE_RENEWAL = (1 << 1),
79  PT_DEVICE_FEATURE_FIRMWARE_UPDATE = (1 << 2),
81 
82 #endif
83 
Common constants used in Edge Core.
pt_device_feature_e
Enumeration contain device feature flags.
Definition: pt_common_api.h:76
Default message ID generator for JSON-RPC messages.
pt_status_t
Enumeration containing the possible return status codes for Protocol API functions.
Definition: pt_common_api.h:51
pt_device_state_e
Enumeration contain device registration states.
Definition: pt_common_api.h:66