RS9113 WiSeConnect 简易API指南说明书
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
RS9113 WiSeConnect TM S i m p l e A P I G u i d e
V e r s i o n1.4
May 2019
RS9113 WiSeConnectTM
Simple API Guide
Version 1.4
Table Of Contents
1Overview (14)
2Architecture (15)
3Common API (17)
3.1rsi_driver_init (17)
3.2rsi_device_init (18)
3.3rsi_bl_module_power_off (18)
3.4rsi_bl_module_power_on (19)
3.5rsi_bl_upgrade_firmware (19)
3.6rsi_wireless_init (20)
3.7rsi_wireless_deinit (21)
3.8rsi_wireless_driver_task (22)
3.9rsi_wireless_antenna (22)
3.10rsi_cmd_uart_flow_ctrl (23)
4WLAN API (25)
4.1WLAN Core API (25)
4.1.1rsi_wlan_scan (25)
4.1.2rsi_wlan_bgscan_profile (29)
4.1.3rsi_wlan_scan_async (31)
4.1.4rsi_wlan_connect (35)
4.1.5rsi_wlan_connect_async (38)
4.1.6rsi_wlan_execute_post_connect_cmds (42)
4.1.7rsi_wlan_disconnect (43)
4.1.8rsi_wlan_set_certificate (44)
4.1.9rsi_wlan_get_status (45)
4.1.10rsi_wlan_ap_start (45)
4.1.11rsi_wlan_wps_push_button_event (47)
4.1.12rsi_wlan_wps_generate_pin (48)
4.1.13rsi_wlan_disconnect_stations (48)
4.1.14rsi_wlan_wfd_start_discovery (49)
4.1.15rsi_wlan_ wfd_connect (51)
4.1.16rsi_wlan_get (52)
4.1.17rsi_wlan_set (57)
4.1.18rsi_wlan_ ping_async (58)
4.1.19rsi_wlan_ power_save_profile (60)
4.1.20rsi_wlan_receive_stats_start (62)
4.1.21rsi_wlan_receive_stats_stop (63)
4.1.22rsi_wlan_send_data (63)
4.1.23rsi_transmit_test_start (64)
4.1.24rsi_transmit_test_stop (68)
4.1.25rsi_fwup_app (69)
4.1.26rsi_fwup (69)
4.1.27rsi_fwup_start (70)
4.1.28rsi_fwup_load (71)
4.1.29rsi_wlan_register_callbacks (71)
4.1.30rsi_wlan_radio_init (73)
4.1.31rsi_bootloader_instructions (73)
4.1.32rsi_init_timer (74)
4.1.33rsi_setsockopt (74)
RS9113 WiSeConnectTM Simple API Guide
Version 1.4
4.2 BSD Socket API (75)
4.2.1 rsi_config_ipaddress (75)
4.2.2 rsi_socket (77)
4.2.3 rsi_bind (78)
4.2.4 rsi_connect (78)
4.2.5 rsi_listen (79)
4.2.6 rsi_accept (80)
4.2.7 rsi_recvfrom (81)
4.2.8 rsi_recv (82)
4.2.9 rsi_sendto (82)
4.2.10 rsi_send (83)
4.2.11 rsi_shutdown (84)
4.2.12 rsi_socket_async (85)
4.2.13 rsi_dns_req (86)
4.2.14 rsi_dns_update (87)
4.3 Network Application Protocol (88)
4.3.1 SMTP client API (89)
4.3.1.1 rsi_smtp_client_create (89)
4.3.1.2 rsi_smtp_client_mail_send_async (90)
4.3.1.3 rsi_smtp_client_delete_async (92)
4.3.2 SNTP Client API (93)
4.3.2.1 rsi_ sntp_client_create_async (93)
4.3.2.2 rsi_sntp_client_gettime (94)
4.3.2.3 rsi_sntp_ client_gettime_date (95)
4.3.2.4 rsi_ sntp_client_server_info (95)
4.3.2.5 rsi_ sntp_client_delete_async (96)
4.3.3 HTTP Client API (97)
4.3.3.1 rsi_http_client_get_async (97)
4.3.3.2 rsi_http_client_post_async (99)
4.3.3.3 rsi_http_client_post_data (101)
4.3.3.4 rsi_http_client_async (103)
4.3.3.5 rsi_http_client_put_create (105)
4.3.3.6 rsi_http_client_put_start (106)
4.3.3.7 rsi_http_client_put_pkt (108)
4.3.3.8 rsi_http_client_put_delete (109)
4.3.3.9 rsi_http_client_abort (109)
4.3.4 POP3 client API (110)
4.3.4.1 rsi_pop3_session_create_async (110)
4.3.4.2 rsi_pop3_get_mail_stats (112)
4.3.4.3 rsi_pop3_get_mail_list (112)
4.3.4.4 rsi_ pop3_retrive_mail (113)
4.3.4.5 rsi_pop3_mark_mail (113)
4.3.4.6 rsi_pop3_unmark_mail (114)
4.3.4.7 rsi_ pop3_get_server_status (114)
4.3.4.8 rsi_pop3_session_delete (115)
4.3.5 FTP Client API (115)
4.3.5.1 rsi_ftp_connect (115)
4.3.5.2 rsi_ftp_disconnect (116)
4.3.5.3 rsi_ftp_file_write (117)
4.3.5.4 rsi_ftp_file_write_content (118)
4.3.5.5 rsi_ftp_file_read_async (119)
4.3.5.6rsi_ftp_file_delete (120)
4.3.5.7rsi_ftp_file_rename (121)
4.3.5.8rsi_ftp_directory_create (122)
4.3.5.9rsi_ftp_directory_delete (122)
4.3.5.10rsi_ftp_directory_set (123)
4.3.5.11rsi_ftp_directory_list_async (124)
4.3.5.12rsi_ ftp_mode_set (125)
4.3.6MQTT Client API (126)
4.3.6.1rsi_mqtt_client_init (126)
4.3.6.2rsi_mqtt_connect (127)
4.3.6.3rsi_mqtt_disconnect (127)
4.3.6.4rsi_mqtt_publish (128)
4.3.6.5rsi_mqtt_subscribe (129)
4.3.6.6rsi_mqtt_unsubscribe (130)
4.3.6.7rsi_mqtt_recv (130)
4.3.7HTTP Server API (131)
4.3.7.1rsi_webpage_load (131)
4.3.7.2rsi_json_object_create (132)
4.3.7.3rsi_webpage_erase (132)
4.3.7.4rsi_json_object_delete (133)
4.3.8DHCP User class (Option-77) API (134)
4.3.8.1rsi_dhcp_user_class (134)
4.3.9Multicast API (135)
4.3.9.1rsi_multicast_join (135)
4.3.9.2rsi_multicast_leave (135)
4.3.10MDNSD API (136)
4.3.10.1rsi_mdnsd_init (136)
4.3.10.2rsi_mdnsd_register_service (137)
4.3.10.3rsi_mdnsd_deinit (138)
4.3.11Web socket API (139)
4.3.11.1rsi_web_socket_create (139)
4.3.11.2rsi_web_socket_send_async (140)
4.3.11.3rsi_web_socket_close (141)
4.3.12OTAF client API (142)
4.3.12.1rsi_ota_firmware_upgradation (142)
4.3.13PUF API (143)
4.3.13.1rsi_puf_enroll_req (143)
4.3.13.2rsi_puf_enroll_disable_req (144)
4.3.13.3rsi_puf_start_req (144)
4.3.13.4rsi_puf_set_key_req (145)
4.3.13.5rsi_puf_set_key_disable_req (146)
4.3.13.6rsi_puf_get_key_req (146)
4.3.13.7rsi_puf_get_key_disable_req (147)
4.3.13.8rsi_puf_load_key_req (148)
4.3.13.9rsi_puf_intr_key_req (148)
4.3.13.10rsi_puf_aes_encrypt_req (149)
4.3.13.11rsi_puf_aes_decrypt_req (151)
4.3.13.12rsi_puf_aes_mac_req (152)
4.4Configuration parameters (154)
4.4.1Configure opermode parameters (154)
4.4.2Configure WLAN parameters (157)
4.4.3Configure scan parameters (157)
4.4.4Configure AP Mode parameters (157)
4.4.5Configure Set Region parameters (158)
4.4.6Configure Set Region AP parameters (158)
4.4.7Configure Rejoin parameters (159)
4.4.8Configure BG scan parameters (159)
4.4.9Configure Roaming parameters (160)
4.4.10Configure HT capabilities (160)
4.4.11Configure Enterprise mode parameters (161)
4.4.12Configure Join parameters (161)
4.4.13Configure SSL parameters (163)
4.4.14Configure Power Save parameters (163)
4.4.15Configure Transmit test mode parameters (164)
4.4.16Configure debug prints parameters (165)
4.5WLAN API call sequence examples (165)
4.5.1Station mode (165)
4.5.2Access point mode (167)
5BT-Classic and BT-LE Common Features (169)
5.1Power Save (169)
5.1.1Description (169)
5.2Power Save Operations (169)
5.2.1.1Power Save Mode 0 (169)
5.2.1.2Power Save Mode 2 (169)
5.2.1.3Power Save mode 8 (171)
6BT API (172)
6.1GAP API (172)
6.1.1rsi_bt_get_local_name (172)
6.1.2rsi_bt_set_local_name (173)
6.1.3rsi_bt_set_local_class_of_device (173)
6.1.4rsi_bt_get_local_class_of_device (173)
6.1.5rsi_bt_start_discoverable (174)
6.1.6rsi_bt_start_limited_discoverable (174)
6.1.7rsi_bt_stop_discoverable (174)
6.1.8rsi_bt_get_discoverable_status (175)
6.1.9rsi_bt_set_connectable (175)
6.1.10rsi_bt_set_non_connectable (175)
6.1.11rsi_bt_get_connectable_status (175)
6.1.12rsi_bt_enable_authentication (176)
6.1.13rsi_bt_disable_authentication (176)
6.1.14rsi_bt_get_authentication (176)
6.1.15rsi_bt_remote_name_request_async (177)
6.1.16rsi_bt_remote_name_request_cancel (178)
6.1.17rsi_bt_inquiry (178)
6.1.18rsi_bt_cancel_inquiry (178)
6.1.19rsi_bt_set_eir_data (179)
6.1.20rsi_bt_connect (179)
6.1.21rsi_bt_cancel_connect (180)
6.1.22rsi_bt_disconnect (180)
6.1.23rsi_bt_set_ssp_mode (180)
6.1.24rsi_bt_accept_ssp_confirm (181)
6.1.25rsi_bt_reject_ssp_confirm (181)
6.1.26rsi_bt_passkey (182)
6.1.27rsi_bt_pincode_request_reply (182)
6.1.28rsi_bt_linkkey_request_reply (182)
6.1.29rsi_bt_get_local_device_role (183)
6.1.30rsi_bt_get_services_async (183)
6.1.31rsi_bt_search_service_async (184)
6.1.32rsi_bt_sniff_mode (184)
6.1.33rsi_bt_sniff_exit_mode (185)
6.1.34rsi_bt_sniff_subrating_mode (185)
6.1.35rsi_bt_get_rssi (186)
6.1.36rsi_bt_get_local_device_address (186)
6.1.37rsi_bt_spp_init (187)
6.1.38rsi_bt_spp_connect (187)
6.1.39rsi_bt_spp_disconnect (187)
6.1.40rsi_bt_spp_transfer (188)
6.1.41rsi_bt_init (188)
6.1.42rsi_bt_deinit (188)
6.1.43rsi_bt_set_antenna (189)
6.1.44rsi_bt_power_save_profile (189)
6.1.45rsi_bt_set_feature_bitmap (190)
6.1.46rsi_bt_set_antenna_tx_power_level (191)
6.2Callback functions (191)
6.2.1GAP event callbacks description (191)
6.2.1.1rsi_bt_on_role_change_t (191)
6.2.1.2rsi_bt_on_connect_t (192)
6.2.1.3rsi_bt_on_disconnect_t (192)
6.2.1.4rsi_bt_on_scan_resp_t (192)
6.2.1.5rsi_bt_on_remote_name_resp_t (193)
6.2.1.6rsi_bt_on_passkey_display_t (194)
6.2.1.7rsi_bt_on_remote_name_request_cancel_t (194)
6.2.1.8rsi_bt_on_confirm_request_t (195)
6.2.1.9rsi_bt_on_pincode_request_t (195)
6.2.1.10rsi_bt_on_passkey_request_t (196)
6.2.1.11rsi_bt_on_inquiry_complete_t (196)
6.2.1.12rsi_bt_on_auth_complete_t (196)
6.2.1.13rsi_bt_on_linkkey_request_t (197)
6.2.1.14rsi_bt_on_ssp_complete_t (197)
6.2.1.15rsi_bt_on_linkkey_save_t (198)
6.2.1.16rsi_bt_on_get_services_t (198)
6.2.1.17rsi_bt_on_search_service_t (199)
6.2.1.18rsi_bt_on_mode_change_t (199)
6.2.1.19rsi_bt_on_sniff_subrating_t (200)
6.2.2SPP profile event callback description (200)
6.2.2.1rsi_bt_on_spp_connect_t (200)
6.2.2.2rsi_bt_on_spp_disconnect_t (201)
6.2.2.3rsi_bt_on_spp_rx_data_t (201)
7BLE API (203)
7.1Basic Structure defines (203)
7.1.1uuid_t (203)
7.1.2inc_service_data_t (204)
7.1.3inc_service_t (204)
7.1.4char_serv_data_t (204)
7.1.5char_serv_t (205)
7.1.6att_desc_t (205)
7.1.7rsi_ble_resp_profiles_list_t (206)
7.1.8rsi_ble_resp_char_services_t (206)
7.1.9rsi_ble_resp_inc_services_t (207)
7.1.10rsi_ble_resp_att_value_t (207)
7.1.11rsi_ble_resp_att_descs_t (208)
7.1.12rsi_ble_req_add_att_t (208)
7.1.13rsi_ble_resp_local_att_value_t (209)
7.1.14rsi_ble_req_smp_pair_reject_tStructure (210)
7.2GAP API (210)
7.2.1rsi_ble_start_advertising (210)
7.2.2rsi_ble_stop_advertising (211)
7.2.3rsi_ble_start_scanning (211)
7.2.4rsi_ble_stop_scanning (211)
7.2.5rsi_ble_connect (212)
7.2.6rsi_ble_connect_cancel (212)
7.2.7rsi_ble_disconnect (213)
7.2.8rsi_ble_get_device_state (213)
7.2.9rsi_ble_set_advertise_data (214)
7.2.10rsi_ble_smp_pair_request (215)
7.2.11rsi_ble_smp_pair_response (216)
7.2.12rsi_ble_smp_passkey (216)
7.2.13rsi_ble_get_le_ping_timeout (217)
7.2.14rsi_ble_set_le_ping_timeout (217)
7.2.15rsi_ble_set_random_address (218)
7.2.16rsi_ble_encrypt (218)
7.2.17rsi_ble_ltk_req_reply (218)
7.2.18rsi_ble_req_smp_pair_request_reject (219)
7.3GATT API (220)
7.3.1GATT Client APIs (220)
7.3.1.1rsi_ble_get_profiles_async (220)
7.3.1.2rsi_ble_get_profile_async (221)
7.3.1.3rsi_ble_get_char_services_async (221)
7.3.1.4rsi_ble_get_inc_services_async (222)
7.3.1.5rsi_ble_get_char_value_by_uuid_async (223)
7.3.1.6rsi_ble_get_att_descriptors_async (223)
7.3.1.7rsi_ble_get_att_value_async (224)
7.3.1.8rsi_ble_get_multiple_att_values_async (225)
7.3.1.9rsi_ble_get_long_att_value_async (225)
7.3.1.10rsi_ble_set_att_value_async (226)
7.3.1.11rsi_ble_set_att_cmd (227)
7.3.1.12rsi_ble_set_long_att_value_async (227)
7.3.1.13rsi_ble_prepare_write_async (228)
7.3.1.14rsi_ble_execute_write_async (229)
7.3.2GATT Server APIs (229)
7.3.2.1rsi_ble_add_service (229)
7.3.2.2rsi_ble_add_attribute (230)
7.3.2.3rsi_ble_set_local_att_value (230)
7.3.2.4rsi_ble_get_local_att_value (231)
7.3.2.5rsi_ble_gatt_read_response (231)
7.4Callback functions (232)
7.4.1GAP register callbacks (232)
7.4.1.1rsi_ble_gap_register_callbacks (232)
7.4.2GAP event callback descriptions (233)
7.4.2.1rsi_ble_event_adv_report_t (233)
7.4.2.2rsi_ble_event_conn_status_t (234)
7.4.2.3rsi_ble_event_disconnect_t (234)
7.4.2.4rsi_ble_on_le_ping_payload_timeout_t (235)
7.4.2.5rsi_bt_event_le_ltk_request_t (235)
7.4.3GATT register callbacks (236)
7.4.3.1rsi_ble_gatt_register_callbacks (236)
7.4.4GATT Response callbacks description (237)
7.4.4.1rsi_ble_on_profiles_list_resp_t (237)
7.4.4.2rsi_ble_on_profile_resp_t (238)
7.4.4.3rsi_ble_on_char_services_resp_t (239)
7.4.4.4rsi_ble_on_inc_services_resp_t (239)
7.4.4.5rsi_ble_on_att_desc_resp_t (240)
7.4.4.6rsi_ble_on_read_resp_t (241)
7.4.4.7ble_on_write_resp (242)
7.4.5GATT Event callbacks (242)
7.4.5.1GATT Write event (242)
7.4.5.2GATT Prepare Write event (243)
7.4.5.3GATT Execute Write event (244)
7.4.5.4GATT Read request event (244)
7.4.5.5MTU event (245)
7.4.6SMP register callbacks (245)
7.4.6.1rsi_ble_smp_register_callbacks (245)
7.4.7SMP event Callbacks Declarations (246)
7.4.7.1rsi_ble_on_smp_request_t (246)
7.4.7.2rsi_ble_on_smp_response_t (246)
7.4.7.3rsi_ble_on_smp_passkey_t (247)
7.4.7.4rsi_ble_on_smp_failed_t (247)
7.4.7.5rsi_ble_on_encrypt_started_t (248)
7.5Configuration parameters (248)
7.5.1Configure advertise parameters (248)
7.5.2Configure scan parameters (249)
7.5.3Configure connection parameters (249)
7.6BLE API call sequence examples (250)
7.6.1BLE peripheral (250)
7.6.2BLE central (250)
7.6.3GATT client (252)
7.6.4GATT server (253)
8ZIGBEE APIS (254)
8.1Management Interface (254)
8.1.1.1rsi_zigb_init_stack (254)
8.1.1.2rsi_zigb_reset_stack (254)
8.1.1.3rsi_zigb_set_profile (255)
8.1.1.4rsi_zigb_update_sas (256)
8.1.1.5rsi_zigb_update_zdo_configuration (259)
8.1.1.6rsi_zigb_form_network (262)
8.1.1.7rsi_zigb_join_network (263)
8.1.1.8rsi_zigb_permit_join (264)
8.1.1.9rsi_zigb_leave_network (265)
8.1.1.10rsi_zigb_initiate_scan (265)
8.1.1.11rsi_zigb_stop_scan (266)
8.1.1.12rsi_zigb_network_state (267)
8.1.1.13rsi_zigb_stack_is_up (267)
8.1.1.14rsi_zigb_get_self_ieee_address (268)
8.1.1.15rsi_zigb_is_it_self_ieee_address (268)
8.1.1.16rsi_zigb_get_self_short_address (269)
8.1.1.17rsi_zigb_set_manufacturer_code_for_node_desc (270)
8.1.1.18rsi_zigb_set_power_descriptor (270)
8.1.1.19rsi_zigb_set_maxm_incoming_txfr_size (271)
8.1.1.20rsi_zigb_set_maxm_outgoing_txfr_size (272)
8.1.1.21rsi_zigb_set_operating_channel (273)
8.1.1.22rsi_zigb_get_device_type (273)
8.1.1.23rsi_zigb_get_operating_channel (274)
8.1.1.24rsi_zigb_get_short_panid (275)
8.1.1.25rsi_zigb_get_extended_panid (275)
8.1.1.26rsi_zigb_get_endpoint_id (276)
8.1.1.27rsi_zigb_get_simple_descriptor (276)
8.1.1.28rsi_zigb_set_simple_descriptor (278)
8.1.1.29rsi_zigb_get_endpoint_cluster (279)
8.1.1.30rsi_zigb_get_short_addr_for_specified_ieee_addr (279)
8.1.1.31rsi_zigb_get_ieee_addr_for_specified_short_addr (280)
8.1.1.32rsi_zigb_read_neighbor_table_entry (281)
8.1.1.33rsi_zigb_get_route_table_entry (282)
8.1.1.34rsi_zigb_get_neighbor_table_entry_count (284)
8.1.1.35rsi_zigb_get_child_short_address_for_the_index (284)
8.1.1.36rsi_zigb_get_child_index_for_specified_short_addr (285)
8.1.1.37rsi_zigb_get_child_details (286)
8.1.1.38rsi_zigb_end_device_poll_for_data (287)
8.1.1.39rsi_zigb_read_count_of_child_devices (287)
8.1.1.40rsi_zigb_read_count_of_router_child_devices (288)
8.1.1.41rsi_zigb_get_parent_short_address (288)
8.1.1.42rsi_zigb_get_parent_ieee_address (289)
8.1.1.43rsi_zigb_initiate_energy_scan_request (289)
8.1.1.44rsi_zigb_broadcast_nwk_manager_request (290)
8.1.1.45rsi_zigb_zdp_send_nwk_addr_request (291)
8.1.1.46rsi_zigb_zdp_send_ieee_addr_request (292)
8.1.1.47rsi_zigb_zdp_send_device_announcement (293)
8.1.1.48rsi_zigb_send_match_descriptors_request (293)
8.1.1.49rsi_zigb_active_endpoints_request (295)
8.1.1.50rsi_zigb_zdp_send_power_descriptor_request (295)
8.1.1.51rsi_zigb_zdp_send_node_descriptor_request (296)
8.1.1.52rsi_zigb_simple_descriptor_request (297)
8.1.1.53rsi_zigb_get_address_map_table_entry (297)
8.2Data Interface (298)
8.2.1.1rsi_zigb_send_unicast_data (298)
8.2.1.2rsi_zigb_send_group_data (301)
8.2.1.3rsi_zigb_send_broadcast_data (302)
8.2.1.4rsi_zigb_get_max_aps_payload_length (302)
8.3Security Interface (304)
8.3.1.1rsi_zigb_get_key (304)
8.3.1.2rsi_zigb_have_link_key (305)
8.3.1.3rsi_zigb_request_link_key (305)
8.3.1.4rsi_zigb_get_key_table_entry (306)
8.3.1.5rsi_zigb_set_key_table_entry (308)
8.3.1.6rsi_zigb_add_or_update_key_table_entry (309)
8.3.1.7rsi_zigb_find_key_table_entry (311)
8.3.1.8rsi_zigb_erase_key_table_entry (311)
8.4Binding Interface (312)
8.4.1.1rsi_zigb_set_binding_entry (312)
8.4.1.2rsi_zigb_get_binding_indices (313)
8.4.1.3rsi_zigb_delete_binding (314)
8.4.1.4rsi_zigb_is_binding_entry_active (315)
8.4.1.5rsi_zigb_clear_binding_table (315)
8.4.1.6rsi_zigb_bind_request (316)
8.4.1.7rsi_zigb_unbind_request (317)
8.5Callbacks (318)
8.5.1.1rsi_zigb_register_callbacks (318)
8.5.1.2rsi_zigb_app_scan_complete_Handler (320)
8.5.1.3rsi_zigb_app_energy_scan_result_handler (321)
8.5.1.4rsi_zigb_app_network_found_handler (321)
8.5.1.5rsi_zigb_app_stack_status_handler (322)
8.5.1.6rsi_zigb_app_child_join_handler (324)
8.5.1.7rsi_zigb_app_handle_data_confirmation (324)
8.5.1.8rsi_zigb_app_incoming_many_to_one_route_request_handler (326)
8.5.1.9rsi_zigb_app_handle_data_indication (327)
9APPENDIX (330)
9.1Example Applications (330)
9.1.1WLAN Example Applications (330)
9.1.2BLE Example Applications (333)
9.1.3ZigBee Example Applications (333)
9.1.4Coexistence Example Applications (334)
9.2WLAN Error codes (335)
9.3Bluetooth Generic Error Codes (341)
9.4BLE Mode Error Codes (344)
9.5Zigbee Pro Stack Error codes (346)
9.6PUF Error codes (347)
Table of Figures
Figure 1 : API Architecture Diagram (15)
Figure 2 : API flow to configure module in station mode (166)
Figure 3 : API flow to configure module in station mode (167)
Figure 4 : API flow to configure module in Access point mode (168)
Figure 5 : BLE peripheral application API flow (250)
Figure 6 : BLE central application API flow (251)
Figure 7 : BLE GATT client application API flow (252)
Figure 8 : BLE GATT Server application API flow (253)
Table of Tables
Table 1: Messages from module in Power Save mode 2 (170)
Table 2: Message from host in Power Save mode 2 (170)
Table 3: Messages from module in Power Save mode 8 (171)
Table 4: Message from host in Power Save mode 8 (171)
1Overview
RS9113-WiSeConnect module support Wi-Fi/BT/BLE/Zigbee only and Coexistence modes (Wi-Fi+BT / Wi-Fi+BLE / Wi-Fi+Zigbee) modes. This document contains description about
RS9113-WiSeConnect Plus WLAN and Networking stack (TCP/IP) API’s. The source code of API’s, driver framework and reference application are provided in the software package.
The developer can customize the application as per their application requirement. The API library is platform independent and thread safe. These APIs are written in C language.
2Architecture
RS9113-WiSeConnect API’s are designed in layers, where each Layer is independent and
uses the service of underlying layers.
Application Layer:
Application Layer contains application specific functionality. Application Layer need to call
WiSeConnect TM Driver API’s to configure and operate the RS9113-WiSeConnect module.
WLAN API:
This Layer contains set of API’s called from application to initialize and configure Wi-Fi
Module. User is recommended to use given API’s without any modification for transparent migration to API’s enhancement in next releases.
BSD Socket API:
This Layer contains BSD Socket API Compliancy Wrapper supports some of the basic BSD Socket API calls. This API’s can call from application to initialize and Configure embedded TCP/IP stack and perform data transfers.
WiSeConnect TM Driver:
WiSeConnect TM Driver software framework contains core functions to maintain state machines, command preparation, command response parsing.
Interface Specific API Layer:
RS9113-WiSeConnect Plus module support 4 different host interfaces (UART, SPI, USB and USB-CDC).These API’s are collection of functions specific to particular interface. Interface functions between Driver API Layer and Interface Specific API Layer are independent of Host interface used. So Application Layer can migrate to different interfaces without any change.
HAL API Layer:
Hardware Abstraction Layer API’s are platform specific API’s. User need to implement or modify these API’s to their platforms.
Reference Applications:
Packages contain reference applications to operate the module in different modes. User can use these applications as reference or customize these applications as per their requirement.
3 Common API
This section contains common API to initialize driver and handle common features independent of module configuration mode.
3.1
rsi_driver_init
Prototype
int32_t *rsi_driver_init(uint8_t *buffer,
uint32_t length);
Description
This API is used to initialize WiSeConnect TM
driver.
Parameters
Return Values
Actual buffer length required by the driver .
Success : If Actual buffer length is less than Provided Buffer length On Failure :
Returns a non-zero value if buffer provided by application is less than the driver requirement. Return value represents the buffer required by the driver
Returns -1 , if UART initialization fails in SPI /UART mode Returns -2 , if maximum sockets is greater than 10
3.2rsi_device_init
Prototype
int32_t rsi_device_init(uint8_t select_option);
Description
This API to used to power cycle the module and set the boot up option for WiSeConnect TM features. This API also initialize the module SPI.
Parameters
Return Values
On Success : 0
On Failure : -1
3.3rsi_bl_module_power_off
Prototype
int32_t rsi_bl_module_power_off(void);
Description
This API to used to poweroff the WiSeConnect TM device
Parameters
None
Return Values
On Success : 0
On Failure : -1
3.4rsi_bl_module_power_on
Prototype
int32_t rsi_bl_module_power_on(void);
Description
This API to used to power on the WiSeConnect TM device
Parameters
None
Return Values
On Success : 0
On Failure : -1
3.5rsi_bl_upgrade_firmware
Prototype
int16_t rsi_bl_upgrade_firmware(uint8_t *firmware_image,
uint32_t fw_image_size,
uint8_t flags);
Description
This API to used to upgrade the firmware in the WiSeConnectTM device from the host.
Firmware file is given to this API in chunks .
Each chunk must be multiple of 4096 bytes unless it is last chunk.
For the first chunk set RSI_FW_START_OF_FILE in flags.
For the last chunk set RSI_FW_END_OF_FILE in flags.
Parameters
Return Values
On Success : 0
On Failure : -1
3.6rsi_wireless_init
Prototype
int32_t rsi_wireless_init(uint16_t opermode,uint16_t coex_mode);
Description
This API to enable and initialize WiSeConnect TM features.
Parameters
Return Values
On Success : 0
On Failure :
if return value is less than 0
-2 : Invalid parameters
-3 : Command given in wrong state
-4 : Buffer not available to serve the command
if return value is greater than 0
0x0021,0x0025,0xFF73,0x002C,0xFF6E,0xFF6F,
0xFF70,0xFFC5,0x0059,0xff2C
Please refer WLAN Error codes, Bluetooth Generic Error codes for description of above
error codes.
NOTE:
If 0x0059, 0xff2C error codes are returned try reducing wlan and/or Bluetooth features.
3.7rsi_wireless_deinit
Prototype
int32_t rsi_wireless_deinit()
Description
This API is used to de-initialize WiSeConnect TM software feature. This API should be called before rsi_wireless_init if user wants to change previous configuration.
Parameters
None
Return Values
On Success : 0
On Failure :
if return value is less than 0
-2 : Invalid parameters
-3 : Command given in wrong state
-4 : Buffer not available to serve the command
RS9113 WiSeConnectTM Simple API Guide Version 1.4
3.8 rsi_wireless_driver_task
Prototype
void rsi_wireless_driver_task(void);
Description
This API is used to handle driver’s events.
This API should be called in application main loop for non-OS platforms
Parameters
None
Return Values
None
3.9 rsi_wireless_antenna
Prototype
int32_t rsi_wireless_antenna(uint8_t type, uint8_t gain_2g, uint8_t gain_5g,
uint8_t antenna_path, uint8_t antenna_type)
Description
This API is used to configure the antenna. It should be called after rsi_wlan_radio_init().
Parameters
RS9113 WiSeConnectTM
Simple API Guide
Version 1.4
Return Values
On Success : 0
On Failure :
if return value is less than 0
-4 : Buffer not available to serve the command
if return value is greater than 0
0x0025, 0x002C
Please refer WLAN Error codes for description of above error codes.
3.10rsi_cmd_uart_flow_ctrl
Prototype
int32_t rsi_cmd_uart_flow_ctrl(uint8_t flow_ctrl_en) Description
This API is used to enable/disable hardware flow control
Parameters
Return Values None
4WLAN API
This Section contains description about Wi-Fi API to initialize and configure module in Wi-Fi mode.
4.1WLAN Core API
This section contains core API to configure the module in
4.1.1rsi_wlan_scan
Prototype
int32_t rsi_wlan_scan(uint8_t *ssid,
uint8_t chno,
rsi_rsp_scan_t *result,
uint32_t length)
Description
This API is used to scan surrounding Wi-Fi networks.
Parameters
Channels supported
Table 1: 2.4GHz Band Channel Mapping Channels supported in 5GHz band:
Table 2: 5GHz Band Channel Mapping
Scan Response structure format
typedef struct rsi_scan_info_s
{
uint8_t rf_channel;
uint8_t security_mode;
uint8_t rssi_val;
uint8_t network_type;
uint8_t ssid[34];
uint8_t bssid[6];
uint8_t reserved[2];
}rsi_scan_info_t;
typedef struct rsi_rsp_scan_s
{
uint8_t scan_count[4];
uint8_t reserved[4];
rsi_scan_info_t scan_info[11]; } rsi_rsp_scan_t;
Return Values
On Success : 0
On Failure :
if return value is less than 0
-2 : Invalid parameters
-3 : Command given in wrong state
-4 : Buffer not available to serve the command
if return value is greater than 0
0x0002,0x0003,0x0005,0x000A,0x0014,0x0015,0x001A, 0x0021,0x0024,0x0025,0x0026,0x002C,0x003c Please refer WLAN Error codes for description of above error codes.
4.1.2rsi_wlan_bgscan_profile
Prototype
int32_t rsi_wlan_bgscan_profile(uint8_t cmd,
rsi_rsp_scan_t *result,
uint32_t length)
Description
This API is used to get bgscan result or stop bgscan
Parameters
bgscan Response structure format
typedef struct rsi_scan_info_s
{
uint8_t rf_channel;
uint8_t security_mode;
uint8_t rssi_val;
uint8_t network_type;
uint8_t ssid[34];
uint8_t bssid[6];
uint8_t reserved[2];
}rsi_scan_info_t;
typedef struct rsi_rsp_scan_s
{
uint8_t scan_count[4];
uint8_t reserved[4];
rsi_scan_info_t scan_info[11]; } rsi_rsp_scan_t;
Return Values
On Success : 0
On Failure :
if return value is less than 0
-2 : Invalid parameters
-3 : Command given in wrong state
-4 : Buffer not available to serve the command
if return value is greater than 0
0x00021,0x0025,0x002C,0x004A
Please refer WLAN Error codes for description of above error codes.
4.1.3rsi_wlan_scan_async
Prototype
int32_t rsi_wlan_scan_async(uint8_t *ssid,
uint8_t chno, void(*scan_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length)))
Description
This API is used to scan surrounding Wi-Fi networks.A scan response handler is registered to
get the response for scan
Parameters
Channels supported
Table 3: 2.4GHz Band Channel Mapping Channels supported in 5GHz band:。