+
+
+void Peers::connect_pbc()
+{
+ if (ctx_item == NULL)
+ return;
+
+ char cmd[100];
+ char reply[100];
+ size_t reply_len;
+
+ int peer_type = ctx_item->data(peer_role_type).toInt();
+ if (peer_type == PEER_TYPE_WPS_ER_ENROLLEE) {
+ snprintf(cmd, sizeof(cmd), "WPS_ER_PBC %s",
+ ctx_item->data(peer_role_uuid).toString().toAscii().
+ constData());
+ } else {
+ snprintf(cmd, sizeof(cmd), "WPS_PBC");
+ }
+ reply_len = sizeof(reply) - 1;
+ if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0) {
+ QMessageBox msg;
+ msg.setIcon(QMessageBox::Warning);
+ msg.setText("Failed to start WPS PBC.");
+ msg.exec();
+ }
+}