Skip to content

Commit

Permalink
Fix: omitting important keys from PS4 Second Screen query response
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
dhleong committed Apr 15, 2021
1 parent 321f150 commit fd0bacc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/credentials/mim-requester.ts
Expand Up @@ -66,7 +66,7 @@ export class MimCredentialRequester implements ICredentialRequester {
this.io?.logInfo("Open the PS4 Second Screen app and attempt to connect to the device named:");
this.io?.logInfo(` ${this.emulatorOptions.hostName}`);

debug("emulating device; awaiting WAKE...");
debug("emulating device", this.emulatorOptions, "awaiting WAKE...");
return this.emulateUntilWoken(
sink,
network,
Expand All @@ -85,8 +85,8 @@ export class MimCredentialRequester implements ICredentialRequester {
const searchResponse = {
"host-id": this.emulatorOptions.hostId,
"host-name": this.emulatorOptions.hostName,
"host-type": hostType,
"host-request-port": localBindPort,
"host-type": hostType,
};

for await (const message of incomingMessages) {
Expand Down
5 changes: 3 additions & 2 deletions src/discovery/model.ts
Expand Up @@ -37,9 +37,9 @@ export interface IDeviceAddress {

const discoveryKeysArrray = [
"host-id",
"host-type",
"host-request-port",
"host-name",
"host-request-port",
"host-type",
"system-version",
"device-discovery-protocol-version",
] as const;
Expand All @@ -49,6 +49,7 @@ export type DiscoveryKey = typeof discoveryKeysArrray[number];
const discoveryKeys: Set<string> = new Set(discoveryKeysArrray);

export const outgoingDiscoveryKeys = new Set([
...discoveryKeysArrray,
"app-type",
"auth-type",
"client-type",
Expand Down
2 changes: 1 addition & 1 deletion src/discovery/udp.ts
Expand Up @@ -104,7 +104,7 @@ export class UdpDiscoveryNetwork implements IDiscoveryNetwork {
message: Buffer,
) {
debug(
"send:", message, " to ",
"send:", message.toString("hex"), " to ",
recipientAddress, ":", recipientPort,
);
this.socket.send(message, recipientPort, recipientAddress);
Expand Down

0 comments on commit fd0bacc

Please sign in to comment.