First, thank you very much @Joseph_Heck and @mayoff for your replies.
Sorry for the delay and the incomplete information in my previous posts.
I will try to be more clear.
In my app, I am using the CoreBluetooth framework to connect to a specific peripheral.
The steps are the following:
I connect with the desired Peripheral
I filter (of all the Services offered by the Peripheral) the specific Service I want to use
Finally, within that Service, I filter for the specific Characteristic I want to use (a Service can offer more than one Characteristic)
Up to this point, I don't use Combine.
The object I get is of this type:
(CBService, [CBCharacteristic])
Where the 1st item of the tuple represents the Service in question
And the 2nd item represents all the Characteristics associated with that service
In the specific case of my project, I know that I will always obtain 3 Characteristics associated with the Service that I am going to use
So what I get is:
(SERVICE, [CHARACTERISTIC_1, CHARACTERISTIC_2, CHARACTERISTIC_3])
From now on I use Combine to send this information via the .send method to this Subject:
var characteristicsSubject: PassthroughSubject<(CBService, [CBCharacteristic]), Never>
Once the var characteristicsSubject is populated, my intention is that ONLY the desired Characteristic reaches the Subscriber.
So, the starting point of the Pipeline is:
SUBJECT
<(CBService, [CBCharacteristic]), Never>
OPERATORS
Intermediate operations to do this can be: (if I'm not doing something wrong)
- I get the 2nd element of the tuple (the Characteristic array)
- I get from this array the desired Characteristic (using its UUID)
SUBSCRIBER
And the final result should be:
<CBCharacteristic, Never>