Skip to content

Commit

Permalink
add support for KBP V60 Mini to pok3rtool (same protocol as pok3r)
Browse files Browse the repository at this point in the history
closes #4
  • Loading branch information
ChaoticEnigma committed Apr 25, 2017
1 parent 21043a4 commit 10da6d1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
48 changes: 27 additions & 21 deletions pok3rtool/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,31 @@ struct VortexDevice {
};

const ZArray<VortexDevice> devices = {
{ 1, "POK3R", HOLTEK_VID, POK3R_PID, POK3R_BOOT_PID, PROTO_POK3R },
{ 2, "POK3R RGB", HOLTEK_VID, POK3R_RGB_PID, POK3R_RGB_BOOT_PID, PROTO_CYKB },
{ 4, "Vortex Core", HOLTEK_VID, VORTEX_CORE_PID, VORTEX_CORE_BOOT_PID, PROTO_CYKB },
{ 8, "Vortex Tester", HOLTEK_VID, VORTEX_TESTER_PID, VORTEX_TESTER_BOOT_PID, PROTO_CYKB },
{ 1, "POK3R", HOLTEK_VID, POK3R_PID, POK3R_BOOT_PID, PROTO_POK3R },
{ 2, "POK3R RGB", HOLTEK_VID, POK3R_RGB_PID, POK3R_RGB_BOOT_PID, PROTO_CYKB },
{ 4, "Vortex Core", HOLTEK_VID, VORTEX_CORE_PID, VORTEX_CORE_BOOT_PID, PROTO_CYKB },
{ 8, "Vortex Tester", HOLTEK_VID, VORTEX_TESTER_PID, VORTEX_TESTER_BOOT_PID, PROTO_CYKB },
{ 16, "KBP V60", HOLTEK_VID, KBP_V60_PID, KBP_V60_BOOT_PID, PROTO_POK3R },
};

const ZMap<ZString, int> devnames = {
{ "pok3r", 1 },

{ "pok3r-rgb", 2 },
{ "pok3r_rgb", 2 },

{ "core", 4 },
{ "vortex-core", 4 },
{ "vortex_core", 4 },

{ "tester", 8 },
{ "vortex-tester", 8 },
{ "vortex_tester", 8 },

{ "kbp60", 16 },
{ "kbpv60", 16 },
{ "v60mini", 16 },
{ "kbpv60mini", 16 },
};

ZPointer<UpdateInterface> openDevice(int device){
Expand Down Expand Up @@ -591,8 +612,8 @@ int cmd_decode(Param *param){
#define OPT_TYPE "device"

const ZArray<ZOptions::OptDef> optdef = {
{ OPT_OK, 0, ZOptions::NONE },
{ OPT_TYPE, 't', ZOptions::STRING },
{ OPT_OK, 0, ZOptions::NONE },
{ OPT_TYPE, 't', ZOptions::STRING },
};

typedef int (*cmd_func)(Param *);
Expand All @@ -614,21 +635,6 @@ const ZMap<ZString, CmdEntry> cmds = {
{ "decode", { cmd_decode, 2, "pok3rtool decode <path to updater> <output file>" } },
};

const ZMap<ZString, int> devnames = {
{ "pok3r", 1 },

{ "pok3r-rgb", 2 },
{ "pok3r_rgb", 2 },

{ "core", 4 },
{ "vortex-core", 4 },
{ "vortex_core", 4 },

{ "tester", 8 },
{ "vortex-tester", 8 },
{ "vortex_tester", 8 },
};

int main(int argc, char **argv){
ZLog::logLevelStdOut(ZLog::INFO, "[%clock%] N %log%");
// ZLog::logLevelStdOut(ZLog::DEBUG, "\x1b[35m[%clock%] %thread% N %log%\x1b[m");
Expand Down
3 changes: 3 additions & 0 deletions pok3rtool/proto_pok3r.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ using namespace LibChaos;
#define POK3R_PID 0x0141
#define POK3R_BOOT_PID 0x1141

#define KBP_V60_PID 0x0112
#define KBP_V60_BOOT_PID 0x1112

class ProtoPOK3R : public UpdateInterface {
public:
enum pok3r_cmd {
Expand Down

0 comments on commit 10da6d1

Please sign in to comment.