@@ -11,17 +11,22 @@ static char doc[] = "Send a PS4 wakeup packet.";
11
11
12
12
#define ARG_KEY_HOST 'h'
13
13
#define ARG_KEY_REGISTKEY 'r'
14
+ #define ARG_KEY_PS4 '4'
15
+ #define ARG_KEY_PS5 '5'
14
16
15
17
static struct argp_option options [] = {
16
18
{ "host" , ARG_KEY_HOST , "Host" , 0 , "Host to send wakeup packet to" , 0 },
17
- { "registkey" , ARG_KEY_REGISTKEY , "RegistKey" , 0 , "PS4 registration key" , 0 },
19
+ { "registkey" , ARG_KEY_REGISTKEY , "RegistKey" , 0 , "Remote Play registration key (plaintext)" , 0 },
20
+ { "ps4" , ARG_KEY_PS4 , NULL , 0 , "PlayStation 4" , 0 },
21
+ { "ps5" , ARG_KEY_PS5 , NULL , 0 , "PlayStation 5 (default)" , 0 },
18
22
{ 0 }
19
23
};
20
24
21
25
typedef struct arguments
22
26
{
23
27
const char * host ;
24
28
const char * registkey ;
29
+ bool ps5 ;
25
30
} Arguments ;
26
31
27
32
static int parse_opt (int key , char * arg , struct argp_state * state )
@@ -39,6 +44,12 @@ static int parse_opt(int key, char *arg, struct argp_state *state)
39
44
case ARGP_KEY_ARG :
40
45
argp_usage (state );
41
46
break ;
47
+ case ARG_KEY_PS4 :
48
+ arguments -> ps5 = false;
49
+ break ;
50
+ case ARG_KEY_PS5 :
51
+ arguments -> ps5 = true;
52
+ break ;
42
53
default :
43
54
return ARGP_ERR_UNKNOWN ;
44
55
}
@@ -51,6 +62,7 @@ static struct argp argp = { options, parse_opt, 0, doc, 0, 0, 0 };
51
62
CHIAKI_EXPORT int chiaki_cli_cmd_wakeup (ChiakiLog * log , int argc , char * argv [])
52
63
{
53
64
Arguments arguments = { 0 };
65
+ arguments .ps5 = true;
54
66
error_t argp_r = argp_parse (& argp , argc , argv , ARGP_IN_ORDER , NULL , & arguments );
55
67
if (argp_r != 0 )
56
68
return 1 ;
@@ -73,5 +85,5 @@ CHIAKI_EXPORT int chiaki_cli_cmd_wakeup(ChiakiLog *log, int argc, char *argv[])
73
85
74
86
uint64_t credential = (uint64_t )strtoull (arguments .registkey , NULL , 16 );
75
87
76
- return chiaki_discovery_wakeup (log , NULL , arguments .host , credential , false );
88
+ return chiaki_discovery_wakeup (log , NULL , arguments .host , credential , arguments . ps5 );
77
89
}
0 commit comments