Adam Honse
b6cc0bda21
Fix profile packets in SDK client not including the null terminator for the strings
2021-09-19 22:44:34 -05:00
Adam Honse
5130f07e21
Add saving support to network protocol
2021-07-04 21:17:55 -05:00
Adam Honse
d88f9979a9
Rework network client callback pipeline - route callbacks from clients through ResourceManager so that device list callbacks get called. Fixes remote devices not showing up in plugins.
2021-05-14 23:29:34 -05:00
k1-801
402423e338
Fix a memory leak in NetworkClient
2021-04-25 16:55:15 -05:00
morg
e2bc1003e6
Add profile management to SDK
...
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com >
2021-02-05 19:13:50 -06:00
Adam Honse
72da8f362c
SDK protocol versioning implemented. Protocol updated to version 1 which adds vendor string to controller request.
2020-12-01 21:02:32 -06:00
k1-801
dde857dfb4
Tiny threads fixes & a little bit of safety
2020-11-15 13:28:29 -06:00
Adam Honse
716b2aaac3
Protect controller list updates with mutex
2020-09-30 22:45:03 -05:00
Adam Honse
8347644b07
Client clears list and reinitializes controller when the device list updates
2020-09-28 01:29:35 +00:00
Adam Honse
f568253c51
Clean up more warnings
2020-09-02 18:25:58 -05:00
k1-801
8b8451017e
Non-important warnings removed
...
Commit amended by Adam Honse <calcprogrammer1@gmail.com > due to merging from a different branch.
2020-09-01 23:29:00 -05:00
Térence Clastres
53379c5482
Fixes for memory issues detected by valgrind
2020-08-12 23:48:03 -05:00
Adam Honse
0ccf2d0c33
Remove some debugging printouts in Network Client and Server code
2020-07-17 22:10:53 -05:00
Adam Honse
5ce6ec9ea7
Request updated controller mode from server after sending a Set Custom Mode command
2020-07-17 18:29:37 -05:00
Neel Chotai
263561868c
fix musl compilation
2020-07-09 21:51:33 -05:00
Adam Honse
96af869d79
Check for local server before detecting devices from hardware and tweak timeouts to make network connections faster
2020-06-28 21:08:59 -05:00
Térence Clastres
1db412e970
Fix high CPU usage when running the SDK server
...
It was coming from `recv_select()` and `accept_select()`
The timeval struct members for select() is reset after each call to select() for
whatever reason so like FD_ZERO and FD_SET it needs to be placed inside
the loop.
Source: https://stackoverflow.com/questions/3324078/why-select-always-return-0-after-the-first-timeout
2020-06-24 10:08:40 -05:00
Térence Clastres
b94f701db8
Fix high CPU usage when running the SDK server
...
It was coming from `recv_select()` `nd accept_select()`
The timeout for select() is only when waiting for the file descriptor to
be ready for reading/writing so when the FD is ready AND there is
nothing to read, it will not return and instead keep executing the while loop with no timeout.
Fix this by adding a 100ms timeout when there is nothing to read.
2020-06-24 09:35:31 -05:00
Térence Clastres
b79ff124e6
Replace Sleep() by std::thread::sleep_for()
2020-06-24 09:28:11 -05:00
Adam Honse
0464fbcbe2
Make default SDK port a defined constant
2020-06-22 11:32:32 -05:00
Térence Clastres
6d585d3eeb
Network: Print used port on startup and change default to 6742
...
Also print an error if server can't be started
1337 is already used by razer's rest server
Port idea by @bahorn (6742 = ORGB on a phone numpad)
2020-06-20 14:39:14 -05:00
Adam Honse
f2c1022c7f
Don't consider client online until it has been initialized
2020-06-15 22:41:33 -05:00
Adam Honse
cbb13b0d22
Add MacOS support to NetworkClient.cpp
2020-05-16 23:33:49 -07:00
Adam Honse
bd6ec4c41e
Get client stop function working
2020-05-14 10:06:22 -05:00
Adam Honse
e6aadc414b
Handle socket errors on Windows, which does not return 0 when a socket is disconnected like Linux does
2020-05-10 16:22:29 -05:00
Adam Honse
883a78ad9d
Fix client on Windows
2020-05-10 16:16:59 -05:00
Adam Honse
15d23d3009
Add client status update callback to NetworkClient
2020-05-10 13:41:01 -05:00
Adam Honse
e2c2b8c1df
Client will now close listener thread when disconnected and attempt to reconnect. Initialization behavior (controller requests, client string update) are performed automatically upon reconnection
2020-05-10 01:19:38 -05:00
Adam Honse
352b9928ca
Add file headers to network files and some minor code cleanup
2020-05-09 15:48:16 -05:00
Adam Honse
dbe29991f0
Send client string after server is connected
2020-05-09 15:48:15 -05:00
Adam Honse
edf1b251c0
Send and receive client string
2020-05-09 15:48:15 -05:00
Adam Honse
9b8a0d465e
Functions to set IP and port and start client
2020-05-09 15:48:15 -05:00
Adam Honse
04b87ce2eb
Use std::thread for NetworkClient threads
2020-05-09 15:48:14 -05:00
Adam Honse
2bbf66c0ee
Fix memory leaks in client
2020-05-09 15:48:14 -05:00
Adam Honse
d716973642
Get network client working on Windows
2020-05-09 15:48:14 -05:00
Adam Honse
39c5aff864
Send color data over the network when calling color update functions
2020-05-09 15:48:13 -05:00
Adam Honse
450f438538
Send mode data block when updating mode
2020-05-09 15:48:13 -05:00
Adam Honse
0270c745ce
Implement RGBController_Network packet sending for current set of RGBController commands
2020-05-09 15:48:13 -05:00
Adam Honse
e2dfcd5b0f
Client now requests list of all controllers from server and adds them to the master list
2020-05-09 15:48:13 -05:00
Adam Honse
cde7469191
Create functions for sending requests
2020-05-09 15:48:13 -05:00
Adam Honse
7c1a1396ca
Client requests controller count and first controller data block from server, prints response
2020-05-09 15:48:13 -05:00
Adam Honse
dff667751b
Start work on network client
2020-05-09 15:48:12 -05:00
Adam Honse
594f66ab23
Initial network files
2020-05-09 15:48:12 -05:00