9 #include "kii_task_callback.h"
17 #define KII_OBJECTID_SIZE 36
19 #define KII_UPLOADID_SIZE 64
23 #define __FILE__ ("__FILE__ macro is not available")
30 #define M_KII_LOG(x) \
31 if (kii->kii_core.logger_cb != NULL) {\
32 kii->kii_core.logger_cb("file:%s, line:%d ", __FILE__, __LINE__); \
39 #define KII_TASK_NAME_RECV_MSG "recv_msg_task"
40 #ifdef KII_PUSH_KEEP_ALIVE_INTERVAL_SECONDS
41 #define KII_TASK_NAME_PING_REQ "ping_req_task"
46 typedef void (*KII_PUSH_RECEIVED_CB)(
49 size_t message_length);
66 KII_SOCKET_CONNECT_CB mqtt_socket_connect_cb;
67 KII_SOCKET_SEND_CB mqtt_socket_send_cb;
68 KII_SOCKET_RECV_CB mqtt_socket_recv_cb;
69 KII_SOCKET_CLOSE_CB mqtt_socket_close_cb;
71 KII_TASK_CREATE task_create_cb;
73 KII_DELAY_MS delay_ms_cb;
75 KII_PUSH_RECEIVED_CB push_received_cb;
80 size_t mqtt_buffer_size;
126 const char* app_key);
138 const char* vendor_thing_id,
139 const char* password);
152 const char* vendor_thing_id,
153 const char* thing_type,
154 const char* password);
170 const char* thing_id,
171 const char* thing_state,
172 const size_t content_length,
173 const char* content_type,
174 const char* content_encoding,
175 const char* normalizer_host);
191 const char* thing_id,
192 const char* thing_state,
193 const size_t content_length,
194 const char* content_type,
195 const char* content_encoding,
196 const char* normalizer_host);
212 const kii_bucket_t* bucket,
213 const char* object_data,
214 const char* object_content_type,
215 char* out_object_id);
228 const kii_bucket_t* bucket,
229 const char* object_id,
230 const char* object_data,
231 const char* object_content_type);
246 const kii_bucket_t* bucket,
247 const char* object_id,
248 const char* patch_data,
249 const char* opt_etag);
265 const kii_bucket_t* bucket,
266 const char* object_id,
267 const char* replacement_data,
268 const char* opt_etag);
278 const kii_bucket_t* bucket,
279 const char* object_id);
290 const kii_bucket_t* bucket,
291 const char* object_id);
307 const kii_bucket_t* bucket,
308 const char* object_id,
309 const char* body_content_type,
324 const kii_bucket_t* bucket,
325 const char* object_id,
326 char* out_upload_id);
354 const kii_bucket_t* bucket,
355 const char* object_id,
356 const char* upload_id,
374 const kii_bucket_t* bucket,
375 const char* object_id,
376 const char* upload_id,
377 unsigned int commit);
391 const kii_bucket_t* bucket,
392 const char* object_id,
393 unsigned int* out_data_length);
414 const kii_bucket_t* bucket,
415 const char* object_id,
416 unsigned int position,
418 unsigned int* out_actual_length,
419 unsigned int* out_total_length);
430 const kii_bucket_t* bucket);
439 const kii_bucket_t* bucket);
450 const kii_topic_t* topic);
459 const kii_topic_t* topic);
468 const kii_topic_t* topic);
477 const kii_topic_t* topic);
488 KII_PUSH_RECEIVED_CB callback);
498 const char* endpoint_name,
519 const char* http_method,
520 const char* resource_path,
521 const char* content_type,
522 kii_bool_t set_authentication_header);
538 const void* body_data,
int kii_api_call_run(kii_t *kii)
Definition: kii_call.c:31
int kii_thing_authenticate(kii_t *kii, const char *vendor_thing_id, const char *password)
Definition: kii_thing.c:34
int kii_push_start_routine(kii_t *kii, KII_PUSH_RECEIVED_CB callback)
Definition: kii_push.c:541
int kii_object_replace(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, const char *replacement_data, const char *opt_etag)
Definition: kii_object.c:143
int kii_push_subscribe_bucket(kii_t *kii, const kii_bucket_t *bucket)
Definition: kii_push.c:167
int kii_thing_upload_state(kii_t *kii, const char *thing_id, const char *thing_state, const size_t content_length, const char *content_type, const char *content_encoding, const char *normalizer_host)
Definition: kii_thing.c:155
int kii_object_get(kii_t *kii, const kii_bucket_t *bucket, const char *object_id)
Definition: kii_object.c:212
size_t total_length
Definition: kii.h:337
kii_socket_context_t mqtt_socket_context
Definition: kii.h:65
size_t position
Definition: kii.h:333
int kii_api_call_append_body(kii_t *kii, const void *body_data, size_t body_size)
Definition: kii_call.c:16
int kii_object_upload_body(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, const char *upload_id, const kii_chunk_data_t *chunk)
Definition: kii_object.c:366
int kii_object_create_with_id(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, const char *object_data, const char *object_content_type)
Definition: kii_object.c:68
int kii_api_call_append_header(kii_t *kii, const char *key, const char *value)
Definition: kii_call.c:25
int kii_object_create(kii_t *kii, const kii_bucket_t *bucket, const char *object_data, const char *object_content_type, char *out_object_id)
Definition: kii_object.c:10
int kii_object_upload_body_at_once(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, const char *body_content_type, const void *data, size_t data_length)
Definition: kii_object.c:243
int kii_api_call_start(kii_t *kii, const char *http_method, const char *resource_path, const char *content_type, kii_bool_t set_authentication_header)
Definition: kii_call.c:5
struct kii_chunk_data_t kii_chunk_data_t
kii_json_resource_t kii_json_resource
Definition: kii.h:102
int kii_push_delete_topic(kii_t *kii, const kii_topic_t *topic)
Definition: kii_push.c:291
size_t length
Definition: kii.h:335
int kii_push_unsubscribe_bucket(kii_t *kii, const kii_bucket_t *bucket)
Definition: kii_push.c:192
int kii_object_delete(kii_t *kii, const kii_bucket_t *bucket, const char *object_id)
Definition: kii_object.c:180
int kii_push_unsubscribe_topic(kii_t *kii, const kii_topic_t *topic)
Definition: kii_push.c:242
int kii_push_create_topic(kii_t *kii, const kii_topic_t *topic)
Definition: kii_push.c:267
int kii_init(kii_t *kii, const char *site, const char *app_id, const char *app_key)
Definition: kii_thing.c:25
int kii_thing_register(kii_t *kii, const char *vendor_thing_id, const char *thing_type, const char *password)
Definition: kii_thing.c:94
int kii_object_download_body_at_once(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, unsigned int *out_data_length)
Definition: kii_object.c:492
int kii_object_patch(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, const char *patch_data, const char *opt_etag)
Definition: kii_object.c:106
void * chunk
Definition: kii.h:339
int kii_push_subscribe_topic(kii_t *kii, const kii_topic_t *topic)
Definition: kii_push.c:218
int kii_object_commit_upload(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, const char *upload_id, unsigned int commit)
Definition: kii_object.c:432
KII_JSON_RESOURCE_CB kii_json_resource_cb
Definition: kii.h:110
int kii_object_download_body(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, unsigned int position, unsigned int length, unsigned int *out_actual_length, unsigned int *out_total_length)
Definition: kii_object.c:545
int kii_thing_patch_state(kii_t *kii, const char *thing_id, const char *thing_state, const size_t content_length, const char *content_type, const char *content_encoding, const char *normalizer_host)
Definition: kii_thing.c:200
int kii_server_code_execute(kii_t *kii, const char *endpoint_name, const char *params)
Definition: kii_server_code.c:9
int kii_object_init_upload_body(kii_t *kii, const kii_bucket_t *bucket, const char *object_id, char *out_upload_id)
Definition: kii_object.c:294
char * body_content_type
Definition: kii.h:331