Skip to content

Commit

Permalink
Restyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Morozov-5F committed Jul 6, 2022
1 parent 49fe2f3 commit c41d9ef
Show file tree
Hide file tree
Showing 72 changed files with 54,627 additions and 53,350 deletions.
92 changes: 46 additions & 46 deletions examples/all-clusters-app/nxp/mw320/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,55 +811,55 @@ std::string createSetupPayload()
#if 0
void demo_init(void)
{
struct wlan_network network;
struct wlan_network network;
int ret = 0;

// add uAP profile
// add uAP profile
memset(&network, 0, sizeof(struct wlan_network));
memcpy(network.name, profile, strlen(profile));

memcpy(network.ssid, ssid, strlen(ssid));
network.channel = 1;
memcpy(network.ssid, ssid, strlen(ssid));
network.channel = 1;

network.ip.ipv4.address = net_inet_aton(network_ip);
network.ip.ipv4.address = net_inet_aton(network_ip);
network.ip.ipv4.gw = net_inet_aton(network_ip);
network.ip.ipv4.netmask = net_inet_aton(network_netmask);
network.ip.ipv4.addr_type = ADDR_TYPE_STATIC;
network.ip.ipv4.addr_type = ADDR_TYPE_STATIC;

network.security.psk_len = strlen(psk);
network.security.psk_len = strlen(psk);
strcpy(network.security.psk, psk);
network.security.type = WLAN_SECURITY_WPA2;
network.security.type = WLAN_SECURITY_WPA2;

network.role = WLAN_BSS_ROLE_UAP;
network.role = WLAN_BSS_ROLE_UAP;

ret = wlan_add_network(&network);
switch (ret)
{
case WM_SUCCESS:
PRINTF("Added \"%s\"\r\n", network.name);
break;
case -WM_E_INVAL:
PRINTF("Error: network already exists or invalid arguments\r\n");
break;
case -WM_E_NOMEM:
PRINTF("Error: network list is full\r\n");
break;
case WLAN_ERROR_STATE:
PRINTF("Error: can't add networks in this state\r\n");
break;
default:
PRINTF(
"Error: unable to add network for unknown"
" reason\r\n");
break;
case WM_SUCCESS:
PRINTF("Added \"%s\"\r\n", network.name);
break;
case -WM_E_INVAL:
PRINTF("Error: network already exists or invalid arguments\r\n");
break;
case -WM_E_NOMEM:
PRINTF("Error: network list is full\r\n");
break;
case WLAN_ERROR_STATE:
PRINTF("Error: can't add networks in this state\r\n");
break;
default:
PRINTF(
"Error: unable to add network for unknown"
" reason\r\n");
break;
}

// start uAP
// start uAP
ret = wlan_start_network(profile);
if (ret != WM_SUCCESS)
PRINTF("Error: unable to start network\r\n");
else
PRINTF("start uAP ssid: %s\r\n", network.ssid);
else
PRINTF("start uAP ssid: %s\r\n", network.ssid);

}
#endif // 0
Expand Down Expand Up @@ -956,7 +956,7 @@ void task_main(void * param)
{
/* wait for interface up */
os_thread_sleep(os_msec_to_ticks(5000));
PRINTF("[%s]: looping\r\n", __FUNCTION__);
PRINTF("[%s]: looping\r\n", __FUNCTION__);
}
#endif // 0
}
Expand Down Expand Up @@ -1388,22 +1388,22 @@ static void OnSwitchAttributeChangeCallback(EndpointId endpointId, AttributeId a
VerifyOrExit(attributeId == ZCL_CURRENT_POSITION_ATTRIBUTE_ID,
ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId));
// Send the switch status report now
/*
for (uint32_t i = 0 ; i<pimEngine->GetNumActiveReadHandlers() ; i++) {
ReadHandler * phandler = pimEngine->ActiveHandlerAt(i);
if (phandler->IsType(chip::app::ReadHandler::InteractionType::Subscribe) &&
(phandler->IsGeneratingReports() || phandler->IsAwaitingReportResponse())) {
phandler->UnblockUrgentEventDelivery();
do_sendrpt = true;
break;
}
}
if (do_sendrpt == true) {
ConcreteEventPath event_path(endpointId, ZCL_SWITCH_CLUSTER_ID, 0);
pimEngine->GetReportingEngine().ScheduleEventDelivery(event_path, chip::app::EventOptions::Type::kUrgent,
sizeof(uint16_t));
}
*/
/*
for (uint32_t i = 0 ; i<pimEngine->GetNumActiveReadHandlers() ; i++) {
ReadHandler * phandler = pimEngine->ActiveHandlerAt(i);
if (phandler->IsType(chip::app::ReadHandler::InteractionType::Subscribe) &&
(phandler->IsGeneratingReports() || phandler->IsAwaitingReportResponse())) {
phandler->UnblockUrgentEventDelivery();
do_sendrpt = true;
break;
}
}
if (do_sendrpt == true) {
ConcreteEventPath event_path(endpointId, ZCL_SWITCH_CLUSTER_ID, 0);
pimEngine->GetReportingEngine().ScheduleEventDelivery(event_path, chip::app::EventOptions::Type::kUrgent,
sizeof(uint16_t));
}
*/
exit:
return;
}
Expand Down
Loading

0 comments on commit c41d9ef

Please sign in to comment.