68 lines
2.1 KiB
C
68 lines
2.1 KiB
C
|
|
#ifndef OH_BS_R_ORDER_AB_H
|
||
|
|
#define OH_BS_R_ORDER_AB_H
|
||
|
|
|
||
|
|
#include "DataPacket.h"
|
||
|
|
#include "ByteTool.h"
|
||
|
|
#include "../Configuration/BS_Log.h"
|
||
|
|
#include "Terminal/Terminal.h"
|
||
|
|
|
||
|
|
class R_Order_AB {
|
||
|
|
public:
|
||
|
|
static void Function(const DataPacket& packet){
|
||
|
|
const auto N = packet.FunNumber.get();
|
||
|
|
const auto hex = APPTool::GetHX(N);
|
||
|
|
const auto str = CC::format("RoutingAB::Function(%s)", hex.c_str());
|
||
|
|
BS_Log::Log(str);
|
||
|
|
}
|
||
|
|
static void Function_0x02(const DataPacket& packet){
|
||
|
|
const auto Setting = Config::getConfig();
|
||
|
|
const auto ID = APPTool::GetInt(packet.Parameter2, packet.Parameter3);
|
||
|
|
if (packet.Parameter1 == 0x00) {
|
||
|
|
|
||
|
|
}
|
||
|
|
else if (packet.Parameter1 == 0x01) {
|
||
|
|
Setting->ID = ID;
|
||
|
|
BS_Log::Log("Function_0x02 ID Change to {}", ID);
|
||
|
|
}
|
||
|
|
const auto str = Terminal::toTermInfo();
|
||
|
|
const auto IDS = APPTool::GetBytes(Setting->ID);
|
||
|
|
const auto Len = APPTool::GetBytes(str.size());
|
||
|
|
CTL::ByteArray data = {0x66,0xAB,0x03,0x00,IDS[0],IDS[1],Len[0],Len[1]};
|
||
|
|
data.append(str);
|
||
|
|
if (packet.IsTCP && packet.AimWS) {
|
||
|
|
packet.AimWS->SendBinary(data);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
static void Function_0x03(const DataPacket& packet){
|
||
|
|
const auto Setting = Config::getConfig();
|
||
|
|
const auto str = Terminal::toTermInfo();
|
||
|
|
const auto IDS = APPTool::GetBytes(Setting->ID);
|
||
|
|
const auto Len = APPTool::GetBytes(str.size());
|
||
|
|
CTL::ByteArray data = {0x66,0xAB,0x03,0x00,IDS[0],IDS[1],Len[0],Len[1]};
|
||
|
|
data.append(str);
|
||
|
|
if (packet.IsTCP && packet.AimWS) {
|
||
|
|
packet.AimWS->SendBinary(data);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
static void Function_0x04(const DataPacket& packet){
|
||
|
|
|
||
|
|
}
|
||
|
|
static void Function_0x05(const DataPacket& packet){
|
||
|
|
|
||
|
|
}
|
||
|
|
static void Function_0x06(const DataPacket& packet) {
|
||
|
|
|
||
|
|
}
|
||
|
|
static void Function_0x15(const DataPacket& packet) {
|
||
|
|
|
||
|
|
}
|
||
|
|
static void Function_0xA0(const DataPacket& packet){
|
||
|
|
|
||
|
|
}
|
||
|
|
static void Function_0xA1(const DataPacket& packet){
|
||
|
|
const int ID = APPTool::GetInt(packet.Parameter2, packet.Parameter3);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|