-
Notifications
You must be signed in to change notification settings - Fork 1
/
debug.cpp
24 lines (22 loc) · 2.05 KB
/
debug.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <variant>
#include <cstring>
#include <vector>
#include <iterator>
#include "common-consts.h"
#include "protocol.h"
using namespace std;
int main(int argc, char *argv[]) {
// const uint8_t request[] = {0x6f, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x80,
// 0xf7, 0x26, 0x86, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01,
// 0x00, 0x02, 0x00, 0x03};
// const uint8_t request2[]= {0x6f, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
// 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01,
// 0x00, 0x02, 0x00, 0x03};
// const uint8_t request3[] = {0x6f, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x06, 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x00, 0x03, 0x00, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64};
// print_tlv_packet(request, sizeof(request));
// print_tlv_packet(request2, sizeof(request2));
// print_tlv_packet(request3, sizeof(request3));
// const uint8_t msg[] = {0x00, 0x01, 0x00, 0x08, 0x68, 0x69, 0x61, 0x6E, 0x67, 0x65, 0x6C, 0x31, 0x00, 0x02, 0x00, 0x07, 0x68, 0x69, 0x61, 0x6E, 0x67, 0x65, 0x6C, 0x04, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x01, 0x60, 0x86, 0x72, 0x8E, 0xC0, 0x00, 0x07, 0x00, 0x08, 0x00, 0x00, 0x01, 0x60, 0x86, 0x72, 0x8E, 0xC0, 0x00, 0x03, 0x00, 0x02, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00, 0x00, 0x06, 0x00, 0x09, 0x48, 0x65, 0x79, 0x2C, 0x20, 0x79, 0x6F, 0x75, 0x21};
const uint8_t msg[] = { 0x00, 0x02, 0x00, 0x13, 0x74, 0x72, 0x69, 0x6C, 0x6C, 0x69, 0x61, 0x6E, 0x3A, 0x69, 0x64, 0x65, 0x6E, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x00, 0x04, 0x00, 0x14, 0x85, 0xD8, 0x07, 0xFF, 0xEF, 0x6C, 0x1C, 0x84, 0xD3, 0x5E, 0xFF, 0xFD, 0x45, 0x88, 0xE1, 0x0B, 0x75, 0x0D, 0xF7, 0x83};
puts(show_tlv_units(msg, sizeof(msg), 0, templ_user_msg).c_str());
}