Re: BLE central device as GATT server
Re: BLE central device as GATT server
- Subject: Re: BLE central device as GATT server
- From: John Earl <email@hidden>
- Date: Mon, 11 Nov 2013 12:31:30 +0000
On 11 Nov 2013, at 11:50, Walter Stephan <email@hidden> wrote:
>> Instantiate the two managers and use them as you wish. They are happy
>> to live together in one device. :)
>
> Just so I'm understanding correctly --
>
> I should use the CBPeripheralManager without starting advertising, and I can define services in the CBPeripheralManager, and the central will publish these services?
>
No. The Peripheral manager is for advertising from the phone as a peripheral. The central manager is for scanning for and connecting to other devices that are advertising as peripherals. The central manager does not publish the services; the peripheral manager does.
> The CBPeripheralManager documentation states:
>
> "While a service is in the database, it is visible to, and can be accessed by, any connected central."
>
> What you're saying is this should really read:
>
> "While a service is in the database, it is visible to, and can be accessed by, any connected central OR PERIPHERAL."
>
No. While a service is in the database, any connected central can access, but it doesn't make sense for another peripheral to access. One way of thinking of this for those more used to HTTP is that central = client, peripheral = server. Servers do not connect to each other; servers listen and clients connect to them. However, the same device (the iPhone) can run both a client and a server at the same time.
> Best regards,
> --Stephan Walter
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Bluetooth-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden