Skip to content

Feature request: expose peer address from ECMA-419 GATTServerConnection #1625

@stc1988

Description

@stc1988

I'm trying to porting the Apple Media Service (AMS) client flow from the legacy BLE API to the ECMA-419 BLE APIs:

The legacy AMS implementation uses this flow:

class AMSAuthenticator extends BLEServer {
	onConnected(device) {
		this.device = device;
		this.stopAdvertising();
	}

	onAuthenticated() {
		this.client.onAuthenticated(this.device);
	}
}

class AMSClient extends BLEClient {
	constructor(device) {
		super();
		this.device = device;
	}

	onSecurityParameters() {
		this.connect(this.device);
	}
}

In other words, the accessory advertises the AMS solicitation UUID, iOS connects to the accessory, and after authentication the client side connects to the same peer device to discover the AMS service.

With the ECMA-419 APIs, GATTServer.onConnect(connection) receives a GATTServerConnection, but it does not appear to expose the peer address. GATTClient, however, requires an address option:

new GATTClient({ address, ... })

This makes it difficult to reproduce the legacy AMS flow, because the peripheral-side connection cannot be used to identify the peer for the central-side GATTClient.

Could GATTServerConnection expose the connected peer address, for example:

connection.address

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions