summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2016-02-25 11:19:20 -0500
committerJoel Fischer <joeljfischer@gmail.com>2016-02-25 11:19:20 -0500
commit1a79ffca30ae35ca97afcaf8622a7ca3e1a9e639 (patch)
treeb976f266b05bf9b30749a0cd96cc1cee0cbc5576
parent0c2034a878ea3b8e80df4960cc786fc6d624bf28 (diff)
downloadsdl_ios-1a79ffca30ae35ca97afcaf8622a7ca3e1a9e639.tar.gz
BulkData fixes
* SDLProtocol now sets service type to BulkData when there is binary data in the RPC message * SDLProtocolMessage should now print correctly to the console if it is a bulk data message * An RPC payload will now correctly convert to a dictionary if the service type is bulk data
-rw-r--r--SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m2
-rw-r--r--SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocolMessage.m2
-rw-r--r--SmartDeviceLink-iOS/SmartDeviceLink/SDLV2ProtocolMessage.m2
3 files changed, 3 insertions, 3 deletions
diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m
index fa55239a6..3f4a765be 100644
--- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m
+++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m
@@ -154,7 +154,7 @@
// Build the protocol level header & message
SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].protocolVersion];
header.frameType = SDLFrameType_Single;
- header.serviceType = SDLServiceType_RPC;
+ header.serviceType = (message.bulkData.length <= 0) ? SDLServiceType_RPC : SDLServiceType_BulkData;
header.frameData = SDLFrameData_SingleFrame;
header.sessionID = [self retrieveSessionIDforServiceType:SDLServiceType_RPC];
header.bytesInPayload = (UInt32)messagePayload.length;
diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocolMessage.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocolMessage.m
index 4689cf3e8..e96c61455 100644
--- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocolMessage.m
+++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocolMessage.m
@@ -55,7 +55,7 @@
[description appendString:self.header.description];
// If it's an RPC, provide greater detail
- if (self.header.serviceType == SDLServiceType_RPC && (self.header.frameType == SDLFrameType_Single)) {
+ if (((self.header.serviceType == SDLServiceType_RPC) || (self.header.serviceType == SDLServiceType_BulkData)) && (self.header.frameType == SDLFrameType_Single)) {
// version of RPC Message determines how we access the info.
if (self.header.version >= 2) {
SDLRPCPayload *rpcPayload = [SDLRPCPayload rpcPayloadWithData:self.payload];
diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLV2ProtocolMessage.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLV2ProtocolMessage.m
index 80d06898c..6d048b71d 100644
--- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLV2ProtocolMessage.m
+++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLV2ProtocolMessage.m
@@ -22,7 +22,7 @@
// Convert RPC payload to dictionary (for consumption by RPC layer)
- (NSDictionary *)rpcDictionary {
// Only applicable to RPCs
- if (self.header.serviceType != SDLServiceType_RPC) {
+ if ((self.header.serviceType != SDLServiceType_RPC) && (self.header.serviceType != SDLServiceType_BulkData)) {
return nil;
}