Lines Matching refs:client
541 static uint32_t connect_properties_length(const struct mqtt_client *client) in connect_properties_length() argument
543 return uint32_property_length(client->prop.session_expiry_interval) + in connect_properties_length()
544 uint16_property_length(client->prop.receive_maximum) + in connect_properties_length()
545 uint32_property_length(client->prop.maximum_packet_size) + in connect_properties_length()
548 client->prop.request_response_info ? 1U : 0U) + in connect_properties_length()
550 client->prop.request_problem_info ? 1U : 0U) + in connect_properties_length()
551 user_properties_length(client->prop.user_prop) + in connect_properties_length()
552 string_property_length(&client->prop.auth_method) + in connect_properties_length()
553 binary_property_length(&client->prop.auth_data); in connect_properties_length()
556 static int connect_properties_encode(const struct mqtt_client *client, in connect_properties_encode() argument
563 properties_len = connect_properties_length(client); in connect_properties_encode()
570 client->prop.session_expiry_interval, buf); in connect_properties_encode()
576 client->prop.receive_maximum, buf); in connect_properties_encode()
582 client->prop.maximum_packet_size, buf); in connect_properties_encode()
594 client->prop.request_response_info ? 1U : 0U, in connect_properties_encode()
601 client->prop.request_problem_info ? 1U : 0U, in connect_properties_encode()
607 err = encode_user_properties(client->prop.user_prop, buf); in connect_properties_encode()
613 &client->prop.auth_method, buf); in connect_properties_encode()
619 &client->prop.auth_data, buf); in connect_properties_encode()
627 static uint32_t will_properties_length(const struct mqtt_client *client) in will_properties_length() argument
629 return uint32_property_length(client->will_prop.will_delay_interval) + in will_properties_length()
631 client->will_prop.payload_format_indicator) + in will_properties_length()
632 uint32_property_length(client->will_prop.message_expiry_interval) + in will_properties_length()
633 string_property_length(&client->will_prop.content_type) + in will_properties_length()
634 string_property_length(&client->will_prop.response_topic) + in will_properties_length()
635 binary_property_length(&client->will_prop.correlation_data) + in will_properties_length()
636 user_properties_length(client->will_prop.user_prop); in will_properties_length()
639 static int will_properties_encode(const struct mqtt_client *client, in will_properties_encode() argument
646 properties_len = will_properties_length(client); in will_properties_encode()
653 client->will_prop.will_delay_interval, buf); in will_properties_encode()
659 client->will_prop.payload_format_indicator, in will_properties_encode()
666 client->will_prop.message_expiry_interval, in will_properties_encode()
673 &client->will_prop.content_type, buf); in will_properties_encode()
679 &client->will_prop.response_topic, buf); in will_properties_encode()
685 &client->will_prop.correlation_data, buf); in will_properties_encode()
690 err = encode_user_properties(client->will_prop.user_prop, buf); in will_properties_encode()
699 static int connect_properties_encode(const struct mqtt_client *client, in connect_properties_encode() argument
702 ARG_UNUSED(client); in connect_properties_encode()
708 static int will_properties_encode(const struct mqtt_client *client, in will_properties_encode() argument
711 ARG_UNUSED(client); in will_properties_encode()
718 int connect_request_encode(const struct mqtt_client *client, in connect_request_encode() argument
721 uint8_t connect_flags = client->clean_session << 1; in connect_request_encode()
729 if (client->protocol_version == MQTT_VERSION_3_1_0) { in connect_request_encode()
748 NET_DBG("Encoding Protocol Version %02x.", client->protocol_version); in connect_request_encode()
749 err_code = pack_uint8(client->protocol_version, buf); in connect_request_encode()
764 NET_DBG("Encoding Keep Alive Time %04x.", client->keepalive); in connect_request_encode()
765 err_code = pack_uint16(client->keepalive, buf); in connect_request_encode()
771 if (mqtt_is_version_5_0(client)) { in connect_request_encode()
772 err_code = connect_properties_encode(client, buf); in connect_request_encode()
778 NET_HEXDUMP_DBG(client->client_id.utf8, client->client_id.size, in connect_request_encode()
780 err_code = pack_utf8_str(&client->client_id, buf); in connect_request_encode()
786 if (client->will_topic != NULL) { in connect_request_encode()
789 connect_flags |= ((client->will_topic->qos & 0x03) << 3); in connect_request_encode()
790 connect_flags |= client->will_retain << 5; in connect_request_encode()
793 if (mqtt_is_version_5_0(client)) { in connect_request_encode()
794 err_code = will_properties_encode(client, buf); in connect_request_encode()
800 NET_HEXDUMP_DBG(client->will_topic->topic.utf8, in connect_request_encode()
801 client->will_topic->topic.size, in connect_request_encode()
803 err_code = pack_utf8_str(&client->will_topic->topic, buf); in connect_request_encode()
808 if (client->will_message != NULL) { in connect_request_encode()
809 NET_HEXDUMP_DBG(client->will_message->utf8, in connect_request_encode()
810 client->will_message->size, in connect_request_encode()
812 err_code = pack_utf8_str(client->will_message, buf); in connect_request_encode()
826 if (client->user_name != NULL) { in connect_request_encode()
829 NET_HEXDUMP_DBG(client->user_name->utf8, in connect_request_encode()
830 client->user_name->size, in connect_request_encode()
832 err_code = pack_utf8_str(client->user_name, buf); in connect_request_encode()
839 if (client->password != NULL) { in connect_request_encode()
842 NET_HEXDUMP_DBG(client->password->utf8, in connect_request_encode()
843 client->password->size, in connect_request_encode()
845 err_code = pack_utf8_str(client->password, buf); in connect_request_encode()
940 int publish_encode(const struct mqtt_client *client, in publish_encode() argument
971 if (mqtt_is_version_5_0(client)) { in publish_encode()
1098 int publish_ack_encode(const struct mqtt_client *client, in publish_ack_encode() argument
1108 if (mqtt_is_version_5_0(client)) { in publish_ack_encode()
1118 int publish_receive_encode(const struct mqtt_client *client, in publish_receive_encode() argument
1128 if (mqtt_is_version_5_0(client)) { in publish_receive_encode()
1138 int publish_release_encode(const struct mqtt_client *client, in publish_release_encode() argument
1148 if (mqtt_is_version_5_0(client)) { in publish_release_encode()
1158 int publish_complete_encode(const struct mqtt_client *client, in publish_complete_encode() argument
1168 if (mqtt_is_version_5_0(client)) { in publish_complete_encode()
1294 int disconnect_encode(const struct mqtt_client *client, in disconnect_encode() argument
1298 if (!mqtt_is_version_5_0(client) || param == NULL) { in disconnect_encode()
1351 int subscribe_encode(const struct mqtt_client *client, in subscribe_encode() argument
1374 if (mqtt_is_version_5_0(client)) { in subscribe_encode()
1434 int unsubscribe_encode(const struct mqtt_client *client, in unsubscribe_encode() argument
1452 if (mqtt_is_version_5_0(client)) { in unsubscribe_encode()