KAAFramer Class Reference

Inherits from NSObject
Declared in KAAFramer.h
KAAFramer.m

Overview

KaaTcp Framer class. Used to cut incoming byte stream into MQTT frames, and deliver frames to MqttFrameDelegate. Framer Class typically used from MessageFactory class.

Other Methods

– pushBytes:

Process incoming bytes stream. Assumes that data is unprocessed. In case of previous call eaten not all data on next iterations data should start from unprocessed bytes.

- (int32_t)pushBytes:(NSMutableData *)data

Parameters

data

Data to push

Return Value

Number of bytes processed from this data.

Discussion

Process incoming bytes stream. Assumes that data is unprocessed. In case of previous call eaten not all data on next iterations data should start from unprocessed bytes.

Exceptions

KaaTcpProtocolException

In case of protocol errors.

Declared In

KAAFramer.h

– flush

Reset Framer state by dropping current frame.

- (void)flush

Discussion

Reset Framer state by dropping current frame.

Declared In

KAAFramer.h

Other Methods

– getFrameByType:

Creates specific Kaatcp message by MessageType

- (KAAMqttFrame *)getFrameByType:(char)type

Parameters

type
  • KaaMessageType of mqttFrame

Return Value

mqttFrame @throws KaaTcpProtocolException if specified type is unsupported

Discussion

Creates specific Kaatcp message by MessageType

Declared In

KAAFramer.m