int enablePassPointSettings(int ap_index, bool passpoint_enable, bool downstream_disable, bool p2p_disable, bool layer2TIF)
{
printf("enablePassPointSettings.\n");
#ifdef CKP
if (ap_index < 0 || ap_index > MAX_AP_INDEX)
{
wifi_anqp_dbg_print(1, "%s:%d:Invalid ap index: %d\n", __func__, __LINE__, ap_index);
return RETURN_ERR;
}
if(!hs2SettingsStored)
{
hs2SettingsStored = TRUE;
wifi_storeInitialPassPointSettings();
}
if (passpoint_enable)
{
wifi_anqp_dbg_print(1, "%s:%d:Enabling HS2 Settings for ap index: %d\n", __func__, __LINE__, ap_index);
wifi_setCountryIe(ap_index, passpoint_enable);
wifi_setProxyArp(ap_index, passpoint_enable);
wifi_setLayer2TrafficInspectionFiltering(ap_index, layer2TIF);
wifi_setDownStreamGroupAddress(ap_index, downstream_disable);
wifi_setBssLoad(ap_index, passpoint_enable);
wifi_setP2PCrossConnect(ap_index, p2p_disable);
}
else
{
//set the values initially stored in hs2settings for ap index.
wifi_anqp_dbg_print(1, "%s:%d:Disabling HS2 Settings for ap index: %d\n", __func__, __LINE__, ap_index);
wifi_setCountryIe(ap_index, hs2Settings[ap_index].countryIe);
wifi_setProxyArp(ap_index, hs2Settings[ap_index].proxyArp);
wifi_setLayer2TrafficInspectionFiltering(ap_index, hs2Settings[ap_index].layer2TIF);
wifi_setDownStreamGroupAddress(ap_index, hs2Settings[ap_index].downStreamGroupAddress);
wifi_setBssLoad(ap_index, hs2Settings[ap_index].bssLoad);
}
if(wifi_pushApHotspotElement(ap_index,passpoint_enable)!= RETURN_OK)
{
return RETURN_ERR;
}
#endif
return 1;
}
int wifi_setGASConfiguration(unsigned int advertisementID, wifi_GASConfiguration_t *input_struct)
{
printf("wifi_setGASConfiguration.\n");
return 1;
}
// Dummy function to simulate callback registration
int wifi_anqp_request_callback_register(wifi_anqp_request_callback_t callback) {
// Dummy implementation: just print a message and return success
printf("ANQP request callback registered.\n");
return 1;
}
// Example of a dummy callback function
void anqpRequest_callback(int apIndex, mac_address_t sta, unsigned char token, wifi_anqp_node_t *list) {
// Dummy callback implementation
printf("ANQP request received for AP index: %d, token: %u\n", apIndex, token);
}
int wifi_anqpSendResponse(unsigned int apIndex, mac_address_t sta, unsigned char token, wifi_anqp_node_t *list)
{
printf("Called with apIndex: %d\n", apIndex);
// Dummy implementation, just returning 1
return 1;
}
int wifi_pushApInterworkingElement(int apIndex, wifi_InterworkingElement_t *infoElement) {
printf("Called wifi_pushApInterworkingElement with apIndex: %d\n", apIndex);
// Dummy implementation, just returning 1
return 1;
}
// Dummy function implementation
int wifi_pushApRoamingConsortiumElement(int apIndex, wifi_roamingConsortiumElement_t *infoElement) {
// Log the input values (optional, for debugging)
printf("Called wifi_pushApRoamingConsortiumElement with apIndex: %d\n", apIndex);
// Optionally print contents of infoElement for debugging (if fields exist)
if (infoElement != NULL) {
//printf("Info Element some_field: %d\n", infoElement->some_field);
}
// Dummy function, always returns true
return 1;
}
|