CloudPlugs REST Library  1.0.0
for ANSI C
cp_rest_json.h
Go to the documentation of this file.
1 /*
2 Copyright 2014 CloudPlugs Inc.
3 
4 Licensed to the Apache Software Foundation (ASF) under one
5 or more contributor license agreements. See the NOTICE file
6 distributed with this work for additional information
7 regarding copyright ownership. The ASF licenses this file
8 to you under the Apache License, Version 2.0 (the
9 "License"); you may not use this file except in compliance
10 with the License. You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14 Unless required by applicable law or agreed to in writing,
15 software distributed under the License is distributed on an
16 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 KIND, either express or implied. See the License for the
18 specific language governing permissions and limitations
19 under the License.
20 */
21 
22 #ifndef CP_REST_JSON_H
23 #define CP_REST_JSON_H
24 
25 #include <jansson.h>
26 #include "cp_rest.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 typedef double cp_time;
36 
45 cp_res cloudplugs_enroll_json(cp_session cps, json_t* obj, json_t** result);
46 
58 cp_res cloudplugs_enroll_product_json(cp_session cps, const char* model, const char* hwid, const char* pass, json_t* props, json_t** result);
59 
72 cp_res cloudplugs_enroll_prototype_json(cp_session cps, const char* name, const char* hwid, const char* pass, json_t* perm, json_t* props, json_t** result);
73 
86 cp_res cloudplugs_enroll_ctrl_json(cp_session cps, const char* model, const char* ctrl, const char* pass, const char* hwid, const char* name, json_t** result);
87 
98 cp_res cloudplugs_control_device_json(cp_session cps, const char* model, const char* ctrl, const char* pass, json_t** result);
99 
109 cp_res cloudplugs_uncontrol_device_json(cp_session cps, const char* plugid, json_t* plugid_controlled, json_t** result);
110 
125 cp_res cloudplugs_get_channel_json(cp_session cps, const char* channel_mask, json_t* before, json_t* after, json_t* at, json_t* of, int offset, int limit, json_t** result);
126 
135 cp_res cloudplugs_get_device_json(cp_session cps, const char* plugid, json_t** result);
136 
146 cp_res cloudplugs_get_device_prop_json(cp_session cps, const char* plugid, const char* prop, json_t** result);
147 
157 cp_res cloudplugs_set_device_prop_json(cp_session cps, const char* plugid, const char* prop, json_t* value);
158 
167 cp_res cloudplugs_remove_device_prop_json(cp_session cps, const char* plugid, const char* prop);
168 
184 cp_res cloudplugs_set_device_json(cp_session cps, const char* plugid, json_t* value, json_t** result);
185 
194 cp_res cloudplugs_unenroll_json(cp_session cps, json_t* plugid, json_t** result);
195 
210 cp_res cloudplugs_retrieve_data_json(cp_session cps, const char* channel_mask, cp_time before, cp_time after, cp_time at, const char* of, int offset, int limit, json_t** result);
211 
231 cp_res cloudplugs_publish_data_json(cp_session cps, const char* channel, json_t *body, json_t** result);
232 
246 cp_res cloudplugs_remove_data_json(cp_session cps, const char* channel_mask, json_t* id, json_t* before, json_t* after, json_t* at, json_t* of, json_t** result);
247 
260 cp_res cloudplugs_set_device_location_json(cp_session cps, const char* plugid, double longitude, double latitude, double altitude, double accuracy, cp_time timestamp);
261 
270 cp_res cloudplugs_get_device_location_json(cp_session cps, const char* plugid, json_t** result);
271 
272 #ifdef __cplusplus
273 }
274 #endif
275 
276 #endif // CP_REST_JSON_H
cp_res cloudplugs_set_device_prop_json(cp_session cps, const char *plugid, const char *prop, json_t *value)
cp_res cloudplugs_set_device_location_json(cp_session cps, const char *plugid, double longitude, double latitude, double altitude, double accuracy, cp_time timestamp)
cp_res cloudplugs_remove_data_json(cp_session cps, const char *channel_mask, json_t *id, json_t *before, json_t *after, json_t *at, json_t *of, json_t **result)
cp_res cloudplugs_get_channel_json(cp_session cps, const char *channel_mask, json_t *before, json_t *after, json_t *at, json_t *of, int offset, int limit, json_t **result)
int cp_res
Definition: cp_rest.h:35
cp_res cloudplugs_enroll_prototype_json(cp_session cps, const char *name, const char *hwid, const char *pass, json_t *perm, json_t *props, json_t **result)
cp_res cloudplugs_get_device_json(cp_session cps, const char *plugid, json_t **result)
cp_res cloudplugs_get_device_location_json(cp_session cps, const char *plugid, json_t **result)
cp_res cloudplugs_enroll_json(cp_session cps, json_t *obj, json_t **result)
cp_res cloudplugs_enroll_ctrl_json(cp_session cps, const char *model, const char *ctrl, const char *pass, const char *hwid, const char *name, json_t **result)
cp_res cloudplugs_retrieve_data_json(cp_session cps, const char *channel_mask, cp_time before, cp_time after, cp_time at, const char *of, int offset, int limit, json_t **result)
struct _cloudplugs_session * cp_session
Definition: cp_rest.h:31
cp_res cloudplugs_enroll_product_json(cp_session cps, const char *model, const char *hwid, const char *pass, json_t *props, json_t **result)
double cp_time
Definition: cp_rest_json.h:35
cp_res cloudplugs_control_device_json(cp_session cps, const char *model, const char *ctrl, const char *pass, json_t **result)
cp_res cloudplugs_uncontrol_device_json(cp_session cps, const char *plugid, json_t *plugid_controlled, json_t **result)
cp_res cloudplugs_set_device_json(cp_session cps, const char *plugid, json_t *value, json_t **result)
cp_res cloudplugs_unenroll_json(cp_session cps, json_t *plugid, json_t **result)
cp_res cloudplugs_get_device_prop_json(cp_session cps, const char *plugid, const char *prop, json_t **result)
cp_res cloudplugs_remove_device_prop_json(cp_session cps, const char *plugid, const char *prop)
cp_res cloudplugs_publish_data_json(cp_session cps, const char *channel, json_t *body, json_t **result)