Skip to content

Commit

Permalink
AlterandoIpServer
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielSirtoriCorrea committed Jul 22, 2020
1 parent c06b894 commit 478d1a0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,24 @@
import com.gazeboindustries.sextafeiramobile.ServerConnection;

public class HomeFragment extends Fragment {
private Button startFriday;
private ServerConnection connection;

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_home, container, false);

connection = new ServerConnection();

startFriday = view.findViewById(R.id.btnStartFriday);

startFriday.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
connection.sendRequest(connection.prepareRequest("startFriday"));
}
});

return view;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import static java.lang.Thread.sleep;

public class ServerConnection extends AsyncTask<JSONObject, Integer, ArrayList<JSONArray>> {
private String IP = "gazeboindustries.hopto.org";
//private String IP = "192.168.0.5";
//private String IP = "gazeboindustries.hopto.org";
private String IP = "192.168.0.5";
private int port = 5000;
private Socket socket;
private PrintWriter out;
Expand Down
2 changes: 1 addition & 1 deletion Configurations.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"ServerConfigs": {
"ID": "Server",
"Host": "192.168.0.5",
"Host": "192.168.0.4",
"Port": 5000
},
"InterfaceConfigs": {
Expand Down
2 changes: 1 addition & 1 deletion Server/DevicesStatus.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"url": ".com"
},
"Interface": {
"action": 0,
"action": 1,
"url": ".com"
}
}
5 changes: 4 additions & 1 deletion Server/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def handle(self):

if clientRequest['header'] == 'gazeboindustries09082004':

if clientRequest['request'] == 'getDevices':
if clientRequest['request'] == 'startFriday':
os.startfile('E:\\Sexta-Feira-Mark_6\\Interface\\Interface\\target\\Interface-6.0.jar')

elif clientRequest['request'] == 'getDevices':
device = convertList(dataBaseConnection.getDevices())

self.request.send(json.dumps(device).encode())
Expand Down
Binary file modified Sexta-Feira(A.I.)/__pycache__/Commands.cpython-36.pyc
Binary file not shown.

0 comments on commit 478d1a0

Please sign in to comment.