Update API Calls#

In your existing application, replace each WiSeConnectâ„¢ SDK v2.x API call with the equivalent v3.x API call(s). Refer to the tables in the sections below for the mapping of v2.x to v3.x APIs.

v2.x APIs are listed in alphabetical order of API name.

If your v2.x API is not mentioned below, it is not supported in the v3.x API.

BLE APIs#

BLE APIs are identical in WiSeConnect SDK v2.x and v3.x.

Common APIs#

v2.x API

v3.x API

Notes

int32_t rsi_assert( void )

sl_status_t sl_si91x_assert( void )

int32_t rsi_cmd_m4_ta_secure_handshake( uint8_t sub_cmd_type, uint8_t input_len, uint8_t *input_data, uint8_t output_len, uint8_t *output_data )

sl_status_t sl_si91x_m4_ta_secure_handshake( uint8_t sub_cmd_type, uint8_t input_len, uint8_t *input_data, uint8_t output_len, uint8_t *output_data )

int32_t rsi_device_init( uint8_t select_option )

sl_status_t sl_wifi_init( const sl_wifi_device_configuration_t *configuration, sl_wifi_event_handler_t event_handler )

int32_t rsi_device_deinit( void )

sl_status_t sl_wifi_deinit( void )

int32_t rsi_driver_deinit(void)

sl_status_t sl_si91x_driver_deinit( void )

int32_t rsi_get_fw_version( uint8_t *response, uint16_t length )

sl_status_t sl_wifi_get_firmware_version( sl_wifi_version_string_t *version )

int32_t rsi_send_feature_frame_dyn( uint32_t feature_enables )

sl_wifi_init()

See signature above.

int32_t rsi_send_feature_frame( void )

sl_status_t sl_si91x_driver_init( const sl_wifi_device_configuration_t *config, sl_wifi_event_handler_t event_handler )

The sl_si91x_driver_init() function sends the feature frames.

int32_t rsi_wireless_antenna( uint8_t type, uint8_t gain_2g, uint8_t gain_5g )

sl_status_t sl_wifi_get_antenna()( sl_wifi_interface_t interface, sl_wifi_antenna_t *antenna )

No support for gain_2g or gain_5g parameters.

int32_t rsi_wireless_deinit( void )

sl_wifi_deinit()

See signature above.

void rsi_wireless_driver_task( void )

void sl_system_kernel_start( void )

sl_system_kernel_start() is a Gecko Platform API.

int32_t rsi_wireless_init( uint16_t opermode, uint16_t coex_mode )

sl_wifi_init()

See signature above.

Wi-Fi APIs#

v2.x API

v3.x API

Notes

int32_t rsi_config_ipaddress( rsi_ip_version_t version, uint8_t mode, uint8_t *ip_addr, uint8_t *mask, uint8_t *gw, uint8_t *ipconfig_rsp, uint16_t length, uint8_t vap_id )

sl_status_t sl_si91x_configure_ip_address( sl_net_ip_configuration_t *address )

int32_t rsi_driver_process_recv_data( rsi_pkt_t *pkt )

None

The v3.x SDK processes this internally in the bus_thread.

int16_t rsi_nwk_register_callbacks( uint32_t callback_id, void (*callback_handler_ptr)(uint8_t command_type, uint32_t status, const uint8_t *buffer, const uint32_t length) )

sl_status_t sl_si91x_register_callback( sl_net_event_t event, sl_net_event_handler_t function )

Every service has APIs to register callbacks.

void rsi_sort_scan_results_array_based_on_rssi( struct wpa_scan_results_arr *scan_results_array )

sl_status_t sl_wifi_wait_for_scan_results( sl_wifi_scan_result_t **scan_result_array, uint32_t max_scan_result_count )

int32_t rsi_wlan_ap_start( int8_t *ssid, uint8_t channel, rsi_security_mode_t security_type, rsi_encryption_mode_t encryption_mode, uint8_t *password, uint16_t beacon_interval, uint8_t dtim_period )

sl_status_t sl_wifi_start_ap( sl_wifi_interface_t interface, const sl_wifi_ap_configuration_t *configuration )

int32_t rsi_wlan_bgscan_profile( uint8_t cmd, rsi_rsp_scan_t *result, uint32_t length )

sl_status_t sl_wifi_start_scan( sl_wifi_scan_result_t **scan_result_array, uint32_t max_scan_result_count )

int32_t rsi_wlan_connect( int8_t *ssid, rsi_security_mode_t sec_type, void *secret_key )

sl_status_t sl_wifi_connect( sl_wifi_interface_t interface, const sl_wifi_client_configuration_t *access_point, uint32_t timeout_ms )

Currently not supported: RSI_WLAN_REQ_WMM_PS, RSI_WLAN_REQ_WPS_METHOD, RSI_WLAN_REQ_SET_WEP_KEYS, RSI_WLAN_REQ_REJOIN_PARAMS

int32_t rsi_wlan_connect_async( int8_t *ssid, rsi_security_mode_t sec_type, void *secret_key, void (*join_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length) )

sl_wifi_connect()

See signature above.

int32_t rsi_wlan_disconnect( void )

sl_status_t sl_wifi_disconnect( sl_wifi_interface_t interface )

int32_t rsi_wlan_disconnect_stations( uint8_t *mac_address )

sl_status_t sl_wifi_disconnect_ap_client( sl_wifi_interface_t interface, const sl_mac_address_t *mac, sl_wifi_deauth_reason_t reason )

int32_t rsi_wlan_filter_broadcast( uint16_t beacon_drop_threshold, uint8_t filter_bcast_in_tim, uint8_t filter_bcast_tim_till_next_cmd )

sl_status_t sl_wifi_filter_broadcast( uint16_t beacon_drop_threshold, uint8_t filter_bcast_in_tim, uint8_t filter_bcast_tim_till_next_cmd )

int32_t rsi_wlan_get( rsi_wlan_query_cmd_t cmd_type, uint8_t *response, uint16_t length )

sl_wifi_get_mac_address(), sl_wifi_get_ip_address(), sl_wifi_get_signal_strength(), sl_wifi_get_ap_client_info(), getsockname(), sl_wifi_get_statistics(), sl_wifi_get_channel(), sl_wifi_get_firmware_version()

Currently not supported: RSI_WLAN_REQ_CONNECTION_STATUS, RSI_WLAN_REQ_GET_CFG, RSI_WLAN_REQ_GET_STATS

int32_t rsi_wlan_ping_async( uint8_t flags, uint8_t *ip_address, uint16_t size, void (*wlan_ping_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length) )

sl_status_t sl_si91x_send_ping( sl_ip_address_t ip_address, uint16_t ping_packet_size )

int32_t rsi_wlan_pmk_generate( int8_t type, int8_t *psk, int8_t *ssid, uint8_t *pmk, uint16_t length )

sl_status_t sl_wifi_get_pairwise_master_key( sl_wifi_interface_t interface, const uint8_t type, const sl_wifi_ssid_t *ssid, const char *pre_shared_key, uint8_t *pairwise_master_key )

int32_t rsi_wlan_power_save_with_listen_interval( uint8_t psp_mode, uint8_t psp_type, uint16_t listen_interval )

sl_status_t sl_wifi_set_listen_interval( sl_wifi_interface_t interface, sl_wifi_listen_interval_t listen_interval )

int32_t rsi_wlan_power_save_profile( uint8_t psp_mode, uint8_t psp_type )

sl_status_t sl_wifi_set_performance_profile( const sl_wifi_performance_profile_t *profile )

int32_t rsi_wlan_radio_init( void )

sl_status_t sl_wifi_init( const sl_wifi_device_configuration_t *configuration, sl_wifi_event_handler_t event_handler )

RSI_TIMEOUT_SUPPORT not supported.

int32_t rsi_wlan_receive_stats_start( uint16_t channel )

sl_status_t sl_wifi_start_statistic_report( sl_wifi_interface_t interface, sl_wifi_channel_t channel )

int32_t rsi_wlan_receive_stats_stop( void )

sl_status_t sl_wifi_stop_statistic_report( sl_wifi_interface_t interface )

uint16_t rsi_wlan_register_callbacks( uint32_t callback_id, void (*callback_handler_ptr)(uint16_t status, uint8_t *buffer, const uint32_t length) )

sl_status_t sl_wifi_set_callback( sl_wifi_event_group_t group, sl_wifi_callback_function_t function, void *optional_arg )

Every service has APIs to register callbacks.

int32_t rsi_wlan_scan( int8_t *ssid, uint8_t chno, rsi_rsp_scan_t *result, uint32_t length )

sl_wifi_start_scan()

See signature above.

int32_t rsi_wlan_scan_async( int8_t *ssid, uint8_t chno, void (*scan_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length) )

sl_wifi_start_scan()

See signature above.

int32_t rsi_wlan_send_data( uint8_t *buffer, uint32_t length )

