Link Kit C-SDK  4.0.0
aiot_state_api.h
浏览该文件的文档.
1 
10 #ifndef _AIOT_STATE_API_H_
11 #define _AIOT_STATE_API_H_
12 
13 #if defined(__cplusplus)
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 
22 typedef int32_t (* aiot_state_logcb_t)(int32_t code, char *message);
23 
32 
37 #define STATE_SUCCESS (0x0000)
38 
43 #define STATE_USER_INPUT_BASE (-0x0100)
44 
49 #define STATE_USER_INPUT_NULL_POINTER (-0x0101)
50 
55 #define STATE_USER_INPUT_OUT_RANGE (-0x0102)
56 
61 #define STATE_USER_INPUT_UNKNOWN_OPTION (-0x0103)
62 
67 #define STATE_USER_INPUT_MISSING_PRODUCT_KEY (-0x0104)
68 
73 #define STATE_USER_INPUT_MISSING_DEVICE_NAME (-0x0105)
74 
79 #define STATE_USER_INPUT_MISSING_DEVICE_SECRET (-0x0106)
80 
85 #define STATE_USER_INPUT_MISSING_PRODUCT_SECRET (-0x0107)
86 
91 #define STATE_USER_INPUT_MISSING_HOST (-0x0108)
92 
97 #define STATE_USER_INPUT_EXEC_DISABLED (-0x0109)
98 
103 #define STATE_USER_INPUT_JSON_PARSE_FAILED (-0x010A)
104 
109 #define STATE_SYS_DEPEND_BASE (-0x0200)
110 
115 #define STATE_SYS_DEPEND_MALLOC_FAILED (-0x0201)
116 
121 #define STATE_SYS_DEPEND_NWK_INVALID_OPTION (-0x0202)
122 
127 #define STATE_SYS_DEPEND_NWK_EST_FAILED (-0x0203)
128 
133 #define STATE_SYS_DEPEND_NWK_CLOSED (-0x0204)
134 
139 #define STATE_SYS_DEPEND_NWK_READ_LESSDATA (-0x0205)
140 
145 #define STATE_SYS_DEPEND_NWK_WRITE_LESSDATA (-0x0206)
146 
151 #define STATE_SYS_DEPEND_NWK_READ_OVERTIME (-0x0207)
152 
157 #define STATE_SYS_DEPEND_NWK_INVALID_CRED (-0x0208)
158 
163 #define STATE_SYS_DEPEND_NWK_SEND_ERR (-0x0209)
164 
169 #define STATE_SYS_DEPEND_NWK_RECV_ERR (-0x020A)
170 
175 #define STATE_MQTT_BASE (-0x0300)
176 
181 #define STATE_MQTT_CONNACK_FMT_ERROR (-0x0301)
182 
187 #define STATE_MQTT_CONNACK_RCODE_UNACCEPTABLE_PROTOCOL_VERSION (-0x0302)
188 
193 #define STATE_MQTT_CONNACK_RCODE_SERVER_UNAVAILABLE (-0x0303)
194 
199 #define STATE_MQTT_CONNACK_RCODE_BAD_USERNAME_PASSWORD (-0x0304)
200 
205 #define STATE_MQTT_CONNACK_RCODE_NOT_AUTHORIZED (-0x0305)
206 
211 #define STATE_MQTT_CONNACK_RCODE_UNKNOWN (-0x0306)
212 
217 #define STATE_MQTT_PUBLIST_PACKET_ID_ROLL (-0x0307)
218 
223 #define STATE_MQTT_TOPIC_INVALID (-0x0308)
224 
229 #define STATE_MQTT_LOG_TOPIC (-0x0309)
230 
235 #define STATE_MQTT_LOG_HEXDUMP (-0x030A)
236 
241 #define STATE_MQTT_CONNECT_SUCCESS (-0x030B)
242 
247 #define STATE_MQTT_MALFORMED_REMAINING_LEN (-0x030C)
248 
253 #define STATE_MQTT_MALFORMED_REMAINING_BYTES (-0x030D)
254 
259 #define STATE_MQTT_PACKET_TYPE_UNKNOWN (-0x030E)
260 
265 #define STATE_MQTT_SUBACK_RCODE_FAILURE (-0x030F)
266 
271 #define STATE_MQTT_SUBACK_RCODE_UNKNOWN (-0x0310)
272 
277 #define STATE_MQTT_TOPIC_COMPARE_FAILED (-0x0311)
278 
283 #define STATE_MQTT_DEINIT_TIMEOUT (-0x0312)
284 
289 #define STATE_MQTT_LOG_CONNECT (-0x0313)
290 
295 #define STATE_MQTT_LOG_RECONNECTING (-0x0314)
296 
301 #define STATE_MQTT_LOG_CONNECT_TIMEOUT (-0x0315)
302 
307 #define STATE_MQTT_LOG_DISCONNECT (-0x0316)
308 
313 #define STATE_MQTT_LOG_USERNAME (-0x0317)
314 
319 #define STATE_MQTT_LOG_PASSWORD (-0x0318)
320 
325 #define STATE_MQTT_LOG_CLIENTID (-0x0319)
326 
331 #define STATE_MQTT_LOG_TLS_PSK (-0x031A)
332 
337 #define STATE_MQTT_TOPIC_TOO_LONG (-0x031B)
338 
343 #define STATE_MQTT_PUB_PAYLOAD_TOO_LONG (-0x031C)
344 
349 #define STATE_MQTT_LOG_BACKUP_IP (-0x031D)
350 
355 #define STATE_MQTT_RECV_INVALID_PINRESP_PACKET (-0x031E)
356 
361 #define STATE_MQTT_RECV_INVALID_PUBLISH_PACKET (-0x031F)
362 
367 #define STATE_MQTT_RECV_INVALID_PUBACK_PACKET (-0x0320)
368 
373 #define STATE_MQTT_UNKNOWN_PROPERTY_OPTION (-0x0321)
374 
379 #define STATE_MQTT_INVALID_PROTOCOL_VERSION (-0x0322)
380 
385 #define STATE_MQTT_RECV_INVALID_SERVER_DISCONNECT_PACKET (-0x0323)
386 
391 #define STATE_MQTT_INVALID_USER_PERPERTY_DATA (-0x0324)
392 
397 #define STATE_MQTT_INVALID_USER_PERPERTY_LEN (-0x0325)
398 
403 #define STATE_MQTT_INVALID_TX_PACK_SIZE (-0x0326)
404 
409 #define STATE_MQTT_RECEIVE_MAX_EXCEEDED (-0x0327)
410 
415 #define STATE_MQTT_INVALID_SUBSCRIPTION_IDENTIFIER (-0x0328)
416 
421 #define STATE_MQTT_INVALID_PROPERTY_LEN (-0x0329)
422 
427 #define STATE_MQTT_LOG_HOST (-0x032A)
428 
433 #define STATE_HTTP_BASE (-0x0400)
434 
439 #define STATE_HTTP_STATUS_LINE_INVALID (-0x0401)
440 
445 #define STATE_HTTP_READ_BODY_FINISHED (-0x0402)
446 
451 #define STATE_HTTP_DEINIT_TIMEOUT (-0x0403)
452 
457 #define STATE_HTTP_AUTH_CODE_FAILED (-0x0404)
458 
463 #define STATE_HTTP_AUTH_NOT_FINISHED (-0x0405)
464 
469 #define STATE_HTTP_AUTH_TOKEN_FAILED (-0x0406)
470 
475 #define STATE_HTTP_NEED_AUTH (-0x0407)
476 
481 #define STATE_HTTP_RECV_NOT_FINISHED (-0x0408)
482 
487 #define STATE_HTTP_HEADER_BUFFER_TOO_SHORT (-0x0409)
488 
493 #define STATE_HTTP_HEADER_INVALID (-0x040A)
494 
499 #define STATE_HTTP_LOG_SEND_HEADER (-0x040B)
500 
505 #define STATE_HTTP_LOG_SEND_CONTENT (-0x040C)
506 
511 #define STATE_HTTP_LOG_RECV_HEADER (-0x040D)
512 
517 #define STATE_HTTP_LOG_RECV_CONTENT (-0x040E)
518 
523 #define STATE_HTTP_LOG_DISCONNECT (-0x040F)
524 
529 #define STATE_HTTP_LOG_AUTH (-0x0410)
530 
535 #define STATE_HTTP_AUTH_NOT_EXPECTED (-0x0411)
536 
541 #define STATE_HTTP_READ_BODY_EMPTY (-0x0412)
542 
547 #define STATE_PORT_BASE (-0x0F00)
548 
553 #define STATE_PORT_INPUT_NULL_POINTER (-0x0F01)
554 
559 #define STATE_PORT_INPUT_OUT_RANGE (-0x0F02)
560 
565 #define STATE_PORT_MALLOC_FAILED (-0x0F03)
566 
571 #define STATE_PORT_MISSING_HOST (-0x0F04)
572 
577 #define STATE_PORT_TCP_CLIENT_NOT_IMPLEMENT (-0x0F05)
578 
583 #define STATE_PORT_TCP_SERVER_NOT_IMPLEMENT (-0x0F06)
584 
589 #define STATE_PORT_UDP_CLIENT_NOT_IMPLEMENT (-0x0F07)
590 
595 #define STATE_PORT_UDP_SERVER_NOT_IMPLEMENT (-0x0F08)
596 
601 #define STATE_PORT_NETWORK_UNKNOWN_OPTION (-0x0F09)
602 
607 #define STATE_PORT_NETWORK_UNKNOWN_SOCKET_TYPE (-0x0F0A)
608 
613 #define STATE_PORT_NETWORK_DNS_FAILED (-0x0F0B)
614 
619 #define STATE_PORT_NETWORK_SOCKET_CREATE_FAILED (-0x0F0C)
620 
625 #define STATE_PORT_NETWORK_SOCKET_CONFIG_FAILED (-0x0F0D)
626 
631 #define STATE_PORT_NETWORK_SOCKET_BIND_FAILED (-0x0F0E)
632 
637 #define STATE_PORT_NETWORK_CONNECT_TIMEOUT (-0x0F0F)
638 
643 #define STATE_PORT_NETWORK_CONNECT_FAILED (-0x0F10)
644 
649 #define STATE_PORT_NETWORK_SELECT_FAILED (-0x0F11)
650 
655 #define STATE_PORT_NETWORK_SEND_FAILED (-0x0F12)
656 
661 #define STATE_PORT_NETWORK_RECV_FAILED (-0x0F13)
662 
667 #define STATE_PORT_NETWORK_SEND_CONNECTION_CLOSED (-0x0F14)
668 
673 #define STATE_PORT_NETWORK_RECV_CONNECTION_CLOSED (-0x0F15)
674 
679 #define STATE_PORT_TLS_INVALID_CRED_OPTION (-0x0F16)
680 
685 #define STATE_PORT_TLS_INVALID_MAX_FRAGMENT (-0x0F17)
686 
691 #define STATE_PORT_TLS_INVALID_SERVER_CERT (-0x0F18)
692 
697 #define STATE_PORT_TLS_INVALID_CLIENT_CERT (-0x0F19)
698 
703 #define STATE_PORT_TLS_INVALID_CLIENT_KEY (-0x0F1A)
704 
709 #define STATE_PORT_TLS_SOCKET_CREATE_FAILED (-0x0F1B)
710 
715 #define STATE_PORT_TLS_SOCKET_CONNECT_FAILED (-0x0F1C)
716 
721 #define STATE_PORT_TLS_INVALID_RECORD (-0x0F1D)
722 
727 #define STATE_PORT_TLS_RECV_FAILED (-0x0F1E)
728 
733 #define STATE_PORT_TLS_SEND_FAILED (-0x0F1F)
734 
739 #define STATE_PORT_TLS_RECV_CONNECTION_CLOSED (-0x0F20)
740 
745 #define STATE_PORT_TLS_SEND_CONNECTION_CLOSED (-0x0F21)
746 
751 #define STATE_PORT_TLS_CONFIG_PSK_FAILED (-0x0F22)
752 
757 #define STATE_PORT_TLS_INVALID_HANDSHAKE (-0x0F23)
758 
763 #define STATE_PORT_DTLS_CONFIG_PSK_FAILED (-0x0F24)
764 
769 #define STATE_PORT_DTLS_HANDSHAKE_FAILED (-0x0F25)
770 
775 #define STATE_PORT_NETWORK_DTLS_CONNECT_FAILED (-0x0F26)
776 
781 #define STATE_PORT_DTLS_HANDSHAKE_IN_PROGRESS (-0x0F27)
782 
787 #define STATE_ADAPTER_COMMON (-0x1000)
788 
789 #if defined(__cplusplus)
790 }
791 #endif
792 
793 #endif /* #ifndef _AIOT_STATE_API_H_ */
794 
int32_t aiot_state_set_logcb(aiot_state_logcb_t handler)
设置SDK的日志信息输出使用的回调函数
Definition: aiot_state_api.c:15
int32_t(* aiot_state_logcb_t)(int32_t code, char *message)
SDK的日志信息输出回调函数原型
Definition: aiot_state_api.h:22