From ecef158d3572224fab757c822d32546376a50fde Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 12 Dec 2016 13:50:39 -0600 Subject: [PATCH 1/2] new wireshark dumps and descriptions of how they were setup --- wireshark_dumps/g810-spectrum/README.md | 26 ++++++++++++++++++ ...-to-breathing-252-253-254-fullspeed.pcapng | Bin 0 -> 10624 bytes ...t-to-breathing-252-253-254-midspeed.pcapng | Bin 0 -> 10304 bytes ...ct-to-breathing-252-253-254-nospeed.pcapng | Bin 0 -> 9824 bytes ...-keypress-3-2-1_252-253-254-nospeed.pcapng | Bin 0 -> 10912 bytes .../g810-spectrum/g810-idle.pcapng | Bin 0 -> 1056 bytes .../g810-set-a-to-252-253-254.pcapng | Bin 0 -> 5304 bytes .../g810-set-rcntrl-to-252-253-254.pcapng | Bin 0 -> 5304 bytes .../g810-switches-to-fixedcolor-effect.pcapng | Bin 0 -> 9320 bytes ...-switches-to-from-fixedcolor-effect.pcapng | Bin 0 -> 18112 bytes 10 files changed, 26 insertions(+) create mode 100644 wireshark_dumps/g810-spectrum/README.md create mode 100644 wireshark_dumps/g810-spectrum/g810-effect-to-breathing-252-253-254-fullspeed.pcapng create mode 100644 wireshark_dumps/g810-spectrum/g810-effect-to-breathing-252-253-254-midspeed.pcapng create mode 100644 wireshark_dumps/g810-spectrum/g810-effect-to-breathing-252-253-254-nospeed.pcapng create mode 100644 wireshark_dumps/g810-spectrum/g810-effect-to-keypress-3-2-1_252-253-254-nospeed.pcapng create mode 100644 wireshark_dumps/g810-spectrum/g810-idle.pcapng create mode 100644 wireshark_dumps/g810-spectrum/g810-set-a-to-252-253-254.pcapng create mode 100644 wireshark_dumps/g810-spectrum/g810-set-rcntrl-to-252-253-254.pcapng create mode 100644 wireshark_dumps/g810-spectrum/g810-switches-to-fixedcolor-effect.pcapng create mode 100644 wireshark_dumps/g810-spectrum/g810-switches-to-from-fixedcolor-effect.pcapng diff --git a/wireshark_dumps/g810-spectrum/README.md b/wireshark_dumps/g810-spectrum/README.md new file mode 100644 index 0000000..5316549 --- /dev/null +++ b/wireshark_dumps/g810-spectrum/README.md @@ -0,0 +1,26 @@ +# Description of each wireshark dump found in this folder +=== + +Sets effect to 'breathing' with color rgb(252,253,254) at the highest level the slider bar offers. Noticed that the full cycle of updates after switching to the profile (which was done through linking a profile to Notepad++ and letting logitech automatically send the profile once) is around 1 second for fullspeed, 5 seconds for midspeed, and a long 10 seconds for nospeed. + +`g810-effect-to-breathing-252-253-254-fullspeed.pcapng +`g810-effect-to-breathing-252-253-254-midspeed.pcapng +`g810-effect-to-breathing-252-253-254-nospeed.pcapng + +Sets effect to 'key press' with pressed color rgb(3,2,1) and background color rgb(252,253,254) with slider at lowest speed + +`g810-effect-to-keypress-3-2-1_252-253-254-nospeed.pcapng + +Idle g810 capture, was getting periodic updates without having anything interesting going on. Not sure why + +`g810-idle.pcapng + +Sets key color of 'a' / 'rcntrl' to rgb(252,253,254) + +`g810-set-a-to-252-253-254.pcapng +`g810-set-rcntrl-to-252-253-254.pcapng + +Sets effect to 'fixedcolor' - believe this was also at rgb(252,253,254). The second one includes going to the window and back, where it loads the profile and then reloads the former profile. + +`g810-switches-to-fixedcolor-effect.pcapng +`g810-switches-to-from-fixedcolor-effect.pcapng diff --git a/wireshark_dumps/g810-spectrum/g810-effect-to-breathing-252-253-254-fullspeed.pcapng b/wireshark_dumps/g810-spectrum/g810-effect-to-breathing-252-253-254-fullspeed.pcapng new file mode 100644 index 0000000000000000000000000000000000000000..6f0210363d5fd758a71e02ea85b228520e5dd312 GIT binary patch literal 10624 zcmdU#Piz!b9LL{m3j%2aHN+5iNydajNh$8O*b*pMrGQFI8a>p6O=|zFvI2H#fs#NB zArRw1FCM&j@G2ZITr|qT0~c;2oQOvbdenml2~gj6c4y!3&HVPwn?JiTskk+XGe;qvC@eA zDvs_S9o;NvZJh-6hX)6vTtarGcwY;7N$Q5IwM( z+k|JYZ63%uV!JmN8q;`D4qu}v&vED)n}k!>*e-wM46OAWl#kkg4)i7(uljlg`MiEm zPfb1i>m25AUS5~4#k;$D8$P-=B3pRHNBX z8~s@>+9ajJ=SSzm>Oq9<&pID-egamygwNAw&k3UF{G{Py*uSt;x)qks%6l|F+uS?b z{C;nrA7~WiHRC7d`^g* zzG%^WSUpQV=KKV#w2jY|FKK?*>+$o`kk5^Kw)M4jsMVTHG=6~3U(ichUzn@v z%aEV2m1dS{exR4OzGCpn=fq3m0D(lvZ&Xns}@BaRRBlGc~bCo(_OO4AFiul3+_2w)ncy?jjl$IB13 z(l$Qd9gdfu!#*7O$nk+*()?hq>d%q+p;nq+Xnvrl>g)G&GYLMQ>U^k1@c+;C`g$`K zA65?v?B@%ePh@_mm9F74*)cwm`Jq-=K0jPepC4$TH{&P>cD=R!{8j`X=&AZ*^`OA! z2Xj?@MdpWE=^8$7cZ^SDeyEkU@%izWc=P{*1Y*z6|*ZTe09n_lmsr?@xald6)2^8X-O>Np!qZjt}${A6Bm=AIw#J4EtAK z$O_8`dTIMl3_e!(SF__|&X3Lg)eiFsE!vBfpO1UX3Hr~yC0bupBUoQ{_gA5(>WkHD zSznl|>dTNH%ln7WQ}soAp?&|+`B058ADjEDIv-Zgl8>SP82BL57}($ccsOmzTmFH{ z-}QO^cfU4T>zVus$42kvN3)sw)AiE(`yjuRsXtvWy}z&AFEaI~>!tU1fBx%C{pot? t{fSfGXX;PaOYd*;=B-Tq>3Zq?t=|4MQ-8W%dVfFvb3apmx?X&L{{sT@*na>3 literal 0 HcmV?d00001 diff --git a/wireshark_dumps/g810-spectrum/g810-effect-to-breathing-252-253-254-midspeed.pcapng b/wireshark_dumps/g810-spectrum/g810-effect-to-breathing-252-253-254-midspeed.pcapng new file mode 100644 index 0000000000000000000000000000000000000000..c5c4b9798f0504c4c258b58203faaadb5beac3e6 GIT binary patch literal 10304 zcmd6sJ8T?P6o&7v6NoKaUL*4myGVneu;n<6P2$C|0h1UgB1EE~1Sv-GYXhqgSUIti zf&u|G6;M!7(FUP_5LAW^C_pYqks=QvM3XK;pd`-yXLshFJ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a(*L1=nL(Su%tSXSvqT|0GcP5-yja0pAvm?DEHgP(As{h1 zTftCAA*nPoCq=>B%)pR=g+Z6Wr8Ku7Ik7-NBRsPxwKyZOC|gs(NDl}VG|IrVu7Pg4 zxw&atl7WRL&@K=F*$uL{28e$G@&Eq}3``6f3^6f!F$I|gsWIg+v*J@LN`R)v8yOgy z85$WH8JL@x7#ni}b+ZBW@sQ|Vpcb&5AiV(~4iJ<%vod`6C*!9NWP`9YLqdbLGBC0=fW#31WDdG{240!S=ACgApv=7Vh^@%xQS83uiy8fq z{7bR>?rro%HjiTW$^D&)Y#zn#3*~->Y#zn#i)k?mpl0|@o>Yfy9>wmveD@Txc_fD) E0K{vrsQ>@~ literal 0 HcmV?d00001 diff --git a/wireshark_dumps/g810-spectrum/g810-set-a-to-252-253-254.pcapng b/wireshark_dumps/g810-spectrum/g810-set-a-to-252-253-254.pcapng new file mode 100644 index 0000000000000000000000000000000000000000..31f9f8751976e80f674b358eeaee4d3183bbb137 GIT binary patch literal 5304 zcmbuDZ)_7~9LImxtz{kUXvY*`ogRwXxpiv`TZa}HZiwQ*De4rfquZ)BZQU|p@M13} zG4UUXChALlVWPa?jlKYbiHX5iCNuGkz9J%`qOVMBVxn$){QkQ3c&^@c*Slx=c)eKcy!6qcLiv2o0Yo%uJ?d)bLn#HgoL7^lYwEjrZV34bPS4NHp?7BGLE! zM0B7NYw_TT2S>t=^zZp|;Yw zTw|0EVsMS+>$zeS+l;o8?ao`znv2{&A!nb7AYBlx^onmrC>)G|QbV%o?X4a}& z(Rz{nyj-yA$2@Ca&DW7Ng<5Vw);58gSC*G<5)IUb`^-k{w}K!DfL_o8BA^>|0i&$( z+IC&OyP$JfGizvj&8%@fYgsdQ`TbkP}g=j(HM2wo0?5%4fL03HGliVd`1 zw9o^>Py6s(Gc4BAkZ7j+g_rh-t;{igh#&ch7-m zK?*zrj)14ZQ(~INFh2>N0FQ&iz$lkj7VW$IOV@NR9p{qkId$nS*5`5pUee$w*Z|%HE#M8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VWvCze1G)$O4*j;c z^x!V$B*gDRW6&?qD0BzXvEw4^=_uptaCPP$i^e$+ZPbU2RvEv)64bi_Rtc36|nHSUAgDU)xv; z4=qby1-O*s*|P?78RUgZk;z8PkKx&~8FK(?fHvXzv=K7{(Xr&(f~BsuE6YnaZ7f&F zrH_5Ap?fD<|D$9n@7+$8?(g5{?sXUb{|bJqo%BJrrR|EoXK^>cYl@R55}IG@H1u|o5cu$svnWP6hNVZR(7*^|Yauh!=0 QR-=tip8Wi;mGoZy2mHLTN&o-= literal 0 HcmV?d00001 diff --git a/wireshark_dumps/g810-spectrum/g810-switches-to-fixedcolor-effect.pcapng b/wireshark_dumps/g810-spectrum/g810-switches-to-fixedcolor-effect.pcapng new file mode 100644 index 0000000000000000000000000000000000000000..caa928c7303cfbfff5429e2ffc815b7378c9f024 GIT binary patch literal 9320 zcmd6s%TE(g6vl7MLnII(F~-=EjL`)K3sY38f{Kb8iH5|5iI5;*)y7vvc|=V_bf;V6 z&V?J7vL(@tD-*Z=0Vci@{{wYV&)0Tl&dgk9Zs$>Y$<6e^{pOqBeCM=W+B-Yjp9vw( zjr8qG(6Lk9n8!Y?rRqdx3An;x~Ju|3;FrQ!dzaPn3=nwW%p~d3x%6kwA_%M z70n_e#ujcB=Vppp@5RD={@(SO`5XJR!G8MDdKb&bjGnoc%N@Eps~_G+=fc3bao$HX z|IjRzgh+~BF*VgcRV)&_oZqQ&{p+{PUiuBpv?#tAFny$ifDe&`53ze|cQPTim#+aD6L^sZt_2!8J;tD>3L;xPo^GzJBc+iF9Y;CCSAeKcjom}xvnPQ zMP{XZO`FUomH+jP>{%mTKE)j^&div6h@N8@UU-h}`RU4yo4nQYbGPR^%MaHu?{_sn z9phF-RLmKkcz&Q~tx|s6R;2lXo>gC6D<4eWf%z~E37=;BO;g|_(^KT* zksspYuo4@e2bXO5kzJ3KAL?R!$oN2yp1xAgvsln?a6<_8)&T{C7{@E+#sKa&hi`Js#t^n%ux zosU<3Tvi%^&$vk1Z(6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&~vS?C?9KnsFj}KbEa#2to?^t$&JsQ2kG)NZ{Y(y*Zg2?*q^QWp;lNv(DSXY zw0wg53t-~zf3o9a%@4KG_7c2^&pLa-=gl1RbNBC5`Jq-=KG5^c4>V-`Sx-vECN;VI zK+mdTOyq!pGA^nCe1L&zsFsmbwyUN(FT{bwLyr5E@lCN=ZrW6qCcel?5y zY+uecKhSf{55|hFU&8!A&$qthd}Q;h+3_*tM>v1jZ9bCu)$I5f`j3#$o$m%;Ci!`5 zr@h``RJ^_g8l*oHjrjNPvh^*{BlX4U;SPaapMbGpeHrqTw8Hl17$5T8o--e!k>I06 zqZ`+sV|+M0hzR%?^3#{FBH^?6g2VcayZ=V=Lp0)i^i4-}c|zOMTniiSS)oVr!|8S8 zgR!FgB(1c)EX2H!`a1sNNc#0ZF+N0t;nUxG^VS2GpBNubPsqoRAI&FbB{x3zPCiZh z4|hDN*0(^9nqB~l%IqZ zHa}hFgY|XR{A9<+aQ~zGbIeL^e7@bzHb2mF%@4+g{nnv*SBQB=h66(G(U+&CEWELdan7w*swpF@{_Q_<_CJd^_7;-9JvX~myb0+)Jo6r zp^HlLs0xnR#-mJ3-fdT$R7^#htMeNW5%xke;m<>&yVe1ROzA;Ex7uMI}_$i0`=O`bl5x;*PoR!S4M)|OM QxI19)pQC&X`RTyte^*jDZvX%Q literal 0 HcmV?d00001 From 54897d9a5a67b9de25a150b7558fc7726bd4fe9a Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 12 Dec 2016 14:06:45 -0600 Subject: [PATCH 2/2] Multiple changes of datatypes being past overflowing constants (most char needed to be changed to unsigned char or uint8_t). Also changed the include style of the to be controlled through the makefile setting --- makefile | 7 +++-- src/classes/Keyboard.cpp | 59 ++++++++++++++++++++++++---------------- src/classes/Keyboard.h | 12 ++++---- 3 files changed, 45 insertions(+), 33 deletions(-) diff --git a/makefile b/makefile index 6a24c9b..24826e8 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,6 @@ CC=g++ CFLAGS=-Wall -O2 -std=gnu++11 +LIBUSB_INC?=-I/usr/include/libusb-1.0 LDFLAGS=-lusb-1.0 PROGN=g810-led @@ -7,11 +8,11 @@ PROGN=g810-led all: bin/$(PROGN) -bin/$(PROGN): src/main.cpp src/classes/*.cpp +bin/$(PROGN): src/main.cpp src/classes/*.cpp src/classes/*.h @mkdir -p bin - $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) + $(CC) $(CFLAGS) $(LIBUSB_INC) -o $@ $^ $(LDFLAGS) -debug: CFLAGS += -g +debug: CFLAGS += -g -Wextra -pedantic debug: bin/$(PROGN) clean: diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index 5544788..f2400a5 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -21,7 +21,20 @@ bool Keyboard::attach() { int pid = 0; for(ssize_t i = 0; i < cnt; i++) { libusb_device *device = devs[i]; - libusb_device_descriptor desc = {0}; + libusb_device_descriptor desc = {0, // bLength + 0, // bDescriptorType + 0, // bcdUSB + 0, // bDeviceClass + 0, // bDeviceSubClass + 0, // bDeviceProtocol + 0, // bMaxPacketSize0 + 0, // idVendor + 0, // idProduct + 0, // bcdDevice + 0, // iManufacturer + 0, // iProduct + 0, // iSerialNumber + 0}; // bNumConfigurations libusb_get_device_descriptor(device, &desc); if (desc.idVendor == 0x046d) { if (desc.idProduct == 0xc331) { pid = desc.idProduct; break; } // G810 spectrum @@ -476,7 +489,7 @@ bool Keyboard::parseColor(std::string color, KeyColors &colors) { return true; } -bool Keyboard::sendDataInternal(unsigned char *data, int data_size) { +bool Keyboard::sendDataInternal(unsigned char *data, uint16_t data_size) { if (m_isAttached == false) return false; int r; if (data_size > 20) r = libusb_control_transfer(dev_handle, 0x21, 0x09, 0x0212, 1, data, data_size, 2000); @@ -589,17 +602,15 @@ bool Keyboard::populateAddressGroupInternal(KeyAddressGroup addressGroup, unsign return true; } -bool Keyboard::setKeysInternal(KeyAddressGroup addressGroup, KeyValue keyValues[], int keyValueCount) { +bool Keyboard::setKeysInternal(KeyAddressGroup addressGroup, KeyValue keyValues[], size_t keyValueCount) { bool retval = false; - unsigned char *data; int data_size; - int maxKeyValueCount = 0; if (addressGroup == KeyAddressGroup::logo) data_size = 20; else data_size = 64; - data = new unsigned char[data_size]; + unsigned char *data = new unsigned char[data_size]; + const size_t maxKeyValueCount = (data_size - 8) / 4; populateAddressGroupInternal(addressGroup, data); - maxKeyValueCount = (data_size - 8) / 4; - for(int i = 0; i < maxKeyValueCount; i++) { + for(size_t i = 0; i < maxKeyValueCount; i++) { if (i < keyValueCount) { data[8 + i * 4 + 0] = keyValues[i].key.id; data[8 + i * 4 + 1] = keyValues[i].colors.red; @@ -671,24 +682,24 @@ bool Keyboard::setKey(Key key, KeyColors colors) { return setKey(keyValue); } -bool Keyboard::setKeys(KeyValue keyValue[], int keyValueCount) { - int maxLogoKeys = 5; - int logoCount = 0; +bool Keyboard::setKeys(KeyValue keyValue[], size_t keyValueCount) { + const size_t maxLogoKeys = 5; + const size_t maxIndicatorsKeys = 25; + const size_t maxMultimediaKeys = 25; + const size_t maxKeys = 200; + const size_t maxGKeys = 25; + size_t logoCount = 0; + size_t indicatorsCount = 0; + size_t multimediaCount = 0; + size_t keysCount = 0; + size_t gkeysCount = 0; KeyValue logo[maxLogoKeys]; - int maxIndicatorsKeys = 25; - int indicatorsCount = 0; KeyValue indicators[maxIndicatorsKeys]; - int maxMultimediaKeys = 25; - int multimediaCount = 0; KeyValue multimedia[maxMultimediaKeys]; - int maxKeys = 200; - int keysCount = 0; KeyValue keys[maxKeys]; - int maxGKeys = 25; - int gkeysCount = 0; KeyValue gkeys[maxGKeys]; - for (int i = 0; i < keyValueCount; i++) { + for (size_t i = 0; i < keyValueCount; i++) { if(keyValue[i].key.addressGroup == KeyAddressGroup::logo && logoCount <= maxLogoKeys) { logo[logoCount] = keyValue[i]; logoCount++; @@ -714,11 +725,11 @@ bool Keyboard::setKeys(KeyValue keyValue[], int keyValueCount) { if (multimediaCount > 0) setKeysInternal(KeyAddressGroup::multimedia, multimedia, multimediaCount); if (keysCount > 0) { - int maxKeyValueCount = 14; - for (int i = 0; i < keysCount; i = i + maxKeyValueCount) { + const size_t maxKeyValueCount = 14; + for (size_t i = 0; i < keysCount; i = i + maxKeyValueCount) { KeyValue keysBlock[maxKeyValueCount]; - int keysBlockCount = 0; - for (int j = 0; j < maxKeyValueCount; j++) { + size_t keysBlockCount = 0; + for (size_t j = 0; j < maxKeyValueCount; j++) { if((i + j) < keysCount ) { keysBlock[j] = keys[i + j]; keysBlockCount++; diff --git a/src/classes/Keyboard.h b/src/classes/Keyboard.h index aa0f60f..a2b563e 100644 --- a/src/classes/Keyboard.h +++ b/src/classes/Keyboard.h @@ -2,7 +2,7 @@ #define DEF_KEYBOARD #include -#include "/usr/include/libusb-1.0/libusb.h" +#include class Keyboard { @@ -32,8 +32,8 @@ class Keyboard { }; enum class KeyGroup { logo, indicators, multimedia, fkeys, modifiers, arrows, numeric, functions, keys, gkeys}; - struct KeyColors { char red; char green; char blue; }; - struct KeyAddress { KeyAddressGroup addressGroup; char id; }; + struct KeyColors { uint8_t red; uint8_t green; uint8_t blue; }; + struct KeyAddress { KeyAddressGroup addressGroup; uint8_t id; }; struct KeyValue { KeyAddress key; KeyColors colors; }; bool isAttached(); @@ -48,7 +48,7 @@ class Keyboard { bool setPowerOnEffect(PowerOnEffect powerOnEffect); bool setKey(KeyValue keyValue); bool setKey(Key key, KeyColors colors); - bool setKeys(KeyValue keyValue[], int keyValueCount); + bool setKeys(KeyValue keyValue[], size_t keyValueCount); bool setAllKeys(KeyColors colors); bool setGroupKeys(KeyGroup keyGroup, KeyColors colors); @@ -63,8 +63,8 @@ class Keyboard { libusb_context *ctx = NULL; bool populateAddressGroupInternal(KeyAddressGroup addressGroup, unsigned char *data); - bool sendDataInternal(unsigned char *data, int data_size); - bool setKeysInternal(KeyAddressGroup addressGroup, KeyValue keyValues[], int keyValueCount); + bool sendDataInternal(unsigned char *data, uint16_t data_size); + bool setKeysInternal(KeyAddressGroup addressGroup, KeyValue keyValues[], size_t keyValueCount); };