10 #ifndef _AIOT_STATE_API_H_ 11 #define _AIOT_STATE_API_H_ 13 #if defined(__cplusplus) 37 #define STATE_SUCCESS (0x0000) 43 #define STATE_USER_INPUT_BASE (-0x0100) 49 #define STATE_USER_INPUT_NULL_POINTER (-0x0101) 55 #define STATE_USER_INPUT_OUT_RANGE (-0x0102) 61 #define STATE_USER_INPUT_UNKNOWN_OPTION (-0x0103) 67 #define STATE_USER_INPUT_MISSING_PRODUCT_KEY (-0x0104) 73 #define STATE_USER_INPUT_MISSING_DEVICE_NAME (-0x0105) 79 #define STATE_USER_INPUT_MISSING_DEVICE_SECRET (-0x0106) 85 #define STATE_USER_INPUT_MISSING_PRODUCT_SECRET (-0x0107) 91 #define STATE_USER_INPUT_MISSING_HOST (-0x0108) 97 #define STATE_USER_INPUT_EXEC_DISABLED (-0x0109) 103 #define STATE_USER_INPUT_JSON_PARSE_FAILED (-0x010A) 109 #define STATE_SYS_DEPEND_BASE (-0x0200) 115 #define STATE_SYS_DEPEND_MALLOC_FAILED (-0x0201) 121 #define STATE_SYS_DEPEND_NWK_INVALID_OPTION (-0x0202) 127 #define STATE_SYS_DEPEND_NWK_EST_FAILED (-0x0203) 133 #define STATE_SYS_DEPEND_NWK_CLOSED (-0x0204) 139 #define STATE_SYS_DEPEND_NWK_READ_LESSDATA (-0x0205) 145 #define STATE_SYS_DEPEND_NWK_WRITE_LESSDATA (-0x0206) 151 #define STATE_SYS_DEPEND_NWK_READ_OVERTIME (-0x0207) 157 #define STATE_SYS_DEPEND_NWK_INVALID_CRED (-0x0208) 163 #define STATE_SYS_DEPEND_NWK_SEND_ERR (-0x0209) 169 #define STATE_SYS_DEPEND_NWK_RECV_ERR (-0x020A) 175 #define STATE_MQTT_BASE (-0x0300) 181 #define STATE_MQTT_CONNACK_FMT_ERROR (-0x0301) 187 #define STATE_MQTT_CONNACK_RCODE_UNACCEPTABLE_PROTOCOL_VERSION (-0x0302) 193 #define STATE_MQTT_CONNACK_RCODE_SERVER_UNAVAILABLE (-0x0303) 199 #define STATE_MQTT_CONNACK_RCODE_BAD_USERNAME_PASSWORD (-0x0304) 205 #define STATE_MQTT_CONNACK_RCODE_NOT_AUTHORIZED (-0x0305) 211 #define STATE_MQTT_CONNACK_RCODE_UNKNOWN (-0x0306) 217 #define STATE_MQTT_PUBLIST_PACKET_ID_ROLL (-0x0307) 223 #define STATE_MQTT_TOPIC_INVALID (-0x0308) 229 #define STATE_MQTT_LOG_TOPIC (-0x0309) 235 #define STATE_MQTT_LOG_HEXDUMP (-0x030A) 241 #define STATE_MQTT_CONNECT_SUCCESS (-0x030B) 247 #define STATE_MQTT_MALFORMED_REMAINING_LEN (-0x030C) 253 #define STATE_MQTT_MALFORMED_REMAINING_BYTES (-0x030D) 259 #define STATE_MQTT_PACKET_TYPE_UNKNOWN (-0x030E) 265 #define STATE_MQTT_SUBACK_RCODE_FAILURE (-0x030F) 271 #define STATE_MQTT_SUBACK_RCODE_UNKNOWN (-0x0310) 277 #define STATE_MQTT_TOPIC_COMPARE_FAILED (-0x0311) 283 #define STATE_MQTT_DEINIT_TIMEOUT (-0x0312) 289 #define STATE_MQTT_LOG_CONNECT (-0x0313) 295 #define STATE_MQTT_LOG_RECONNECTING (-0x0314) 301 #define STATE_MQTT_LOG_CONNECT_TIMEOUT (-0x0315) 307 #define STATE_MQTT_LOG_DISCONNECT (-0x0316) 313 #define STATE_MQTT_LOG_USERNAME (-0x0317) 319 #define STATE_MQTT_LOG_PASSWORD (-0x0318) 325 #define STATE_MQTT_LOG_CLIENTID (-0x0319) 331 #define STATE_MQTT_LOG_TLS_PSK (-0x031A) 337 #define STATE_MQTT_TOPIC_TOO_LONG (-0x031B) 343 #define STATE_MQTT_PUB_PAYLOAD_TOO_LONG (-0x031C) 349 #define STATE_MQTT_LOG_BACKUP_IP (-0x031D) 355 #define STATE_MQTT_RECV_INVALID_PINRESP_PACKET (-0x031E) 361 #define STATE_MQTT_RECV_INVALID_PUBLISH_PACKET (-0x031F) 367 #define STATE_MQTT_RECV_INVALID_PUBACK_PACKET (-0x0320) 373 #define STATE_MQTT_UNKNOWN_PROPERTY_OPTION (-0x0321) 379 #define STATE_MQTT_INVALID_PROTOCOL_VERSION (-0x0322) 385 #define STATE_MQTT_RECV_INVALID_SERVER_DISCONNECT_PACKET (-0x0323) 391 #define STATE_MQTT_INVALID_USER_PERPERTY_DATA (-0x0324) 397 #define STATE_MQTT_INVALID_USER_PERPERTY_LEN (-0x0325) 403 #define STATE_MQTT_INVALID_TX_PACK_SIZE (-0x0326) 409 #define STATE_MQTT_RECEIVE_MAX_EXCEEDED (-0x0327) 415 #define STATE_MQTT_INVALID_SUBSCRIPTION_IDENTIFIER (-0x0328) 421 #define STATE_MQTT_INVALID_PROPERTY_LEN (-0x0329) 427 #define STATE_MQTT_LOG_HOST (-0x032A) 433 #define STATE_HTTP_BASE (-0x0400) 439 #define STATE_HTTP_STATUS_LINE_INVALID (-0x0401) 445 #define STATE_HTTP_READ_BODY_FINISHED (-0x0402) 451 #define STATE_HTTP_DEINIT_TIMEOUT (-0x0403) 457 #define STATE_HTTP_AUTH_CODE_FAILED (-0x0404) 463 #define STATE_HTTP_AUTH_NOT_FINISHED (-0x0405) 469 #define STATE_HTTP_AUTH_TOKEN_FAILED (-0x0406) 475 #define STATE_HTTP_NEED_AUTH (-0x0407) 481 #define STATE_HTTP_RECV_NOT_FINISHED (-0x0408) 487 #define STATE_HTTP_HEADER_BUFFER_TOO_SHORT (-0x0409) 493 #define STATE_HTTP_HEADER_INVALID (-0x040A) 499 #define STATE_HTTP_LOG_SEND_HEADER (-0x040B) 505 #define STATE_HTTP_LOG_SEND_CONTENT (-0x040C) 511 #define STATE_HTTP_LOG_RECV_HEADER (-0x040D) 517 #define STATE_HTTP_LOG_RECV_CONTENT (-0x040E) 523 #define STATE_HTTP_LOG_DISCONNECT (-0x040F) 529 #define STATE_HTTP_LOG_AUTH (-0x0410) 535 #define STATE_HTTP_AUTH_NOT_EXPECTED (-0x0411) 541 #define STATE_HTTP_READ_BODY_EMPTY (-0x0412) 547 #define STATE_PORT_BASE (-0x0F00) 553 #define STATE_PORT_INPUT_NULL_POINTER (-0x0F01) 559 #define STATE_PORT_INPUT_OUT_RANGE (-0x0F02) 565 #define STATE_PORT_MALLOC_FAILED (-0x0F03) 571 #define STATE_PORT_MISSING_HOST (-0x0F04) 577 #define STATE_PORT_TCP_CLIENT_NOT_IMPLEMENT (-0x0F05) 583 #define STATE_PORT_TCP_SERVER_NOT_IMPLEMENT (-0x0F06) 589 #define STATE_PORT_UDP_CLIENT_NOT_IMPLEMENT (-0x0F07) 595 #define STATE_PORT_UDP_SERVER_NOT_IMPLEMENT (-0x0F08) 601 #define STATE_PORT_NETWORK_UNKNOWN_OPTION (-0x0F09) 607 #define STATE_PORT_NETWORK_UNKNOWN_SOCKET_TYPE (-0x0F0A) 613 #define STATE_PORT_NETWORK_DNS_FAILED (-0x0F0B) 619 #define STATE_PORT_NETWORK_SOCKET_CREATE_FAILED (-0x0F0C) 625 #define STATE_PORT_NETWORK_SOCKET_CONFIG_FAILED (-0x0F0D) 631 #define STATE_PORT_NETWORK_SOCKET_BIND_FAILED (-0x0F0E) 637 #define STATE_PORT_NETWORK_CONNECT_TIMEOUT (-0x0F0F) 643 #define STATE_PORT_NETWORK_CONNECT_FAILED (-0x0F10) 649 #define STATE_PORT_NETWORK_SELECT_FAILED (-0x0F11) 655 #define STATE_PORT_NETWORK_SEND_FAILED (-0x0F12) 661 #define STATE_PORT_NETWORK_RECV_FAILED (-0x0F13) 667 #define STATE_PORT_NETWORK_SEND_CONNECTION_CLOSED (-0x0F14) 673 #define STATE_PORT_NETWORK_RECV_CONNECTION_CLOSED (-0x0F15) 679 #define STATE_PORT_TLS_INVALID_CRED_OPTION (-0x0F16) 685 #define STATE_PORT_TLS_INVALID_MAX_FRAGMENT (-0x0F17) 691 #define STATE_PORT_TLS_INVALID_SERVER_CERT (-0x0F18) 697 #define STATE_PORT_TLS_INVALID_CLIENT_CERT (-0x0F19) 703 #define STATE_PORT_TLS_INVALID_CLIENT_KEY (-0x0F1A) 709 #define STATE_PORT_TLS_SOCKET_CREATE_FAILED (-0x0F1B) 715 #define STATE_PORT_TLS_SOCKET_CONNECT_FAILED (-0x0F1C) 721 #define STATE_PORT_TLS_INVALID_RECORD (-0x0F1D) 727 #define STATE_PORT_TLS_RECV_FAILED (-0x0F1E) 733 #define STATE_PORT_TLS_SEND_FAILED (-0x0F1F) 739 #define STATE_PORT_TLS_RECV_CONNECTION_CLOSED (-0x0F20) 745 #define STATE_PORT_TLS_SEND_CONNECTION_CLOSED (-0x0F21) 751 #define STATE_PORT_TLS_CONFIG_PSK_FAILED (-0x0F22) 757 #define STATE_PORT_TLS_INVALID_HANDSHAKE (-0x0F23) 763 #define STATE_PORT_DTLS_CONFIG_PSK_FAILED (-0x0F24) 769 #define STATE_PORT_DTLS_HANDSHAKE_FAILED (-0x0F25) 775 #define STATE_PORT_NETWORK_DTLS_CONNECT_FAILED (-0x0F26) 781 #define STATE_PORT_DTLS_HANDSHAKE_IN_PROGRESS (-0x0F27) 787 #define STATE_ADAPTER_COMMON (-0x1000) 789 #if defined(__cplusplus) 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