fix mptp packet graphic, fix formatting

This commit is contained in:
ngn 2024-06-21 01:39:53 +03:00
parent 82cbd147b2
commit e773ff7f09
2 changed files with 33 additions and 29 deletions

View File

@ -1,18 +1,20 @@
#pragma once #pragma once
#include <stdint.h>
#include "types.h" #include "types.h"
#include <stdint.h>
// clang-format off
/* /*
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
##################################### ###############
# FLAGS # # FLAGS #
##################################### ###############
# SIZE # # SIZE #
# # # #
##################################### ###############
# DATA # # DATA #
#...................................# #.............#
[8 bits] FLAGS [8 bits] FLAGS
--------------------------------------------------------- ---------------------------------------------------------
@ -57,18 +59,20 @@
*/ */
// clang-format on
#define MPTP_VERSION_SUPPORTED 0 #define MPTP_VERSION_SUPPORTED 0
#define MPTP_VERSION_MAX 15 // 4 bits #define MPTP_VERSION_MAX 15 // 4 bits
#define MPTP_CODE_MAX 4 // 2 bits #define MPTP_CODE_MAX 4 // 2 bits
typedef enum lm_mptp_request{ typedef enum lm_mptp_request {
MPTP_C2S_PING = 0, MPTP_C2S_PING = 0,
MPTP_C2S_INFO = 1, MPTP_C2S_INFO = 1,
MPTP_C2S_LIST = 2, MPTP_C2S_LIST = 2,
MPTP_C2S_PULL = 3, MPTP_C2S_PULL = 3,
} lm_mptp_request_t; } lm_mptp_request_t;
typedef enum lm_mptp_response{ typedef enum lm_mptp_response {
MPTP_S2C_PONG = 0, MPTP_S2C_PONG = 0,
MPTP_S2C_COOL = 1, MPTP_S2C_COOL = 1,
MPTP_S2C_BRUH = 2, MPTP_S2C_BRUH = 2,