xamarin-macios
xamarin-macios copied to clipboard
Use of Wrap to stub out removed CHIP selectors fails in a few cases due to genererator limitations
In Xcode 14 timeframe the Apple submission tests were updated to include failues:
ChipDeviceController
pairDevice:address:port:discriminator:setupPINCode:error:
setListenPort:
sharedController
ChipLowPower
sleep:
ChipTestCluster
test:
toggle:
ChipGeneralCommissioning
commissioningComplete:
While many of them could be hacked around by adding this:
[Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromChip) : false", IsVirtual = true)]
There were a few that could not, for unknown reasons (likely generator limitation where Wrap is not respected).
[Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromChip) : false", IsVirtual = true)]
[Export ("updateDevice:fabricId:")]
void UpdateDevice (ulong deviceId, ulong fabricId);
[Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromChip) : false", IsVirtual = true)]
[Export ("pairDevice:onboardingPayload:onboardingPayloadType:error:")]
bool PairDevice (ulong deviceId, string onboardingPayload, ChipOnboardingPayloadType onboardingPayloadType, [NullAllowed] out NSError error);
[Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromChip) : false", IsVirtual = true)]
[Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)]
[Async (ResultTypeName = "ChipReadAttributeResult")]
[Export ("getConnectedDevice:queue:completionHandler:")]
bool GetConnectedDevice (ulong deviceID, DispatchQueue queue, ChipDeviceConnectionCallback completionHandler);
Actually, digging into this most of the APIs in ChipDeviceController won't accept the wrap trick, and I'm not sure why.
I'm going to manually stub out the API surface and give up on wrap here.