<commit_before>/*
 * Copyright Runtime.io 2018. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/**
 * @file
 * @brief Utility functions used by the UART and shell mcumgr transports.
 *
 * Mcumgr packets sent over serial are fragmented into frames of 128 bytes or
 * fewer.
 *
 * The initial frame in a packet has the following format:
 *     offset 0:    0x06 0x09
 *     === Begin base64 encoding ===
 *     offset 2:    {16-bit packet-length}
 *     offset ?:    {body}
 *     offset ?:    {crc16} (if final frame)
 *     === End base64 encoding ===
 *     offset ?:    0x0a (newline)
 *
 * All subsequent frames have the following format:
 *     offset 0:    0x04 0x14
 *     === Begin base64 encoding ===
 *     offset 2:    {body}
 *     offset ?:    {crc16} (if final frame)
 *     === End base64 encoding ===
 *     offset ?:    0x0a (newline)
 *
 * All integers are represented in big-endian.  The packet fields are described
 * below:
 *
 * | Field          | Description                                             |
 * | -------------- | ------------------------------------------------------- |
 * | 0x06 0x09      | Byte pair indicating the start of a packet.             |
 * | 0x04 0x14      | Byte pair indicating the start of a continuation frame. |
 * | Packet length  | The combined total length of the *unencoded* body.      |<commit_msg>mgmt/mcumgr: Correct packet length information<commit_after>/*
 * Copyright Runtime.io 2018. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/**
 * @file
 * @brief Utility functions used by the UART and shell mcumgr transports.
 *
 * Mcumgr packets sent over serial are fragmented into frames of 128 bytes or
 * fewer.
 *
 * The initial frame in a packet has the following format:
 *     offset 0:    0x06 0x09
 *     === Begin base64 encoding ===
 *     offset 2:    {16-bit packet-length}
 *     offset ?:    {body}
 *     offset ?:    {crc16} (if final frame)
 *     === End base64 encoding ===
 *     offset ?:    0x0a (newline)
 *
 * All subsequent frames have the following format:
 *     offset 0:    0x04 0x14
 *     === Begin base64 encoding ===
 *     offset 2:    {body}
 *     offset ?:    {crc16} (if final frame)
 *     === End base64 encoding ===
 *     offset ?:    0x0a (newline)
 *
 * All integers are represented in big-endian.  The packet fields are described
 * below:
 *
 * | Field          | Description                                             |
 * | -------------- | ------------------------------------------------------- |
 * | 0x06 0x09      | Byte pair indicating the start of a packet.             |
 * | 0x04 0x14      | Byte pair indicating the start of a continuation frame. |
 * | Packet length  | The combined total length of the *unencoded* body plus  |
 * |                | the final CRC (2 bytes). Length is in Big-Endian format.|
{'fraction_non_alphanumeric': 0.148380355276907, 'fraction_numerical': 0.038662486938349006, 'mean_word_length': 1.8212180746561886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7529952', 'n_tokens_mistral': 875, 'n_tokens_neox': 794, 'n_words': 299}