Skip to content

Commit

Permalink
Format / address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ksperling-apple committed Dec 14, 2022
1 parent 47c7a3a commit f002dec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ - (void)onPairingComplete:(NSError * _Nullable)error
} else {
MTRDeviceController * controller = InitializeMTR();
uint64_t deviceId = MTRGetLastPairedDeviceId();
MTRBaseDevice *device = [controller deviceBeingCommissionedWithNodeID:@(deviceId) error:NULL];
MTRBaseDevice * device = [controller deviceBeingCommissionedWithNodeID:@(deviceId) error:NULL];
if (device.sessionTransportType == MTRTransportTypeBLE) {
dispatch_async(dispatch_get_main_queue(), ^{
[self->_deviceList refreshDeviceList];
Expand Down
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/MTRBaseDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ typedef NS_ENUM(uint8_t, MTRTransportType) {
MTRTransportTypeUDP,
MTRTransportTypeBLE,
MTRTransportTypeTCP,
};
} MTR_NEWLY_AVAILABLE;

@interface MTRBaseDevice : NSObject

Expand All @@ -146,7 +146,7 @@ typedef NS_ENUM(uint8_t, MTRTransportType) {
* The transport used by the current session with this device, or
* `MTRTransportTypeUndefined` if no session is currently active.
*/
@property (readonly) MTRTransportType sessionTransportType;
@property (readonly) MTRTransportType sessionTransportType MTR_NEWLY_AVAILABLE;

/**
* Subscribe to receive attribute reports for everything (all endpoints, all
Expand Down
14 changes: 6 additions & 8 deletions src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@

NS_ASSUME_NONNULL_BEGIN

static inline MTRTransportType MTRMakeTransportType(chip::Transport::Type type) {
static_assert(MTRTransportTypeUndefined == (uint8_t)chip::Transport::Type::kUndefined, "MTRTransportType != Transport::Type");
static_assert(MTRTransportTypeUDP == (uint8_t)chip::Transport::Type::kUdp, "MTRTransportType != Transport::Type");
static_assert(MTRTransportTypeBLE == (uint8_t)chip::Transport::Type::kBle, "MTRTransportType != Transport::Type");
static_assert(MTRTransportTypeTCP == (uint8_t)chip::Transport::Type::kTcp, "MTRTransportType != Transport::Type");
static inline MTRTransportType MTRMakeTransportType(chip::Transport::Type type)
{
static_assert(MTRTransportTypeUndefined == (uint8_t) chip::Transport::Type::kUndefined, "MTRTransportType != Transport::Type");
static_assert(MTRTransportTypeUDP == (uint8_t) chip::Transport::Type::kUdp, "MTRTransportType != Transport::Type");
static_assert(MTRTransportTypeBLE == (uint8_t) chip::Transport::Type::kBle, "MTRTransportType != Transport::Type");
static_assert(MTRTransportTypeTCP == (uint8_t) chip::Transport::Type::kTcp, "MTRTransportType != Transport::Type");
return static_cast<MTRTransportType>(type);
}

Expand Down Expand Up @@ -63,9 +64,6 @@ static inline MTRTransportType MTRMakeTransportType(chip::Transport::Type type)
*/
@property (nonatomic, assign, readonly) chip::NodeId nodeID;

- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

/**
* Initialize the device object as a CASE device with the given node id and
* controller. This will always succeed, even if there is no such node id on
Expand Down

0 comments on commit f002dec

Please sign in to comment.