sl_status_t sl_wifi_send_raw_data_frame( sl_wifi_interface_t interface, const void *data, uint16_t data_length )

int32_t rsi_wlan_set_certificate_index( uint8_t certificate_type, uint8_t cert_inx, uint8_t *buffer, uint32_t certificate_length )

sl_status_t sl_wifi_set_certificate_with_index( uint8_t certificate_type, uint8_t certificate_index, uint8_t *buffer, uint32_t certificate_length )

int32_t rsi_wlan_set( rsi_wlan_set_cmd_t cmd_type, uint8_t *request, uint16_t length )

sl_status_t sl_wifi_set_mac_address( sl_wifi_interface_t interface, const sl_mac_address_t *mac )

int32_t rsi_wlan_wfd_connect( int8_t *device_name, void (*join_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length) )

sl_status_t sl_wifi_p2p_connect( sl_wifi_interface_t interface, const sl_wifi_p2p_configuration_t *configuration )

int32_t rsi_wlan_wfd_start_discovery( uint16_t go_intent, int8_t *device_name, uint16_t channel, int8_t *ssid_post_fix, uint8_t *psk, void (*wlan_wfd_discovery_notify_handler)(uint16_t status, uint8_t *buffer, const uint32_t length), void (*wlan_wfd_connection_request_notify_handler)(uint16_t status, uint8_t *buffer, const uint32_t length) )

sl_status_t sl_wifi_start_p2p_discovery( sl_wifi_interface_t interface, const sl_wifi_p2p_configuration_t *configuration, sl_wifi_credential_id_t credential_id )

int32_t rsi_wlan_wps_generate_pin( uint8_t *wps_pin, uint16_t length )

sl_status_t sl_wifi_generate_wps_pin( sl_wifi_wps_pin_t *response )

int32_t rsi_wlan_wps_push_button_event( int8_t *ssid )

sl_status_t sl_wifi_start_wps( sl_wifi_interface_t interface, sl_wifi_wps_mode_t mode, const sl_wifi_wps_pin_t *optional_wps_pin )

Network Management APIs#

v2.x API

v3.x API

Notes

int32_t rsi_accept( int32_t sockID, struct rsi_sockaddr *ClientAddress, int32_t *addressLength )

accept()

BSD-standard API.

int32_t rsi_bind( int32_t sockID, struct rsi_sockaddr *localAddress, int32_t addressLength )

bind()

BSD-standard API.

void rsi_clear_sockets( int32_t sockID )

sl_status_t sl_si91x_socket_deinit( void )

int32_t rsi_connect( int32_t sockID, struct rsi_sockaddr *remoteAddress, int32_t addressLength )

connect()

BSD-standard API.

int32_t rsi_dns_req( uint8_t ip_version, uint8_t *url_name, uint8_t *primary_server_address, uint8_t *secondary_server_address, rsi_rsp_dns_query_t *dns_query_resp, uint16_t length )

sl_status_t sl_dns_host_get_by_name( const char *host_name, const uint32_t timeout, const sl_net_dns_resolution_ip_type_t dns_resolution_ip, sl_ip_address_t *ip_address )

Also see the next row.

Same as above.

struct hostent gethostbyname( const char *name )

int32_t rsi_emb_mqtt_client_init( int8_t *server_ip, uint32_t server_port, uint32_t client_port, uint16_t flags, uint16_t keep_alive_interval, int8_t *clientid, int8_t *username, int8_t *password )

sl_status_t sl_mqtt_client_init( sl_mqtt_client_t *client, sl_mqtt_client_event_handler event_handler )

int32_t rsi_emb_mqtt_connect( uint8_t mqtt_flags, int8_t *will_topic, uint16_t will_message_len, int8_t *will_message )

sl_status_t sl_mqtt_client_connect( sl_mqtt_client_t *client, const sl_mqtt_broker_t *broker, const sl_mqtt_client_last_will_message_t *last_will_message, const sl_mqtt_client_configuration_t *configuration, uint32_t timeout )

int32_t rsi_emb_mqtt_destroy( void )

sl_status_t sl_mqtt_client_deinit( sl_mqtt_client_t *client )

int32_t rsi_emb_mqtt_disconnect( void )

sl_status_t sl_mqtt_client_disconnect( sl_mqtt_client_t *client, uint32_t timeout )

int32_t rsi_emb_mqtt_publish( int8_t *topic, rsi_mqtt_pubmsg_t *publish_msg )

