summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-07-31 16:47:35 -0400
committerJoel Fischer <joeljfischer@gmail.com>2017-07-31 16:47:35 -0400
commit10534de8d4d2b041af9b6e4ae470a02a35082203 (patch)
tree3db8a60a33946af9f6bc3d556382a75c0d553b97
parentd66d6e5833076fec3c3b17a574e76115a04896ef (diff)
downloadsdl_ios-10534de8d4d2b041af9b6e4ae470a02a35082203.tar.gz
Remove hash id from not RPC start service acks
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h5
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m15
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h5
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m15
4 files changed, 9 insertions, 31 deletions
diff --git a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h
index eb54abaa0..9a9dc95f4 100644
--- a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h
+++ b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h
@@ -14,13 +14,10 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLControlFramePayloadAudioStartServiceAck : NSObject <SDLControlFramePayloadType>
-/// Hash ID to identify this service and used when sending an EndService control frame
-@property (assign, nonatomic, readonly) int32_t hashId;
-
/// Max transport unit to be used for this service. If not included the client should use the one set via the RPC service or protocol version default.
@property (assign, nonatomic, readonly) int64_t mtu;
-- (instancetype)initWithHashId:(int32_t)hashId mtu:(int64_t)mtu;
+- (instancetype)initWithMTU:(int64_t)mtu;
@end
diff --git a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m
index 240f65566..44db4d33b 100644
--- a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m
+++ b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m
@@ -16,7 +16,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLControlFramePayloadAudioStartServiceAck ()
-@property (assign, nonatomic, readwrite) int32_t hashId;
@property (assign, nonatomic, readwrite) int64_t mtu;
@property (copy, nonatomic, readwrite, nullable) NSString *protocolVersion;
@@ -24,11 +23,10 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLControlFramePayloadAudioStartServiceAck
-- (instancetype)initWithHashId:(int32_t)hashId mtu:(int64_t)mtu {
+- (instancetype)initWithMTU:(int64_t)mtu {
self = [super init];
if (!self) return nil;
- _hashId = hashId;
_mtu = mtu;
return self;
@@ -38,7 +36,6 @@ NS_ASSUME_NONNULL_BEGIN
self = [super init];
if (!self) return nil;
- _hashId = SDLControlFrameInt32NotFound;
_mtu = SDLControlFrameInt64NotFound;
if (data != nil) {
@@ -49,18 +46,13 @@ NS_ASSUME_NONNULL_BEGIN
}
- (nullable NSData *)data {
- if (self.hashId == SDLControlFrameInt32NotFound
- && self.mtu == SDLControlFrameInt64NotFound) {
+ if (self.mtu == SDLControlFrameInt64NotFound) {
return nil;
}
BsonObject payloadObject;
bson_object_initialize_default(&payloadObject);
- if (self.hashId != SDLControlFrameInt32NotFound) {
- bson_object_put_int32(&payloadObject, SDLControlFrameHashIdKey, self.hashId);
- }
-
if (self.mtu != SDLControlFrameInt64NotFound) {
bson_object_put_int64(&payloadObject, SDLControlFrameMTUKey, self.mtu);
}
@@ -76,14 +68,13 @@ NS_ASSUME_NONNULL_BEGIN
- (void)sdl_parse:(NSData *)data {
BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
- self.hashId = bson_object_get_int32(&payloadObject, SDLControlFrameHashIdKey);
self.mtu = bson_object_get_int64(&payloadObject, SDLControlFrameMTUKey);
bson_object_deinitialize(&payloadObject);
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@>: hash id: %d, mtu: %lld", NSStringFromClass(self.class), self.hashId, self.mtu];
+ return [NSString stringWithFormat:@"<%@>: MTU: %lld", NSStringFromClass(self.class), self.mtu];
}
@end
diff --git a/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h
index a42aba2ee..68d39d6a6 100644
--- a/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h
+++ b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h
@@ -13,9 +13,6 @@
@interface SDLControlFramePayloadVideoStartServiceAck : NSObject <SDLControlFramePayloadType>
-/// Hash ID to identify this service and used when sending an EndService control frame
-@property (assign, nonatomic, readonly) int32_t hashId;
-
/// Max transport unit to be used for this service
@property (assign, nonatomic, readonly) int64_t mtu;
@@ -31,4 +28,6 @@
/// Accepted video codec to be used. See VideoStreamingCodec RPC
@property (copy, nonatomic, readonly) NSString *videoCodec;
+- (instancetype)initWithMTU:(int64_t)mtu videoHeight:(int32_t)height width:(int32_t)width protocol:(NSString *)protocol codec:(NSString *)codec;
+
@end
diff --git a/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m
index 4aeed4a1a..e26d310a6 100644
--- a/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m
+++ b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m
@@ -14,7 +14,6 @@
@interface SDLControlFramePayloadVideoStartServiceAck ()
-@property (assign, nonatomic, readwrite) int32_t hashId;
@property (assign, nonatomic, readwrite) int64_t mtu;
@property (assign, nonatomic, readwrite) int32_t height;
@property (assign, nonatomic, readwrite) int32_t width;
@@ -25,11 +24,10 @@
@implementation SDLControlFramePayloadVideoStartServiceAck
-- (instancetype)initWithHashId:(int32_t)hashId mtu:(int64_t)mtu videoHeight:(int32_t)height width:(int32_t)width protocol:(NSString *)protocol codec:(NSString *)codec {
+- (instancetype)initWithMTU:(int64_t)mtu videoHeight:(int32_t)height width:(int32_t)width protocol:(NSString *)protocol codec:(NSString *)codec {
self = [super init];
if (!self) return nil;
- _hashId = hashId;
_mtu = mtu;
_height = height;
_width = width;
@@ -43,7 +41,6 @@
self = [super init];
if (!self) return nil;
- _hashId = SDLControlFrameInt32NotFound;
_mtu = SDLControlFrameInt64NotFound;
_height = SDLControlFrameInt32NotFound;
_width = SDLControlFrameInt32NotFound;
@@ -56,8 +53,7 @@
}
- (nullable NSData *)data {
- if (self.hashId == SDLControlFrameInt32NotFound
- && self.mtu == SDLControlFrameInt64NotFound
+ if (self.mtu == SDLControlFrameInt64NotFound
&& self.height == SDLControlFrameInt32NotFound
&& self.width == SDLControlFrameInt32NotFound
&& self.videoProtocol == nil
@@ -68,10 +64,6 @@
BsonObject payloadObject;
bson_object_initialize_default(&payloadObject);
- if (self.hashId != SDLControlFrameInt32NotFound) {
- bson_object_put_int32(&payloadObject, SDLControlFrameHashIdKey, self.hashId);
- }
-
if (self.mtu != SDLControlFrameInt64NotFound) {
bson_object_put_int64(&payloadObject, SDLControlFrameMTUKey, self.mtu);
}
@@ -103,7 +95,6 @@
- (void)sdl_parse:(NSData *)data {
BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
- self.hashId = bson_object_get_int32(&payloadObject, SDLControlFrameHashIdKey);
self.mtu = bson_object_get_int64(&payloadObject, SDLControlFrameMTUKey);
self.height = bson_object_get_int32(&payloadObject, SDLControlFrameHeightKey);
self.width = bson_object_get_int32(&payloadObject, SDLControlFrameWidthKey);
@@ -122,7 +113,7 @@
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@>: Hash Id: %d, MTU: %lld, Width: %d, Height: %d, Protocol: %@, Codec: %@", NSStringFromClass(self.class), self.hashId, self.mtu, self.width, self.height, self.videoProtocol, self.videoCodec];
+ return [NSString stringWithFormat:@"<%@>: MTU: %lld, Width: %d, Height: %d, Protocol: %@, Codec: %@", NSStringFromClass(self.class), self.mtu, self.width, self.height, self.videoProtocol, self.videoCodec];
}
@end