summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Elias <francois.elias@livio.io>2021-08-27 12:08:44 -0400
committerFrank Elias <francois.elias@livio.io>2021-08-27 12:08:44 -0400
commitc9414ca66b3c08b5e2b3a332c80c155a8fb01213 (patch)
tree8a04251648302198616ba9fbcbd07f2cbf5ef38c
parent25da2498bb782ddf443cef27a9e4571bdb45dcd4 (diff)
downloadsdl_ios-c9414ca66b3c08b5e2b3a332c80c155a8fb01213.tar.gz
SDLSecurityQueryPayload description update
-rw-r--r--SmartDeviceLink/private/SDLSecurityQueryPayload.h2
-rw-r--r--SmartDeviceLink/private/SDLSecurityQueryPayload.m34
2 files changed, 34 insertions, 2 deletions
diff --git a/SmartDeviceLink/private/SDLSecurityQueryPayload.h b/SmartDeviceLink/private/SDLSecurityQueryPayload.h
index ac5dd34dc..3c053764c 100644
--- a/SmartDeviceLink/private/SDLSecurityQueryPayload.h
+++ b/SmartDeviceLink/private/SDLSecurityQueryPayload.h
@@ -27,7 +27,7 @@ typedef NS_ENUM(NSUInteger, SDLSecurityQueryId) {
SDLSecurityQueryIdSendHandshake = 0x000001,
/// Send internal error
- SDLSecurityQueryIdSendInternalError = 0x000002,
+ SDLSecurityQueryIdSendInternalError = 0x000002
};
NS_ASSUME_NONNULL_BEGIN
diff --git a/SmartDeviceLink/private/SDLSecurityQueryPayload.m b/SmartDeviceLink/private/SDLSecurityQueryPayload.m
index e80798511..37660264f 100644
--- a/SmartDeviceLink/private/SDLSecurityQueryPayload.m
+++ b/SmartDeviceLink/private/SDLSecurityQueryPayload.m
@@ -113,7 +113,39 @@ NS_ASSUME_NONNULL_BEGIN
}
- (NSString *)description {
- return [NSString stringWithFormat:@"Security Query Header: queryType:%i, queryID:%lu, sequenceNumber:%lu, json:%lu bytes, binary:%lu bytes", self.queryType, (unsigned long)self.queryID, (unsigned long)self.sequenceNumber, (NSUInteger)self.jsonData.length, (NSUInteger)self.binaryData.length];
+ return [NSString stringWithFormat:@"Security Query Header: %@, %@, sequenceNumber: %lu, json size: %lu bytes, binary size: %lu bytes", [self descriptionForQueryID], [self descriptionForQueryType], (unsigned long)self.sequenceNumber, (unsigned long)self.jsonData.length, (unsigned long)self.binaryData.length];
+}
+
+- (NSString *)descriptionForQueryID {
+ NSString *queryIdDescription;
+ switch (self.queryID) {
+ case SDLSecurityQueryIdSendHandshake:
+ queryIdDescription = @"Send Handshake Data";
+ case SDLSecurityQueryIdSendInternalError:
+ queryIdDescription = @"Send Internal Error";
+ case 0xFFFFFF:
+ queryIdDescription = @"Invalid Query ID";
+ default:
+ queryIdDescription = @"Unknown Query ID";
+ }
+ return [NSString stringWithFormat:@"queryID: %lu - %@", (unsigned long)self.queryID, queryIdDescription];
+}
+
+- (NSString *)descriptionForQueryType {
+ NSString *queryTypeDescription;
+ switch (self.queryType) {
+ case SDLSecurityQueryTypeRequest:
+ queryTypeDescription = @"Request";
+ case SDLSecurityQueryTypeResponse:
+ queryTypeDescription = @"Response";
+ case SDLSecurityQueryTypeNotification:
+ queryTypeDescription = @"Notification";
+ case 0xFF:
+ queryTypeDescription = @"Invalid Query Type";
+ default:
+ queryTypeDescription = @"Unknown Query Type";
+ }
+ return [NSString stringWithFormat:@"queryType: %lu - %@", (unsigned long)self.queryType, queryTypeDescription];
}
@end