sl_status_t sl_mqtt_client_publish( sl_mqtt_client_t *client, const sl_mqtt_client_message_t *message, uint32_t timeout, void *context)

int32_t rsi_emb_mqtt_subscribe( uint8_t qos, int8_t *topic )

sl_status_t sl_mqtt_client_subscribe( sl_mqtt_client_t *client, const uint8_t *topic, uint16_t topic_length, sl_mqtt_qos_t qos_level, uint32_t timeout, sl_mqtt_client_message_received message_handler, void *context )

int32_t rsi_emb_mqtt_unsubscribe( int8_t *topic )

sl_status_t sl_mqtt_client_unsubscribe( sl_mqtt_client_t *client, const uint8_t *topic, uint16_t length, uint32_t timeout, void *context )

int32_t rsi_get_socket_descriptor( uint8_t *src_port, uint8_t *dst_port, uint8_t *ip_addr, uint16_t ip_version, uint16_t sockid )

getsockname()

BSD-standard API.

int32_t rsi_get_socket_id( uint32_t src_port, uint32_t dst_port )

int get_socket( int socket_id )

int rsi_getsockopt( int32_t sockID, int level, int option_name, const void *option_value, rsi_socklen_t option_len )

getsockopt()

BSD-standard API.

int32_t rsi_http_client_abort( void )

sl_status_t sl_http_client_deinit( sl_http_client_t *client )

