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:
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:
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:
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: