summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h')
-rw-r--r--SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h b/SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h
new file mode 100644
index 000000000..ac98ecac9
--- /dev/null
+++ b/SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h
@@ -0,0 +1,31 @@
+//
+// SDLProtocolReceivedMessageProcessor.h
+// SmartDeviceLink
+//
+// Created by George Miller on 7/13/22.
+// Copyright © 2022 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@class SDLProtocolHeader;
+
+/**
+ * Handles decryption and creation of the message from header and payload. Decryption needed to be handled outside of the MessageProcessor because of access to the securitymanager.
+ * @param header Pointer to the header for the message
+ * @param payload Pointer to the payload of the message
+ */
+typedef void (^StateMachineMessageReadyBlock)(SDLProtocolHeader *header, NSData *payload);
+
+/// Class for processing received byte data into protocol messages
+@interface SDLProtocolReceivedMessageProcessor : NSObject
+
+/**
+ * Processes a data buffer into the state machine.
+ * Loop through the given bytes and call the state machine to process each byte.
+ * @param receiveBuffer The data to process
+ * @param messageReadyBlock Passes back a completed protocol message when one has been assembled
+ */
+- (void)processReceiveBuffer:(NSData *)receiveBuffer withMessageReadyBlock:(StateMachineMessageReadyBlock)messageReadyBlock;
+
+@end