diff options
author | jacobrau-livio <114027102+jacobrau-livio@users.noreply.github.com> | 2022-10-26 07:25:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 07:25:36 -0700 |
commit | a26dbc28de24ca7ad9fc4258394ebcdf4387bccc (patch) | |
tree | 5068069ea214ab14e8e805da9ef1e0860a985cab /SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h | |
parent | 3869a3028830035c4c1529149f88ba56d0b23153 (diff) | |
parent | b234b1b9c0e677740924a11776f9d07cf711fb3f (diff) | |
download | sdl_ios-master.tar.gz |
v7.6.0 Release
Diffstat (limited to 'SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h')
-rw-r--r-- | SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.h | 31 |
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 |