10 #ifndef _AIOT_STATE_API_H_ 11 #define _AIOT_STATE_API_H_ 13 #if defined(__cplusplus) 53 #define STATE_SUCCESS (0x0000) 59 #define STATE_USER_INPUT_BASE (-0x0100) 65 #define STATE_USER_INPUT_NULL_POINTER (-0x0101) 71 #define STATE_USER_INPUT_OUT_RANGE (-0x0102) 77 #define STATE_USER_INPUT_UNKNOWN_OPTION (-0x0103) 83 #define STATE_USER_INPUT_MISSING_PRODUCT_KEY (-0x0104) 89 #define STATE_USER_INPUT_MISSING_DEVICE_NAME (-0x0105) 95 #define STATE_USER_INPUT_MISSING_DEVICE_SECRET (-0x0106) 101 #define STATE_USER_INPUT_MISSING_PRODUCT_SECRET (-0x0107) 107 #define STATE_USER_INPUT_MISSING_HOST (-0x0108) 113 #define STATE_USER_INPUT_EXEC_DISABLED (-0x0109) 119 #define STATE_USER_INPUT_JSON_PARSE_FAILED (-0x010A) 125 #define STATE_SYS_DEPEND_BASE (-0x0200) 131 #define STATE_SYS_DEPEND_MALLOC_FAILED (-0x0201) 137 #define STATE_SYS_DEPEND_NWK_INVALID_OPTION (-0x0202) 143 #define STATE_SYS_DEPEND_NWK_EST_FAILED (-0x0203) 149 #define STATE_SYS_DEPEND_NWK_CLOSED (-0x0204) 155 #define STATE_SYS_DEPEND_NWK_READ_LESSDATA (-0x0205) 161 #define STATE_SYS_DEPEND_NWK_WRITE_LESSDATA (-0x0206) 167 #define STATE_SYS_DEPEND_NWK_READ_OVERTIME (-0x0207) 173 #define STATE_SYS_DEPEND_NWK_INVALID_CRED (-0x0208) 179 #define STATE_SYS_DEPEND_NWK_SEND_ERR (-0x0209) 185 #define STATE_SYS_DEPEND_NWK_RECV_ERR (-0x020A) 191 #define STATE_MQTT_BASE (-0x0300) 197 #define STATE_MQTT_CONNACK_FMT_ERROR (-0x0301) 203 #define STATE_MQTT_CONNACK_RCODE_UNACCEPTABLE_PROTOCOL_VERSION (-0x0302) 209 #define STATE_MQTT_CONNACK_RCODE_SERVER_UNAVAILABLE (-0x0303) 215 #define STATE_MQTT_CONNACK_RCODE_BAD_USERNAME_PASSWORD (-0x0304) 221 #define STATE_MQTT_CONNACK_RCODE_NOT_AUTHORIZED (-0x0305) 227 #define STATE_MQTT_CONNACK_RCODE_UNKNOWN (-0x0306) 233 #define STATE_MQTT_PUBLIST_PACKET_ID_ROLL (-0x0307) 239 #define STATE_MQTT_TOPIC_INVALID (-0x0308) 245 #define STATE_MQTT_LOG_TOPIC (-0x0309) 251 #define STATE_MQTT_LOG_HEXDUMP (-0x030A) 257 #define STATE_MQTT_CONNECT_SUCCESS (-0x030B) 263 #define STATE_MQTT_MALFORMED_REMAINING_LEN (-0x030C) 269 #define STATE_MQTT_MALFORMED_REMAINING_BYTES (-0x030D) 275 #define STATE_MQTT_PACKET_TYPE_UNKNOWN (-0x030E) 281 #define STATE_MQTT_SUBACK_RCODE_FAILURE (-0x030F) 287 #define STATE_MQTT_SUBACK_RCODE_UNKNOWN (-0x0310) 293 #define STATE_MQTT_TOPIC_COMPARE_FAILED (-0x0311) 299 #define STATE_MQTT_DEINIT_TIMEOUT (-0x0312) 305 #define STATE_MQTT_LOG_CONNECT (-0x0313) 311 #define STATE_MQTT_LOG_RECONNECTING (-0x0314) 317 #define STATE_MQTT_LOG_CONNECT_TIMEOUT (-0x0315) 323 #define STATE_MQTT_LOG_DISCONNECT (-0x0316) 329 #define STATE_MQTT_LOG_USERNAME (-0x0317) 335 #define STATE_MQTT_LOG_PASSWORD (-0x0318) 341 #define STATE_MQTT_LOG_CLIENTID (-0x0319) 347 #define STATE_MQTT_LOG_TLS_PSK (-0x031A) 353 #define STATE_MQTT_TOPIC_TOO_LONG (-0x031B) 359 #define STATE_MQTT_PUB_PAYLOAD_TOO_LONG (-0x031C) 365 #define STATE_MQTT_LOG_BACKUP_IP (-0x031D) 371 #define STATE_MQTT_RECV_INVALID_PINRESP_PACKET (-0x031E) 377 #define STATE_MQTT_RECV_INVALID_PUBLISH_PACKET (-0x031F) 383 #define STATE_MQTT_RECV_INVALID_PUBACK_PACKET (-0x0320) 389 #define STATE_MQTT_UNKNOWN_PROPERTY_OPTION (-0x0321) 395 #define STATE_MQTT_INVALID_PROTOCOL_VERSION (-0x0322) 401 #define STATE_MQTT_RECV_INVALID_SERVER_DISCONNECT_PACKET (-0x0323) 407 #define STATE_MQTT_INVALID_USER_PERPERTY_DATA (-0x0324) 413 #define STATE_MQTT_INVALID_USER_PERPERTY_LEN (-0x0325) 419 #define STATE_MQTT_INVALID_TX_PACK_SIZE (-0x0326) 425 #define STATE_MQTT_RECEIVE_MAX_EXCEEDED (-0x0327) 431 #define STATE_MQTT_INVALID_SUBSCRIPTION_IDENTIFIER (-0x0328) 437 #define STATE_MQTT_INVALID_PROPERTY_LEN (-0x0329) 443 #define STATE_MQTT_LOG_HOST (-0x032A) 449 #define STATE_HTTP_BASE (-0x0400) 455 #define STATE_HTTP_STATUS_LINE_INVALID (-0x0401) 461 #define STATE_HTTP_READ_BODY_FINISHED (-0x0402) 467 #define STATE_HTTP_DEINIT_TIMEOUT (-0x0403) 473 #define STATE_HTTP_AUTH_CODE_FAILED (-0x0404) 479 #define STATE_HTTP_AUTH_NOT_FINISHED (-0x0405) 485 #define STATE_HTTP_AUTH_TOKEN_FAILED (-0x0406) 491 #define STATE_HTTP_NEED_AUTH (-0x0407) 497 #define STATE_HTTP_RECV_NOT_FINISHED (-0x0408) 503 #define STATE_HTTP_HEADER_BUFFER_TOO_SHORT (-0x0409) 509 #define STATE_HTTP_HEADER_INVALID (-0x040A) 515 #define STATE_HTTP_LOG_SEND_HEADER (-0x040B) 521 #define STATE_HTTP_LOG_SEND_CONTENT (-0x040C) 527 #define STATE_HTTP_LOG_RECV_HEADER (-0x040D) 533 #define STATE_HTTP_LOG_RECV_CONTENT (-0x040E) 539 #define STATE_HTTP_LOG_DISCONNECT (-0x040F) 545 #define STATE_HTTP_LOG_AUTH (-0x0410) 551 #define STATE_HTTP_AUTH_NOT_EXPECTED (-0x0411) 557 #define STATE_HTTP_READ_BODY_EMPTY (-0x0412) 563 #define STATE_PORT_BASE (-0x0F00) 569 #define STATE_PORT_INPUT_NULL_POINTER (-0x0F01) 575 #define STATE_PORT_INPUT_OUT_RANGE (-0x0F02) 581 #define STATE_PORT_MALLOC_FAILED (-0x0F03) 587 #define STATE_PORT_MISSING_HOST (-0x0F04) 593 #define STATE_PORT_TCP_CLIENT_NOT_IMPLEMENT (-0x0F05) 599 #define STATE_PORT_TCP_SERVER_NOT_IMPLEMENT (-0x0F06) 605 #define STATE_PORT_UDP_CLIENT_NOT_IMPLEMENT (-0x0F07) 611 #define STATE_PORT_UDP_SERVER_NOT_IMPLEMENT (-0x0F08) 617 #define STATE_PORT_NETWORK_UNKNOWN_OPTION (-0x0F09) 623 #define STATE_PORT_NETWORK_UNKNOWN_SOCKET_TYPE (-0x0F0A) 629 #define STATE_PORT_NETWORK_DNS_FAILED (-0x0F0B) 635 #define STATE_PORT_NETWORK_SOCKET_CREATE_FAILED (-0x0F0C) 641 #define STATE_PORT_NETWORK_SOCKET_CONFIG_FAILED (-0x0F0D) 647 #define STATE_PORT_NETWORK_SOCKET_BIND_FAILED (-0x0F0E) 653 #define STATE_PORT_NETWORK_CONNECT_TIMEOUT (-0x0F0F) 659 #define STATE_PORT_NETWORK_CONNECT_FAILED (-0x0F10) 665 #define STATE_PORT_NETWORK_SELECT_FAILED (-0x0F11) 671 #define STATE_PORT_NETWORK_SEND_FAILED (-0x0F12) 677 #define STATE_PORT_NETWORK_RECV_FAILED (-0x0F13) 683 #define STATE_PORT_NETWORK_SEND_CONNECTION_CLOSED (-0x0F14) 689 #define STATE_PORT_NETWORK_RECV_CONNECTION_CLOSED (-0x0F15) 695 #define STATE_PORT_TLS_INVALID_CRED_OPTION (-0x0F16) 701 #define STATE_PORT_TLS_INVALID_MAX_FRAGMENT (-0x0F17) 707 #define STATE_PORT_TLS_INVALID_SERVER_CERT (-0x0F18) 713 #define STATE_PORT_TLS_INVALID_CLIENT_CERT (-0x0F19) 719 #define STATE_PORT_TLS_INVALID_CLIENT_KEY (-0x0F1A) 725 #define STATE_PORT_TLS_SOCKET_CREATE_FAILED (-0x0F1B) 731 #define STATE_PORT_TLS_SOCKET_CONNECT_FAILED (-0x0F1C) 737 #define STATE_PORT_TLS_INVALID_RECORD (-0x0F1D) 743 #define STATE_PORT_TLS_RECV_FAILED (-0x0F1E) 749 #define STATE_PORT_TLS_SEND_FAILED (-0x0F1F) 755 #define STATE_PORT_TLS_RECV_CONNECTION_CLOSED (-0x0F20) 761 #define STATE_PORT_TLS_SEND_CONNECTION_CLOSED (-0x0F21) 767 #define STATE_PORT_TLS_CONFIG_PSK_FAILED (-0x0F22) 773 #define STATE_PORT_TLS_INVALID_HANDSHAKE (-0x0F23) 779 #define STATE_PORT_DTLS_CONFIG_PSK_FAILED (-0x0F24) 785 #define STATE_PORT_DTLS_HANDSHAKE_FAILED (-0x0F25) 791 #define STATE_PORT_NETWORK_DTLS_CONNECT_FAILED (-0x0F26) 797 #define STATE_PORT_DTLS_HANDSHAKE_IN_PROGRESS (-0x0F27) 803 #define STATE_PORT_PTHREAD_CREATE_FAILED (-0x0F28) 809 #define STATE_ADAPTER_ERROR (-0x1000) 815 #define STATE_NONSUPPORT (-0x1100) 821 #define STATE_DEVICE_REPEATED_CONNECT (-0x1101) 827 #define STATE_DEVICE_MISSING_CONNECT_ARGS (-0x1102) 833 #define STATE_DEVICE_OFFLINE (-0x1103) 839 #define STATE_DEVICE_REPEATED_DISCONNECT (-0x1104) 845 #define STATE_DEVICE_UNKOWN_ERROR (-0x1105) 851 #define STATE_DEVICE_DYNREG_TIMEOUT (-0x1106) 857 #define STATE_MESSAGE_CREATE_ERROR (-0x1201) 863 #define STATE_MESSAGE_PARSE_ERROR (-0x1202) 865 #if defined(__cplusplus) int32_t aiot_state_set_log_level(log_level_t level)
设置SDK的日志信息输出等级
int32_t aiot_state_set_logcb(aiot_state_logcb_t handler)
设置SDK的日志信息输出使用的回调函数
Definition: aiot_state_api.h:35
Definition: aiot_state_api.h:37
log_level_t
Definition: aiot_state_api.h:33
Definition: aiot_state_api.h:36
Definition: aiot_state_api.h:34
int32_t(* aiot_state_logcb_t)(int32_t code, char *message)
SDK的日志信息输出回调函数原型
Definition: aiot_state_api.h:22