int32_t rsi_http_client_async( uint8_t type, uint8_t flags, uint8_t *ip_address, uint16_t port, uint8_t *resource, uint8_t *host_name, uint8_t *extended_header, uint8_t *user_name, uint8_t *password, uint8_t *post_data, uint32_t post_data_length, #if RSI_HTTP_STATUS_INDICATION_ENvoid (*callback)(uint16_t status, const uint8_t *buffer, const uint16_t length, const uint32_t moredata, uint16_t status_code)#elsevoid (*callback)(uint16_t status, const uint8_t *buffer, const uint16_t length, const uint32_t moredata)#endif )

sl_status_t sl_http_client_send_request( const sl_http_client_t *client, const sl_http_client_request_t *request )

int32_t rsi_http_client_get_async( uint8_t flags, uint8_t *ip_address, uint16_t port, uint8_t *resource, uint8_t *host_name, uint8_t *extended_header, uint8_t *user_name, uint8_t *password, #if RSI_HTTP_STATUS_INDICATION_ENvoid (*http_client_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length, const uint32_t moredata, uint16_t status_code)#elsevoid (*http_client_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length, const uint32_t moredata)#endif )

sl_http_client_send_request()

See signature above.

int32_t rsi_http_client_post_async( uint8_t flags, uint8_t *ip_address, uint16_t port, uint8_t *resource, uint8_t *host_name, uint8_t *extended_header, uint8_t *user_name, uint8_t *password, uint8_t *post_data, uint32_t post_data_length, #if RSI_HTTP_STATUS_INDICATION_ENvoid (*http_client_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length, const uint32_t moredata, uint16_t status_code)#else void (*http_client_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length, const uint32_t moredata)#endif )

sl_http_client_send_request()

See signature above.

int32_t rsi_http_client_post_data( uint8_t *file_content, uint16_t current_chunk_length, #if RSI_HTTP_STATUS_INDICATION_ENvoid (*rsi_http_post_data_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length, const uint32_t moredata, uint16_t status_code)#elsevoid (*rsi_http_post_data_response_handler)(uint16_t status, const uint8_t *buffer, const uint16_t length, const uint32_t moredata)#endif )

sl_http_client_send_request()

See signature above.

int32_t rsi_http_client_put_create( void )

sl_http_client_send_request()

See signature above.

int32_t rsi_http_client_put_delete( void )

sl_http_client_send_request()

See signature above.

int32_t rsi_http_client_put_pkt( uint8_t *file_content, uint16_t current_chunk_length )

sl_http_client_send_request()

See signature above.

int32_t rsi_http_client_put_start( uint8_t flags, uint8_t *ip_address, uint32_t port_number, uint8_t *resource, uint8_t *host_name, uint8_t *extended_header, uint8_t *user_name, uint8_t *password, uint32_t content_length, void (*callback)(uint16_t status, uint8_t type, const uint8_t *buffer, uint16_t length, const uint8_t end_of_put_pkt) )

sl_http_client_send_request()

See signature above.

int32_t rsi_listen( int32_t sockID, int32_t backlog )

listen()

BSD-standard API.

int32_t rsi_ota_firmware_upgradation( uint8_t flags, uint8_t *server_ip, uint32_t server_port, uint16_t chunk_number, uint16_t timeout, uint16_t tcp_retry_count, void (*ota_fw_up_response_handler)(uint16_t status, uint16_t chunk_number) )

sl_status_t sl_si91x_ota_firmware_upgradation( sl_ip_address_t server_ip, uint16_t server_port, uint16_t chunk_number, uint16_t timeout, uint16_t tcp_retry_count, bool asynchronous )

int32_t rsi_socket( int32_t protocolFamily, int32_t type, int32_t protocol )

socket()

BSD-standard API.

int32_t rsi_recv( int32_t sockID, void *rcvBuffer, int32_t bufferLength, int32_t flags )

recv()

BSD-standard API.

int32_t rsi_recvfrom( int32_t sockID, int8_t *buffer, int32_t buffersize, int32_t flags, struct rsi_sockaddr *fromAddr, int32_t *fromAddrLen )

recvfrom()

BSD-standard API.

int32_t rsi_select( int32_t nfds, rsi_fd_set *readfds, rsi_fd_set *writefds, rsi_fd_set *exceptfds, struct rsi_timeval *timeout, void (*callback)(rsi_fd_set *fd_read, rsi_fd_set *fd_write, rsi_fd_set *fd_except, int32_t status) )

select()

BSD-standard API.

int rsi_setsockopt( int32_t sockID, int level, int option_name, const void *option_value, rsi_socklen_t option_len )

setsockopt()

BSD-standard API. tcp_max_retry, sni, retry_transmit, vap_id, ssl versions are not supported.

int32_t rsi_send( int32_t sockID, const int8_t *msg, int32_t msgLength, int32_t flags )

send()

BSD-standard API.

int32_t rsi_sendto( int32_t sockID, int8_t *msg, int32_t msgLength, int32_t flags, struct rsi_sockaddr *destAddr, int32_t destAddrLen )

sendto()

BSD-standard API.

int32_t rsi_shutdown( int32_t sockID, int32_t how )

close()

BSD-standard API. Port-based close functionality is not supported.

int32_t rsi_socket_bind( int32_t sockID, struct rsi_sockaddr *localAddress, int32_t addressLength )

bind()

BSD-standard API.

int32_t rsi_socket_create_async( int32_t sockID, int32_t type, int32_t backlog )

socket()

BSD-standard API.

int32_t rsi_socket_connect( int32_t sockID, struct rsi_sockaddr *remoteAddress, int32_t addressLength )

connect()

BSD-standard API.

int32_t rsi_socket_listen( int32_t sockID, int32_t backlog )

listen()

BSD-standard API.

int32_t rsi_socket_recvfrom( int32_t sockID, int8_t *buffer, int32_t buffersize, int32_t flags, struct rsi_sockaddr *fromAddr, int32_t *fromAddrLen )

recvfrom()

BSD-standard API. Large lengths are not supported.

int32_t rsi_socket_shutdown( int32_t sockID, int32_t how )

close()

BSD-standard API. Port-based close functionality is not supported.

int32_t rsi_wlan_set_certificate( uint8_t certificate_type, uint8_t *buffer, uint32_t certificate_length )

sl_status_t sl_wifi_set_certificate( uint8_t certificate_type, const uint8_t *buffer, uint32_t certificate_length )

Firmware Update APIs#

v2.x API

v3.x API

int32_t rsi_fwup( uint8_t type, uint8_t *content, uint16_t length )

sl_status_t sl_si91x_fwup( uint16_t type, uint8_t *content, uint16_t length )

int32_t rsi_fwup_load( uint8_t *content, uint16_t length )

sl_status_t sl_si91x_fwup_load( uint8_t *content, uint16_t length )

int32_t rsi_fwup_start( uint8_t *rps_header )

sl_status_t sl_si91x_fwup_start( uint8_t *rps_header )

int32_t rsi_http_fw_update( uint8_t flags, uint8_t *ip_address, uint16_t port, uint8_t *resource, uint8_t *host_name, uint8_t *extended_header, uint8_t *user_name, uint8_t *password, void (*http_otaf_response_handler)(uint16_t status, const uint8_t *buffer) )

sl_status_t sl_si91x_http_otaf( uint8_t type, uint8_t flags, uint8_t *ip_address, uint16_t port, uint8_t *resource, uint8_t *host_name, uint8_t *extended_header, uint8_t *user_name, uint8_t *password, uint8_t *post_data, uint32_t post_data_length )