summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLV2ProtocolHeader.m
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-09-07 11:06:40 -0400
committerJoel Fischer <joeljfischer@gmail.com>2017-09-07 11:06:40 -0400
commitb9b8ce3d8e69180a38b5617ba61495a726e8047d (patch)
treee6634f6919683b70a691a45ed376362e9f62faa9 /SmartDeviceLink/SDLV2ProtocolHeader.m
parent19ea45635bff99df649b47b22171df0b117cc6fa (diff)
downloadsdl_ios-b9b8ce3d8e69180a38b5617ba61495a726e8047d.tar.gz
Make constants styled correctly
Diffstat (limited to 'SmartDeviceLink/SDLV2ProtocolHeader.m')
-rw-r--r--SmartDeviceLink/SDLV2ProtocolHeader.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/SmartDeviceLink/SDLV2ProtocolHeader.m b/SmartDeviceLink/SDLV2ProtocolHeader.m
index edb6a060e..646c1bee0 100644
--- a/SmartDeviceLink/SDLV2ProtocolHeader.m
+++ b/SmartDeviceLink/SDLV2ProtocolHeader.m
@@ -4,7 +4,7 @@
#import "SDLV2ProtocolHeader.h"
-const int V2PROTOCOL_HEADERSIZE = 12;
+const int ProtocolV2HeaderByteSize = 12;
@interface SDLV2ProtocolHeader ()
@@ -22,14 +22,14 @@ const int V2PROTOCOL_HEADERSIZE = 12;
- (instancetype)initWithVersion:(UInt8)version {
if (self = [super init]) {
_version = version;
- _size = V2PROTOCOL_HEADERSIZE;
+ _size = ProtocolV2HeaderByteSize;
}
return self;
}
- (NSData *)data {
// Assembles the properties in the binary header format
- Byte headerBytes[V2PROTOCOL_HEADERSIZE] = {0};
+ Byte headerBytes[ProtocolV2HeaderByteSize] = {0};
Byte version = (self.version & 0xF) << 4; // first 4 bits
Byte encrypted = (self.encrypted ? 1 : 0) << 3; // next 1 bit
@@ -48,7 +48,7 @@ const int V2PROTOCOL_HEADERSIZE = 12;
*p = CFSwapInt32HostToBig(self.messageID);
// Now put it all in an NSData object.
- NSData *dataOut = [NSData dataWithBytes:headerBytes length:V2PROTOCOL_HEADERSIZE];
+ NSData *dataOut = [NSData dataWithBytes:headerBytes length:ProtocolV2HeaderByteSize];
return dataOut;
}